all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lee Thompson <lee.p.thomp@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Add option to export mixed Setext and ATX-style Markdown headlines
Date: Sat, 11 May 2024 20:52:08 +0100	[thread overview]
Message-ID: <871q682kk7.fsf@gmail.com> (raw)
In-Reply-To: <87msowtdgm.fsf@localhost> (Ihor Radchenko's message of "Sat, 11 May 2024 18:23:21 +0000")

Hi Ihor,

> But isn't (setq org-md-headline-style 'setext) do exactly what you describe?
My apologies, I should have included an example. What I'm trying to
achieve is that instead of this: (set to setext)
> One
> ===
>
>
> Two
> ---
>
> 1.  Three
>
>     1.  Four

Or even something like this: (atx assuming #+options: h:4)

# One


## Two


### Three


#### Four


Setting `org-md-headline-style' to `'mixed' would produce the following:
(again assuming #+options: h:4)

One
===


Two
---


### Three


#### Four

> AFAIK, headlines below level 2 simply cannot be exported with setext
> style, so Org mode already falls back to atx in >2 levels.
Unless I'm doing something wrong or I've been hacking away with older
code I haven't observed this. It may be that I'm getting mixed up in
terminology and what you've demonstrated in your example is indeed
setext falling back to atx, but my understanding is that in your example
the first two headlines are in setext style and the third and
fourth-level headlines have been converted to Markdown lists.

What I am proposing is a style where setext-style underlined headlines
are generated for levels 1 and 2, atx-style repeated hash characters for
levels 3 to 6, and then converted to lists for deeper levels. To
demonstrate:

#+options: toc:nil h:6
* One

** Two
*** Three
**** Four
***** Five
****** Six
******* Seven
******** Eight

Exports to:

One
===


Two
---


### Three


#### Four


##### Five


###### Six

1.  Seven

    1.  Eight


I hope this explains more clearly what I'm trying to achieve, do let me
know if not.


  reply	other threads:[~2024-05-11 19:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11 18:09 [PATCH] Add option to export mixed Setext and ATX-style Markdown headlines Lee Thompson
2024-05-11 18:23 ` Ihor Radchenko
2024-05-11 19:52   ` Lee Thompson [this message]
2024-05-12 11:59     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871q682kk7.fsf@gmail.com \
    --to=lee.p.thomp@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.