public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Modify syntax-highlighted code blocks with lua filter
@ 2021-03-30 10:37 Bart
       [not found] ` <88f14d06-7079-4330-a7ad-a9a3d9b0e4c8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Bart @ 2021-03-30 10:37 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1244 bytes --]


Greetings,

I am working on an application that uses markdown and supports code blocks. 
We also let users mark fragments of code blocks as if with a yellow marker.

We currently have a lua filter that does the marking, but it does not work 
in combination with syntax highlighting. It never returns the CodeBlock and 
so the highlighter is never called. I have determined that in order to make 
the two work together, I need to take the following steps:

- determine where the marking is supposed to go
- remove the [mark] tags and send the code block to the highlighter
- insert the marking in the resulting highlighted code.

However, I have not found a way to access highlighted code, or call the 
highlighter, from a lua filter. Is there a way to do that or is my plan 
doomed to failure?

I am also open to other suggestions.

-- 
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/88f14d06-7079-4330-a7ad-a9a3d9b0e4c8n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1685 bytes --]

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

* Re: Modify syntax-highlighted code blocks with lua filter
       [not found] ` <88f14d06-7079-4330-a7ad-a9a3d9b0e4c8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-03-30 16:12   ` John MacFarlane
       [not found]     ` <m2blb0ipse.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: John MacFarlane @ 2021-03-30 16:12 UTC (permalink / raw)
  To: Bart, pandoc-discuss


You can't do that from a filter, because highlighting is added
by the writer.

Bart <bart.hijmans-df9nrXIP1oRmR6Xm/wNWPw@public.gmane.org> writes:

> Greetings,
>
> I am working on an application that uses markdown and supports code blocks. 
> We also let users mark fragments of code blocks as if with a yellow marker.
>
> We currently have a lua filter that does the marking, but it does not work 
> in combination with syntax highlighting. It never returns the CodeBlock and 
> so the highlighter is never called. I have determined that in order to make 
> the two work together, I need to take the following steps:
>
> - determine where the marking is supposed to go
> - remove the [mark] tags and send the code block to the highlighter
> - insert the marking in the resulting highlighted code.
>
> However, I have not found a way to access highlighted code, or call the 
> highlighter, from a lua filter. Is there a way to do that or is my plan 
> doomed to failure?
>
> I am also open to other suggestions.
>
> -- 
> 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/88f14d06-7079-4330-a7ad-a9a3d9b0e4c8n%40googlegroups.com.


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

* Re: Modify syntax-highlighted code blocks with lua filter
       [not found]     ` <m2blb0ipse.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
@ 2021-03-30 19:38       ` Bart Hijmans
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Hijmans @ 2021-03-30 19:38 UTC (permalink / raw)
  To: John MacFarlane; +Cc: pandoc-discuss

[-- Attachment #1: Type: text/plain, Size: 2112 bytes --]

Ok, that's what I thought. I guess we'll have to choose either/or. Thanks.

On Tue, Mar 30, 2021 at 6:12 PM John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:

>
> You can't do that from a filter, because highlighting is added
> by the writer.
>
> Bart <bart.hijmans-df9nrXIP1oRmR6Xm/wNWPw@public.gmane.org> writes:
>
> > Greetings,
> >
> > I am working on an application that uses markdown and supports code
> blocks.
> > We also let users mark fragments of code blocks as if with a yellow
> marker.
> >
> > We currently have a lua filter that does the marking, but it does not
> work
> > in combination with syntax highlighting. It never returns the CodeBlock
> and
> > so the highlighter is never called. I have determined that in order to
> make
> > the two work together, I need to take the following steps:
> >
> > - determine where the marking is supposed to go
> > - remove the [mark] tags and send the code block to the highlighter
> > - insert the marking in the resulting highlighted code.
> >
> > However, I have not found a way to access highlighted code, or call the
> > highlighter, from a lua filter. Is there a way to do that or is my plan
> > doomed to failure?
> >
> > I am also open to other suggestions.
> >
> > --
> > 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/88f14d06-7079-4330-a7ad-a9a3d9b0e4c8n%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/CANx_DfMVuUz1M7rnCe2K76e3_51fWDiX706kyA%2BUri%2BQ%3D4PkaA%40mail.gmail.com.

[-- Attachment #2: Type: text/html, Size: 3241 bytes --]

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

end of thread, other threads:[~2021-03-30 19:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 10:37 Modify syntax-highlighted code blocks with lua filter Bart
     [not found] ` <88f14d06-7079-4330-a7ad-a9a3d9b0e4c8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-03-30 16:12   ` John MacFarlane
     [not found]     ` <m2blb0ipse.fsf-jF64zX8BO08an7k8zZ43ob9bIa4KchGshsV+eolpW18@public.gmane.org>
2021-03-30 19:38       ` Bart Hijmans

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