[Geany-Devel] patches to extend Markdown syntax highlighting

Lex Trotman elextr at xxxxx
Mon Jun 3 00:42:36 UTC 2013

On 2 June 2013 23:50, Carsten Allefeld <carsten.allefeld at googlemail.com>wrote:

> Hello,

As you say in your original email, Scintilla is a separate project.  We try
not to have a modified Scintilla since that implies patching and testing
every time there is an update.  So you should submit the Scintilla patches
to that project at www.scintilla.org.  If you feel that the Markdown lexing
is buggy, that is also where you should discuss it.

When the modified version of Scintilla is released we can apply the other
patches, it would be best if you could make a pull request for them so they
don't get forgotten.

I am not sure if the changes to the filetypes.markdown file affect only the
math styles, if they don't you probably should discuss it first so we can
see if other markdown users like or loath them.


> I recently cooked up a few minor patches to geany and sent them to
> Nick, see email quoted below. He told me it would be best if I
> subscribe to this list, so here I am.
> About me: I am a physicist-turned-neuroscientist, and I write texts
> including equations on a daily basis. Of course LaTeX is the
> established tool for that, but though it is very powerful it is also
> incredibly cumbersome to use. If you're writing just a short note the
> preamble can be longer than the actual text, you have to type \ { }
> and long environment and command names all the time, if you just make
> a small mistake you get cryptic unhelpful error messages, etc. etc. I
> guess that's why MS Word is so popular. ;-) However, writing formulas
> in anything else than LaTeX is even more cumbersome. That is why I was
> happy to find out that pandoc, a popular Markdown processor, supports
> LaTeX output and just copies LaTeX equations from the Markdown source
> into the LaTeX source. Great, the only thing missing is a versatile
> editor / lightweight IDE, and this is where Geany comes in. I wrote a
> few wrapper scripts in order to start Markdown+LaTeX processing from
> Geany through pandoc & pdflatex and show the result in acroread. – As
> I wrote below, I'm not a developer. I know some programming languages,
> including C and a bit of C++, but the only one I use regularly is
> Matlab.
> An addition to the email below: I have found since that the syntax
> highlighting especially of display equation blocks "$$-$$", but also
> of embedded images "![]()" is very unstable. It is possible that this
> is due to a bug introduced by me, but I don't see how since I
> basically duplicated existing code. Do you have any other reports
> about problems with the Markdown syntax highlighting code?
> Cheers,
> Carsten
> On 26 May 2013 15:28, Carsten Allefeld <carsten.allefeld at googlemail.com>
> wrote:
> > Hello,
> >
> > I hope this is the right way to contact you, if not please tell me
> > how. I'm writing because I put together a few small patches to geany
> > to extend the syntax highlighting. I did not subscribe to the
> > developer mailing list because I am not a professional developer, just
> > someone who can find his way around a source file, and I'm unlikely to
> > contribute much more in the future.
> >
> > The background is the following: Markdown comes in many flavors, one
> > of the most popular is the implementation in Pandoc
> > <http://johnmacfarlane.net/pandoc/>. Pandoc supports several backends,
> > besides html also docx and LaTeX. One of Pandoc's Markdown extensions
> > is to allow LaTeX-style equations in the Markdown text, which are
> > copied as-is if converting to LaTeX, but also if generating html,
> > since there are high-quality math typesetting libraries for websites
> > implemented in JavaScript (most notably MathJax
> > <http://www.mathjax.org/>) that can render them. As a scientist I use
> > this feature of Pandoc very extensively. When I recently discovered
> > geany as a high-quality text editor supporting Markdown syntax
> > highlighting, one of the few things I missed is highlighting of
> > embedded equations.
> >
> > The attached patches, generated via diff -u versus geany-1.23.tar.gz,
> > enable this. The changes basically duplicate the code for syntax
> > highlighting of inline code (`x`) and code blocks (indented), and use
> > them to enable highlighting of inline equations ($x$) and block
> > equations ($$x$$). I included changes to filetypes.markdown, which
> > defines styles for the new attributes mathi and mathd, but also
> > revises the highlighting styles for other Markdown attributes.
> >
> > Three of the six patches actually apply to Scintilla, which I
> > understand is a project whose code is included in geany, but developed
> > independently. I considered contacting the Scintilla developers, but
> > since the changes to Scintilla only make sense if combined with
> > changes to geany, I thought it better to contact you.
> >
> > Best Regards,
> > Carsten Allefeld
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20130603/8e113002/attachment-0001.html>

More information about the Devel mailing list