public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* IDs on paragraphs
@ 2022-07-30 14:42 Jiří Wolker
       [not found] ` <2be40adc-7a52-8aa9-9186-3693d19c1c9b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Jiří Wolker @ 2022-07-30 14:42 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Hello,

after going through the documentation, I can't find any way to assign an 
ID to paragraphs and I must do quite ugly workaround with anchor (empty 
link, at least in HTML) at the beginning of the paragraph. Is there a 
way to assign the ID to a paragraph directly (not using a div as a wrapper)?

Is it possible to add this feature to the Pandoc? (I am not very 
experienced in Haskell and I do not know whether adding attributes field 
to the paragraphs would break existing filters.)

I know that I can generate raw HTML using a filter but this does not 
seem to be the most versatile way to do it.

This feature could be useful for e.g. typesetting standards and laws, 
where it is quite handy to make every paragraph referencable from 
outside of the document.

Thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: IDs on paragraphs
       [not found] ` <2be40adc-7a52-8aa9-9186-3693d19c1c9b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2022-07-30 15:27   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2022-07-30 15:27 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

Currently attributes can't be placed directly on paragraphs.

If you use `-f commonmark_x`, you can use the generic attribute syntax

{#myid}
Here's my paragraph.

But because the pandoc AST can't directly put attributes on paragraphs, this will cause the paragraph to be placed in an enclosing Div which gets the id.

> On Jul 30, 2022, at 7:42 AM, Jiří Wolker <woljiri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> Hello,
> 
> after going through the documentation, I can't find any way to assign an ID to paragraphs and I must do quite ugly workaround with anchor (empty link, at least in HTML) at the beginning of the paragraph. Is there a way to assign the ID to a paragraph directly (not using a div as a wrapper)?
> 
> Is it possible to add this feature to the Pandoc? (I am not very experienced in Haskell and I do not know whether adding attributes field to the paragraphs would break existing filters.)
> 
> I know that I can generate raw HTML using a filter but this does not seem to be the most versatile way to do it.
> 
> This feature could be useful for e.g. typesetting standards and laws, where it is quite handy to make every paragraph referencable from outside of the document.
> 
> Thanks.
> 
> -- 
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2be40adc-7a52-8aa9-9186-3693d19c1c9b%40gmail.com.

-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/D16D348B-AB33-4729-8E5F-FC836DA31B44%40gmail.com.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-30 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-30 14:42 IDs on paragraphs Jiří Wolker
     [not found] ` <2be40adc-7a52-8aa9-9186-3693d19c1c9b-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-07-30 15:27   ` John MacFarlane

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).