public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "Pablo Rodríguez" <oinos-S0/GAf8tV78@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: How to change section dividers from div/section to li?
Date: Sat, 04 Jul 2015 10:23:04 +0200	[thread overview]
Message-ID: <559797E8.6050100@web.de> (raw)
In-Reply-To: <041499d2-158c-4dc9-b6d8-b5f8c0e0c3a0-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

On 07/04/2015 08:55 AM, Diego Algorta wrote:
> Hi,
> 
> (in case the code examples don't render well, you can see the same
> here: https://gist.github.com/oboxodo/f514d3bfe894bc1c85bd)
> 
> I basically need to use ordered lists for sections instead of div or
> section.

Hi Diego,

may I ask why do you need ordered lists instead of divs or sections? (I
suspect that you may get the same results with sections or divs and with
the proper CSS code.)

You’ll get ordered lists with the following source:

``` markdown
Independent paragraph.

1. # My heading 1

    Para in heading 1.

1. ## My heading 2

    Para in heading 2

1. # Another heading 1

    With its own para.
```

But you won’t get list items with heading attributes:
http://pandoc.org/try/?text=Independent+paragraph.%0A+%0A1.+%23+My+heading+1%0A+%0A++++Para+in+heading+1.%0A+%0A1.+%23%23+My+heading+2%0A+%0A++++Para+in+heading+2%0A+%0A1.+%23+Another+heading+1%0A+%0A++++With+its+own+para.&from=markdown&to=html5.


Pablo


> Given this input:
> 
> ```markdown
> 
> Independent paragraph.
>  
> # My heading 1
>  
> Para in heading 1.
>  
> ## My heading 2
>  
> Para in heading 2
>  
> # Another heading 1
>  
> With its own para.
> ```
> 
> Running pandoc with `--section-divs -t html5` currently produces:
> 
> ```html
> 
> <p>Independent paragraph.</p>
> <section id="my-heading-1" class="level1">
> <h1>My heading 1</h1>
> <p>Para in heading 1.</p>
> <section id="my-heading-2" class="level2">
> <h2>My heading 2</h2>
> <p>Para in heading 2</p>
> </section>
> </section>
> <section id="another-heading-1" class="level1">
> <h1>Another heading 1</h1>
> <p>With its own para.</p>
> 
> </section>
> ```
> 
> Can you think of the best way to change that (maybe a filter?) so that I
> get this instead?:
> 
> ```html
> 
> <p>Independent paragraph.</p>
> <ol>
> <li id="my-heading-1" class="level1">
> <h1>My heading 1</h1>
> <p>Para in heading 1.</p>
> <ol>
> <li id="my-heading-2" class="level2">
> <h2>My heading 2</h2>
> <p>Para in heading 2</p>
> </li>
> </ol>
> </li>
> <li id="another-heading-1" class="level1">
> <h1>Another heading 1</h1>
> <p>With its own para.</p>
> </li>
> </ol>
> 
> ```
> 
> I'm gaining experience writing nodejs based filters, in case that helps.
> But this seems to be out of the scope of filters, am I right?
> 
> Thanks!
> Diego


-- 
http://www.ousia.tk

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/559797E8.6050100%40web.de.
For more options, visit https://groups.google.com/d/optout.


  parent reply	other threads:[~2015-07-04  8:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-04  6:55 Diego Algorta
     [not found] ` <041499d2-158c-4dc9-b6d8-b5f8c0e0c3a0-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-07-04  7:01   ` Diego Algorta
2015-07-04  8:23   ` Pablo Rodríguez [this message]
     [not found]     ` <559797E8.6050100-S0/GAf8tV78@public.gmane.org>
2015-07-04 15:54       ` Diego Algorta
     [not found]         ` <d9d34f5d-570c-44ee-85fc-b3e15aa510cd-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-07-04 16:36           ` Diego Algorta
     [not found]             ` <5be3cf89-2604-4a51-8cec-3175198fecc4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-07-04 17:44               ` Pablo Rodríguez
     [not found]                 ` <55981B70.4080409-S0/GAf8tV78@public.gmane.org>
2015-07-05  0:52                   ` Diego Algorta
2015-07-04 22:24   ` John MacFarlane
     [not found]     ` <20150704222450.GC11787-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-07-05  1:02       ` Diego Algorta
     [not found]         ` <CAPfjgvJxjrE0E5=u1saMH8NPvRWf9Rb4PURmeiKFQ+xx7Zqyrg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-05  4:06           ` John MacFarlane
     [not found]             ` <20150705040611.GA12677-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-07-05 16:24               ` John MacFarlane
     [not found]                 ` <20150705162410.GA14096-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org>
2015-07-05 16:37                   ` fiddlosopher
     [not found]                     ` <ffc909e4-ed88-4852-a6a4-26f9a6f5162a-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-07-05 17:24                       ` fiddlosopher
     [not found]                         ` <ad4bf09c-2d32-44b7-9e69-f3d45c74ae54-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-07-06 18:23                           ` Diego Algorta

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=559797E8.6050100@web.de \
    --to=oinos-s0/gaf8tv78@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).