From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Add TITLE export to ox-md Date: Thu, 24 Aug 2017 11:30:29 +0200 Message-ID: <87a82p1fey.fsf@nicolasgoaziou.fr> References: <87fuchzllk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkoTG-0001OR-5X for emacs-orgmode@gnu.org; Thu, 24 Aug 2017 05:30:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkoTB-0007YR-47 for emacs-orgmode@gnu.org; Thu, 24 Aug 2017 05:30:38 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:44237) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkoTA-0007W4-UQ for emacs-orgmode@gnu.org; Thu, 24 Aug 2017 05:30:33 -0400 In-Reply-To: <87fuchzllk.fsf@gmail.com> (Jay Kamat's message of "Wed, 23 Aug 2017 23:32:55 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Jay Kamat Cc: emacs-orgmode@gnu.org Hello, Jay Kamat writes: > The markdown editor should support TITLE I'm not so sure about it. Vanilla Markdown does not support title. Neither does "ox-md.el" Is there any consensus about how title are handled in _vanilla_ syntax? > -(defun org-md-template (contents _info) > +(defun org-md-template (contents info) > "Return complete document string after Markdown conversion. > CONTENTS is the transcoded contents string. INFO is a plist used > as a communication channel." > - contents) > + (concat > + ;; Generate title and subtitle, if possible > + (let ((title (and (plist-get info :with-title) > + (plist-get info :title))) > + (subtitle (plist-get info :subtitle)) > + (style (plist-get info :md-headline-style))) > + (when title > + (concat > + (org-md--headline-title style > + 1 (org-export-data title info)) > + (when subtitle > + (org-md--headline-title style > + 2 (org-export-data subtitle info)))))) > + contents)) But then you would need to shift all headlines 1 or 2 levels down. `setext' style becomes unusable because there is no room left for other headlines. Regards, -- Nicolas Goaziou