Help - Search - Members - Calendar
Full Version: Export highlighted Modelica-Code
Modelica Forum > Modelica > Modelica
andreas
Hi,

I'm searching for a possibility to export modelica-code in a highlighted way. I use Dymola, but I can't export the code with colors e.g. in html oder rtf-format.
Do you know a good tool?

Within matlab it's possible to use copy&past to e.g. word with all colors and styles.

Thanks

Andreas
Dietmar Winkler
QUOTE(andreas @ Jul 17 2008, 07:01 PM) *

I'm searching for a possibility to export modelica-code in a highlighted way. I use Dymola, but I can't export the code with colors e.g. in html oder rtf-format.
Do you know a good tool?

Hi Andreas,
Have you tried Highlight yet? It's tool independent and does a rather good job.

Quote from http://www.modelica.org/tools --> Other tools:
QUOTE

Free syntax highlighting tool Highlight which converts source code to formatted text with syntax highlighting.
(Coloured output in HTML, XHTML, RTF, TeX, LaTeX and XML format, supports 120+ programming languages including Modelica)


/Dietmar
wagner
Hello Dietmar,

couldn't you have posted this answer one or two years ealier? ;-) This would have saved me several hours of work making my power point slides look like Dymola screenshots, but no being blurred.

Anyway, thanks to Andreas for posting the question and you posting the answer.

Regards

Florian
andreas
Hello Dietmar,

thanks for your answer. I tried highlight. Do you know a color-theme which looks like dymola?
Even if looking different. This tool helps me a lot.

Thanks

Andreas
wagner
Hi Andreas,

you can build your own Dymola-Theme by copying one of the theme files in the themes directory fo Highlight and adjusting the colors to the original Dymola ones.

Florian

QUOTE(andreas @ Jul 18 2008, 09:44 AM) *

Hello Dietmar,

thanks for your answer. I tried highlight. Do you know a color-theme which looks like dymola?
Even if looking different. This tool helps me a lot.

Thanks

Andreas

Dietmar Winkler
Actually I can also provide a syntax highlighting scheme for Pygments. I created it when trying to activate the syntax highlighting in the source browser view of the Modelica Trac issue tracker. (see http://trac.modelica.org/Modelica/browser).

You can use Pygments as standalone syntax highlighter. To activate highlighting for Modelica in your Pygments installation just copy the attached file ModelicaLexer.py into the lexers subdirectory and then run (on LinuX):
CODE
python _mapping.py
or (on Windows):
CODE
python.exe _mapping.py
in the same directory.

If anybody finds an error in or enhancement for the ModelicaLexer.py then please let me know and I can update the file also for the Modelica issue tracker.

/Dietmar
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.