public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "'Daniel Gnoutcheff' via pandoc-discuss" <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: FIguring out pandoc AST and types
Date: Fri, 17 Sep 2021 15:25:47 -0400	[thread overview]
Message-ID: <b467908f-a4ce-35b9-ba30-ef55e9e70958@softwarefreedom.org> (raw)
In-Reply-To: <4b3e7960-d144-44e0-9b48-a044db45f885n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

On 9/17/21 12:18 AM, Harsh Donga wrote:
> Sorry to bother you,
> 
> I could read in the documentation that Attr stores (identifier, classes, 
> key-value pairs)
> What do these actually mean? can you share an example?

The AST corresponds closely to Pandoc's Markdown dialect, so a good way 
to learn about an AST type is to study the User's Manual sections that 
document the corresponding Markdown features.  You may have noticed that 
the Attr type is used by the Header, CodeBlock, Div, Code, Link, Image, 
and Span data constructors.  In Pandoc's Markdown, headings, code 
blocks, div blocks, code inlines, links, images, and spans all can have 
"attributes".  The relevant manual sections discuss their syntax and how 
they are used (or ignored) by writers:

- <https://pandoc.org/MANUAL.html#extension-header_attributes>
- <https://pandoc.org/MANUAL.html#extension-fenced_code_attributes>
- <https://pandoc.org/MANUAL.html#extension-fenced_divs>
- <https://pandoc.org/MANUAL.html#extension-inline_code_attributes>
- <https://pandoc.org/MANUAL.html#extension-link_attributes>
- <https://pandoc.org/MANUAL.html#extension-bracketed_spans>

I would just add that Pandoc's HTML writer converts Attr values into 
HTML tag attributes, including those classes and key-value pairs that 
Pandoc does not itself recognize.  Attributes and classes that mean 
nothing to Pandoc can become meaningful if, for example, you provide a 
custom template with CSS or JavaScript that does something with them.

HTH!

Later,
Daniel G.


  parent reply	other threads:[~2021-09-17 19:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09  8:45 Harsh Donga
     [not found] ` <4bd5ecbc-bd1d-442a-9558-6724174f77fcn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-09-09 17:20   ` John MacFarlane
     [not found]     ` <m24kat3btu.fsf-jF64zX8BO0+FqBokazbCQ6OPv3vYUT2dxr7GGTnW70NeoWH0uzbU5w@public.gmane.org>
2021-09-14 12:28       ` Harsh Donga
2021-09-14 12:30       ` Harsh Donga
     [not found]         ` <3a59eb3c-352f-49f4-89f8-465aa7e86750n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-09-14 23:39           ` John MacFarlane
     [not found]             ` <yh480k35q63exs.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2021-09-16 11:52               ` Harsh Donga
     [not found]                 ` <68431aed-736c-425d-8745-14ffdc5468a9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-09-16 16:40                   ` John MacFarlane
     [not found]                     ` <m2ilz0lbie.fsf-d8241O7hbXoP5tpWdHSM3tPlBySK3R6THiGdP5j34PU@public.gmane.org>
2021-09-17  4:18                       ` Harsh Donga
     [not found]                         ` <4b3e7960-d144-44e0-9b48-a044db45f885n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-09-17 19:25                           ` 'Daniel Gnoutcheff' via pandoc-discuss [this message]
     [not found]                             ` <b467908f-a4ce-35b9-ba30-ef55e9e70958-rbQqYLFhARYurNyw8EiOWEB+6BGkLq7r@public.gmane.org>
2021-09-18 10:53                               ` BPJ

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=b467908f-a4ce-35b9-ba30-ef55e9e70958@softwarefreedom.org \
    --to=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).