public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: ANN: skylighting - a new syntax highlighting library
Date: Fri, 30 Dec 2016 09:08:47 -0700	[thread overview]
Message-ID: <20161230160847.GB29768@Johns-MacBook-Pro.local> (raw)
In-Reply-To: <CADAJKhB3eTPfWVgFncwgBOSgPp9CYZZG95LL5ucFYGCdG8tfow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

+++ Melroch [Dec 30 16 13:22 ]:
>   I think I would like to have a go at it as and when I have time.
>   I found what seems to be the definitive guide at
>   <[1]https://docs.kde.org/stable5/en/applications/katepart/highlight.htm
>   l>
>   Do you or anyone else know how to include another syntax (assuming that
>   you can e.g. include blocks of CSS in HTML or blocks of YAML in Pandoc
>   Markdown)?

Sure, there are good examples of this in other syntax
definitions.  Just grep the xml syntax definitions for

IncludeRules context="[^"]*##

For example in javascript.xml you'll find

      <context attribute="Comment" lineEndContext="#pop" name="Comment">
        <IncludeRules context="##Alerts" />
        <IncludeRules context="##Modelines" />
      </context>

and

    <context name="JS content" attribute="Other Text" lineEndContext="#stay">
      <RegExpr attribute="Element" context="El Close 2" String="&lt;/script\b" insensitive="true" endRegion="script" />
      <RegExpr attribute="Comment" context="JS comment close" String="//(?=.*&lt;/script\b)" insensitive="true" />
      <IncludeRules context="Normal##JavaScript" includeAttrib="true"/>
    </context>

That last one includes the Normal context from javascript.xml.


  parent reply	other threads:[~2016-12-30 16:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-24 23:13 John MacFarlane
     [not found] ` <20161224231305.GA76841-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
2016-12-28  4:12   ` Ivan Lazar Miljenovic
     [not found]     ` <CA+u6gbyZ63Y1OfOUy3oDO3vtC1ykxUWMTmCtDw2vL+FGjMUtrQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-28 15:14       ` John MacFarlane
     [not found]         ` <20161228151430.GA23464-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
2016-12-28 15:37           ` BP Jonsson
     [not found]             ` <dc5f3c92-d99c-e4ac-90e1-1359832ff862-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-12-29 19:08               ` John MacFarlane
     [not found]                 ` <20161229190824.GC26701-9Rnp8PDaXcadBw3G0RLmbRFnWt+6NQIA@public.gmane.org>
2016-12-30 12:22                   ` Melroch
     [not found]                     ` <CADAJKhB3eTPfWVgFncwgBOSgPp9CYZZG95LL5ucFYGCdG8tfow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-30 16:08                       ` John MacFarlane [this message]
2016-12-31  3:18           ` John MacFarlane

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=20161230160847.GB29768@Johns-MacBook-Pro.local \
    --to=jgm-tvlzxgkolnx2fbvcvol8/a@public.gmane.org \
    --cc=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).