* Singleton block construct with attributes? @ 2021-08-25 8:23 Axel Rauschmayer [not found] ` <066d8f5e-ede0-4705-9f38-4add41cb7ff1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Axel Rauschmayer @ 2021-08-25 8:23 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 771 bytes --] For two filters of mine, I’d like to use a singleton block construct that triggers them via a class. I was considering using a horizontal rule: ---{.pause} Alas, that doesn’t work. What is a good alternative? If there isn’t any, I can use the following syntax, but I’d prefer something that fits into a single line. ::: pause ::: -- 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/066d8f5e-ede0-4705-9f38-4add41cb7ff1n%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 1215 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <066d8f5e-ede0-4705-9f38-4add41cb7ff1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: Singleton block construct with attributes? [not found] ` <066d8f5e-ede0-4705-9f38-4add41cb7ff1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2021-08-25 9:41 ` William Lupton [not found] ` <CAEe_xxj-V3A-p31hUvuxy9WhJF_51-Lot_0R3zpnQGzHa-KuCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2021-08-25 16:33 ` BPJ 2021-08-25 19:08 ` Axel Rauschmayer 2 siblings, 1 reply; 9+ messages in thread From: William Lupton @ 2021-08-25 9:41 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1: Type: text/plain, Size: 1866 bytes --] I thought "Aha! But what about https://pandoc.org/MANUAL.html#extension-attributes?". However: % echo '---{.pause}' | pandoc --from=markdown+attributes The extension attributes is not supported for markdown https://pandoc.org/MANUAL.html#non-default-extensions seems to imply that these (including 'attributes') are all markdown extensions. What am I missing? On Wed, 25 Aug 2021 at 09:23, Axel Rauschmayer <rauschma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > For two filters of mine, I’d like to use a singleton block construct that > triggers them via a class. I was considering using a horizontal rule: > > ---{.pause} > > Alas, that doesn’t work. What is a good alternative? If there isn’t any, I > can use the following syntax, but I’d prefer something that fits into a > single line. > > ::: pause > ::: > > -- > 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/066d8f5e-ede0-4705-9f38-4add41cb7ff1n%40googlegroups.com > <https://groups.google.com/d/msgid/pandoc-discuss/066d8f5e-ede0-4705-9f38-4add41cb7ff1n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAEe_xxj-V3A-p31hUvuxy9WhJF_51-Lot_0R3zpnQGzHa-KuCg%40mail.gmail.com. [-- Attachment #2: Type: text/html, Size: 2955 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <CAEe_xxj-V3A-p31hUvuxy9WhJF_51-Lot_0R3zpnQGzHa-KuCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: Singleton block construct with attributes? [not found] ` <CAEe_xxj-V3A-p31hUvuxy9WhJF_51-Lot_0R3zpnQGzHa-KuCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2021-08-25 15:20 ` Gwern Branwen 2021-08-25 16:14 ` John MacFarlane 1 sibling, 0 replies; 9+ messages in thread From: Gwern Branwen @ 2021-08-25 15:20 UTC (permalink / raw) To: pandoc-discuss If you simply want some sort of keyword to plop in, why the obsession with attributes? There are lots of things you could write. The thing I'd immediately think of is writing a little div or span with a class, like: $ echo '[]{.pause}' | pandoc --from=markdown+native_spans --write native [Para [Span ("",["pause"],[]) []]] Now you just match on `foo (Span (_, ["pause"], _) _) = rewriteCode ...` in your API use. -- gwern https://www.gwern.net ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Singleton block construct with attributes? [not found] ` <CAEe_xxj-V3A-p31hUvuxy9WhJF_51-Lot_0R3zpnQGzHa-KuCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2021-08-25 15:20 ` Gwern Branwen @ 2021-08-25 16:14 ` John MacFarlane 1 sibling, 0 replies; 9+ messages in thread From: John MacFarlane @ 2021-08-25 16:14 UTC (permalink / raw) To: William Lupton, pandoc-discuss `attributes` is only supported for commonmark + variants, including gfm and commonmark_x. William Lupton <wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> writes: > I thought "Aha! But what about > https://pandoc.org/MANUAL.html#extension-attributes?". However: > > % echo '---{.pause}' | pandoc --from=markdown+attributes > The extension attributes is not supported for markdown > > https://pandoc.org/MANUAL.html#non-default-extensions seems to imply that > these (including 'attributes') are all markdown extensions. What am I > missing? > > On Wed, 25 Aug 2021 at 09:23, Axel Rauschmayer <rauschma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> For two filters of mine, I’d like to use a singleton block construct that >> triggers them via a class. I was considering using a horizontal rule: >> >> ---{.pause} >> >> Alas, that doesn’t work. What is a good alternative? If there isn’t any, I >> can use the following syntax, but I’d prefer something that fits into a >> single line. >> >> ::: pause >> ::: >> >> -- >> 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/066d8f5e-ede0-4705-9f38-4add41cb7ff1n%40googlegroups.com >> <https://groups.google.com/d/msgid/pandoc-discuss/066d8f5e-ede0-4705-9f38-4add41cb7ff1n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > > -- > 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/CAEe_xxj-V3A-p31hUvuxy9WhJF_51-Lot_0R3zpnQGzHa-KuCg%40mail.gmail.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/m2ilzth57h.fsf%40MacBook-Pro-2.hsd1.ca.comcast.net. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Singleton block construct with attributes? [not found] ` <066d8f5e-ede0-4705-9f38-4add41cb7ff1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2021-08-25 9:41 ` William Lupton @ 2021-08-25 16:33 ` BPJ [not found] ` <CADAJKhCHPhqJz_8b8EikbNoh_Ytyn5iPefS3cvkQA=tjD94nMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2021-08-25 19:08 ` Axel Rauschmayer 2 siblings, 1 reply; 9+ messages in thread From: BPJ @ 2021-08-25 16:33 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1: Type: text/plain, Size: 2157 bytes --] When I need a marker like this I use a code span, like `--pause` ``````lua -- Look for a paragraph function Para (para) -- With only one child if 1 == #para.content then local child = para.content[1] -- Which is a code span if 'Code' == child.type then -- Ignore it if it has a class .code, i.e. `--pause` is a marker, but -- `--pause`{.code} is "actual" code. if child.classes:includes('code') then return nil end -- If it is the marker return some block content if '--pauae' == child.text then return whatever() end end end return nil end `````` Den ons 25 aug. 2021 10:24Axel Rauschmayer <rauschma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev: > For two filters of mine, I’d like to use a singleton block construct that > triggers them via a class. I was considering using a horizontal rule: > > ---{.pause} > > Alas, that doesn’t work. What is a good alternative? If there isn’t any, I > can use the following syntax, but I’d prefer something that fits into a > single line. > > ::: pause > ::: > > -- > 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/066d8f5e-ede0-4705-9f38-4add41cb7ff1n%40googlegroups.com > <https://groups.google.com/d/msgid/pandoc-discuss/066d8f5e-ede0-4705-9f38-4add41cb7ff1n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CADAJKhCHPhqJz_8b8EikbNoh_Ytyn5iPefS3cvkQA%3DtjD94nMw%40mail.gmail.com. [-- Attachment #2: Type: text/html, Size: 3658 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <CADAJKhCHPhqJz_8b8EikbNoh_Ytyn5iPefS3cvkQA=tjD94nMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: Singleton block construct with attributes? [not found] ` <CADAJKhCHPhqJz_8b8EikbNoh_Ytyn5iPefS3cvkQA=tjD94nMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2021-08-25 16:37 ` BPJ 0 siblings, 0 replies; 9+ messages in thread From: BPJ @ 2021-08-25 16:37 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1: Type: text/plain, Size: 2364 bytes --] Oops. Typo on the last if line! Den ons 25 aug. 2021 18:33BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev: > When I need a marker like this I use a code span, like > > `--pause` > > ``````lua > -- Look for a paragraph > function Para (para) > -- With only one child > if 1 == #para.content then > local child = para.content[1] > -- Which is a code span > if 'Code' == child.type then > -- Ignore it if it has a class .code, i.e. `--pause` is a marker, but > -- `--pause`{.code} is "actual" code. > if child.classes:includes('code') then > return nil > end > -- If it is the marker return some block content > if '--pauae' == child.text then > return whatever() > end > end > end > return nil > end > `````` > > > Den ons 25 aug. 2021 10:24Axel Rauschmayer <rauschma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev: > >> For two filters of mine, I’d like to use a singleton block construct that >> triggers them via a class. I was considering using a horizontal rule: >> >> ---{.pause} >> >> Alas, that doesn’t work. What is a good alternative? If there isn’t any, >> I can use the following syntax, but I’d prefer something that fits into a >> single line. >> >> ::: pause >> ::: >> >> -- >> 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/066d8f5e-ede0-4705-9f38-4add41cb7ff1n%40googlegroups.com >> <https://groups.google.com/d/msgid/pandoc-discuss/066d8f5e-ede0-4705-9f38-4add41cb7ff1n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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/CADAJKhD-nf_TwJ8ojdN2zDhAc%2Bq-7svG713%3D2ZMDzeG4e9Edvg%40mail.gmail.com. [-- Attachment #2: Type: text/html, Size: 4133 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Singleton block construct with attributes? [not found] ` <066d8f5e-ede0-4705-9f38-4add41cb7ff1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2021-08-25 9:41 ` William Lupton 2021-08-25 16:33 ` BPJ @ 2021-08-25 19:08 ` Axel Rauschmayer [not found] ` <60bb4763-544c-4a15-b09c-d545aa60dcb1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2 siblings, 1 reply; 9+ messages in thread From: Axel Rauschmayer @ 2021-08-25 19:08 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 808 bytes --] Thanks for all the suggestions! With the right settings, some horizontal rule syntaxes do indeed work: % echo '___{.pause}' | pandoc --from=commonmark+attributes <p><span class="pause">___</span></p> % echo '***{.pause}' | pandoc --from=commonmark+attributes <p><span class="pause">***</span></p> % echo '---{.pause}' | pandoc --from=commonmark+attributes <p>--<span class="pause">-</span></p> -- 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/60bb4763-544c-4a15-b09c-d545aa60dcb1n%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 1489 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <60bb4763-544c-4a15-b09c-d545aa60dcb1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: Singleton block construct with attributes? [not found] ` <60bb4763-544c-4a15-b09c-d545aa60dcb1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2021-08-25 19:55 ` Axel Rauschmayer [not found] ` <b77d6ced-e951-4fec-8bb3-5ad8ed1c76a4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Axel Rauschmayer @ 2021-08-25 19:55 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 1019 bytes --] Ahem, I thought wrong: Pandoc actually treats horizontal rules as text if there are attributes in the same line. On Wednesday, August 25, 2021 at 9:08:13 PM UTC+2 Axel Rauschmayer wrote: > > Thanks for all the suggestions! > > With the right settings, some horizontal rule syntaxes do indeed work: > > % echo '___{.pause}' | pandoc --from=commonmark+attributes > <p><span class="pause">___</span></p> > % echo '***{.pause}' | pandoc --from=commonmark+attributes > <p><span class="pause">***</span></p> > % echo '---{.pause}' | pandoc --from=commonmark+attributes > <p>--<span class="pause">-</span></p> > -- 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/b77d6ced-e951-4fec-8bb3-5ad8ed1c76a4n%40googlegroups.com. [-- Attachment #1.2: Type: text/html, Size: 1945 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <b77d6ced-e951-4fec-8bb3-5ad8ed1c76a4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: Singleton block construct with attributes? [not found] ` <b77d6ced-e951-4fec-8bb3-5ad8ed1c76a4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2021-08-25 20:29 ` John MacFarlane 0 siblings, 0 replies; 9+ messages in thread From: John MacFarlane @ 2021-08-25 20:29 UTC (permalink / raw) To: Axel Rauschmayer, pandoc-discuss Attributes on block-level items have to go on the line before. {.pause} * * * * Axel Rauschmayer <rauschma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes: > Ahem, I thought wrong: Pandoc actually treats horizontal rules as text if > there are attributes in the same line. > > On Wednesday, August 25, 2021 at 9:08:13 PM UTC+2 Axel Rauschmayer wrote: > >> >> Thanks for all the suggestions! >> >> With the right settings, some horizontal rule syntaxes do indeed work: >> >> % echo '___{.pause}' | pandoc --from=commonmark+attributes >> <p><span class="pause">___</span></p> >> % echo '***{.pause}' | pandoc --from=commonmark+attributes >> <p><span class="pause">***</span></p> >> % echo '---{.pause}' | pandoc --from=commonmark+attributes >> <p>--<span class="pause">-</span></p> >> > > -- > 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/b77d6ced-e951-4fec-8bb3-5ad8ed1c76a4n%40googlegroups.com. ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-08-25 20:29 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-08-25 8:23 Singleton block construct with attributes? Axel Rauschmayer [not found] ` <066d8f5e-ede0-4705-9f38-4add41cb7ff1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2021-08-25 9:41 ` William Lupton [not found] ` <CAEe_xxj-V3A-p31hUvuxy9WhJF_51-Lot_0R3zpnQGzHa-KuCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2021-08-25 15:20 ` Gwern Branwen 2021-08-25 16:14 ` John MacFarlane 2021-08-25 16:33 ` BPJ [not found] ` <CADAJKhCHPhqJz_8b8EikbNoh_Ytyn5iPefS3cvkQA=tjD94nMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2021-08-25 16:37 ` BPJ 2021-08-25 19:08 ` Axel Rauschmayer [not found] ` <60bb4763-544c-4a15-b09c-d545aa60dcb1n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2021-08-25 19:55 ` Axel Rauschmayer [not found] ` <b77d6ced-e951-4fec-8bb3-5ad8ed1c76a4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2021-08-25 20:29 ` 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).