Dear mailing-list,
i work a lot with perl's Text::Template module to embed perl-code in various filetypes. In the template-file a perl fragment is listed between distinct delimiters, e.g. '[@@' that signals the beginning perl code and '@@]' that signals the end of perl code.
For instance, I assume that i use the module with LaTeX files. As geany support syntax highlighting for both perl-code as well as latex-code my question is whether it's possible to instruct geany to highlight the latex code of the template and the perl-fragments within the delimiters.
To make things more clear, a short example file:
#########################################################
\documentclass{article} \usepackage[utf8x]{inputenc} \usepackage{pstricks,pst-plot} \pagestyle{empty} \begin{document}
\psset{ury=1cm, urx=2cm, Dy=0.6 ,Dx=2, xAxisLabel=$t$/s, yAxisLabel=$y $/m}
\begin{psgraph}{->}(0,0)(-0.5,-2.7)(10.5,2.5){12cm}{9cm}% \listplot{% % [@@
# perl fragment that syntax has to be highlighted according to # filetypes.perl
listplot(data('integrate(sub { sin($_[0]) }, 0, $x, 1e-5, 1e-5)',0,10,400));
@@] % }
\end{psgraph} \end{document}
##########################################################
Maybe somebody of you experts can help me to achieve this!? And please be gentle with me since i haven't gather any experience customizing geany :)
With best regards and thanks for your effort
On 11 February 2012 01:10, Johannes Deutsch j_deutsch@web.de wrote:
Dear mailing-list,
i work a lot with perl's Text::Template module to embed perl-code in various filetypes. In the template-file a perl fragment is listed between distinct delimiters, e.g. '[@@' that signals the beginning perl code and '@@]' that signals the end of perl code.
For instance, I assume that i use the module with LaTeX files. As geany support syntax highlighting for both perl-code as well as latex-code my question is whether it's possible to instruct geany to highlight the latex code of the template and the perl-fragments within the delimiters.
To make things more clear, a short example file:
#########################################################
\documentclass{article} \usepackage[utf8x]{inputenc} \usepackage{pstricks,pst-plot} \pagestyle{empty} \begin{document}
\psset{ury=1cm, urx=2cm, Dy=0.6 ,Dx=2, xAxisLabel=$t$/s, yAxisLabel=$y $/m}
\begin{psgraph}{->}(0,0)(-0.5,-2.7)(10.5,2.5){12cm}{9cm}% \listplot{% % [@@
# perl fragment that syntax has to be highlighted according to # filetypes.perl
listplot(data('integrate(sub { sin($_[0]) }, 0, $x, 1e-5, 1e-5)',0,10,400));
@@] % }
\end{psgraph} \end{document}
##########################################################
Maybe somebody of you experts can help me to achieve this!? And please be gentle with me since i haven't gather any experience customizing geany :)
Hi,
Unfortunately the Scintilla editing component (www.scintilla.org) we use does not support embedded languages other than rudimentary support for a few scripting languages in HTML.
This is not done by using a different lexer, but written into the HTML lexer.
To change this you need to change Scintilla (written in C++) to provide this capability. Advice on doing that is beyond the scope of the Geany ML.
Regards Lex
With best regards and thanks for your effort
-- Johannes Deutsch
Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany