* Access Value of Fenced Div Attribute @ 2021-11-18 19:13 Chris Diaz [not found] ` <42f4641b-657d-4026-a568-ed24a2497dc6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Chris Diaz @ 2021-11-18 19:13 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 1122 bytes --] I'm converting a markdown file to HTML and DOCX (and other formats), and I'm using a custom Fenced Div and Lua filter to generate the HTML output with the <details> and <summary> tags. Here's the source: ::: { .question text="What is the difference between...?"} Answer. ::: When I set the output to DOCX, I get the answer, but I don't get the value of the "text" attribute in the fenced div. Pandoc seems to ignore it. Is there a way to print the value of the text attribute in the DOCX output? I don't need any special styles or anything, just printing the text above the answer in the document would be ideal I'm guessing I'd need a lua filter, but maybe there's an extension that could help? -- 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/42f4641b-657d-4026-a568-ed24a2497dc6n%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 1610 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <42f4641b-657d-4026-a568-ed24a2497dc6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: Access Value of Fenced Div Attribute [not found] ` <42f4641b-657d-4026-a568-ed24a2497dc6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2021-11-19 1:04 ` John MacFarlane [not found] ` <yh480kh7c9uf9k.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: John MacFarlane @ 2021-11-19 1:04 UTC (permalink / raw) To: Chris Diaz, pandoc-discuss You'd want to use a Lua filter to change this content into something printable. A simple thing would be something like (untested) ```lua function Div(el) if el.classes:includes("question") then return { pandoc.Para { pandoc.Strong { pandoc.Str(el.attributes.text) }}, el } end end ``` Chris Diaz <chris-diaz-angj7XTnwNpXfO9P/gJGhg@public.gmane.org> writes: > I'm converting a markdown file to HTML and DOCX (and other formats), and > I'm using a custom Fenced Div and Lua filter to generate the HTML output > with the <details> and <summary> tags. Here's the source: > > ::: { .question text="What is the difference between...?"} > > Answer. > > ::: > > When I set the output to DOCX, I get the answer, but I don't get the value > of the "text" attribute in the fenced div. > > Pandoc seems to ignore it. Is there a way to print the value of the text > attribute in the DOCX output? > > I don't need any special styles or anything, just printing the text above > the answer in the document would be ideal > > I'm guessing I'd need a lua filter, but maybe there's an extension that > could help? > > -- > 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/42f4641b-657d-4026-a568-ed24a2497dc6n%40googlegroups.com. ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <yh480kh7c9uf9k.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>]
* Re: Access Value of Fenced Div Attribute [not found] ` <yh480kh7c9uf9k.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org> @ 2021-11-19 16:25 ` Chris Diaz 0 siblings, 0 replies; 3+ messages in thread From: Chris Diaz @ 2021-11-19 16:25 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 2138 bytes --] Thanks! That worked perfectly! On Thursday, November 18, 2021 at 7:05:47 PM UTC-6 John MacFarlane wrote: > > You'd want to use a Lua filter to change this content into > something printable. > > A simple thing would be something like (untested) > > ```lua > function Div(el) > if el.classes:includes("question") then > return { pandoc.Para { pandoc.Strong { pandoc.Str(el.attributes.text) }}, > el } > end > end > ``` > > > Chris Diaz <chris...-angj7XTnwNpXfO9P/gJGhg@public.gmane.org> writes: > > > I'm converting a markdown file to HTML and DOCX (and other formats), and > > I'm using a custom Fenced Div and Lua filter to generate the HTML output > > with the <details> and <summary> tags. Here's the source: > > > > ::: { .question text="What is the difference between...?"} > > > > Answer. > > > > ::: > > > > When I set the output to DOCX, I get the answer, but I don't get the > value > > of the "text" attribute in the fenced div. > > > > Pandoc seems to ignore it. Is there a way to print the value of the text > > attribute in the DOCX output? > > > > I don't need any special styles or anything, just printing the text > above > > the answer in the document would be ideal > > > > I'm guessing I'd need a lua filter, but maybe there's an extension that > > could help? > > > > -- > > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/42f4641b-657d-4026-a568-ed24a2497dc6n%40googlegroups.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/0d016d9e-c737-4849-9c42-d3b696770adbn%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 3374 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-19 16:25 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-11-18 19:13 Access Value of Fenced Div Attribute Chris Diaz [not found] ` <42f4641b-657d-4026-a568-ed24a2497dc6n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2021-11-19 1:04 ` John MacFarlane [not found] ` <yh480kh7c9uf9k.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org> 2021-11-19 16:25 ` Chris Diaz
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).