[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Add TITLE export to ox-md

From: Nicolas Goaziou
Subject: Re: [O] [PATCH] Add TITLE export to ox-md
Date: Thu, 24 Aug 2017 11:30:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)


Jay Kamat <address@hidden> 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


Nicolas Goaziou

reply via email to

[Prev in Thread] Current Thread [Next in Thread]