Syntax highlighting: Difference between revisions

From ASCEND
Jump to navigation Jump to search
Restored page from Google Cache, uploaded by John Pye
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
If you would like to make use of syntax highlighting with ASCEND code, we have a number of options available:
If you would like to make use of syntax highlighting with ASCEND code, we have a number of options available. Contributions for other editors, or improvements for the ones already here, are always welcome!


== gedit ==


== gedit ==
[http://projects.gnome.org/gedit/ gedit] is the default text editor in GNOME (Linux: Ubuntu, Fedora, etc) and is also available on Windows and Mac. We have a syntax definition for gedit to support  a4c/a4l files. This file, <tt>ascend.lang</tt> needs to be placed in <tt>/usr/share/gtksourceview-N.0/language-specs/ascend.lang</tt>. The exact location where you need to put the file may vary depending on your version of GNOME (check the version fo gtksourceview installed on your system). Note that unless you also follow the instructions in [[Desktop integration]], you will still have to manually specify that you want to apply this syntax highlighting.


gedit is the default text editor in GNOME (Linux). We have a syntax definition for gedit to support  a4c/a4l files. This file, <tt>ascend.lang</tt> needs to be placed in <tt>/usr/share/gtksourceview-N.0/language-specs/ascend.lang</tt>. The exact location where you need to put the file may vary depending on your version of GNOME (check the version fo gtksourceview installed on your system). Note that unless you also follow the instructions in [[Desktop integration]], you will still have to manually specify that you want to apply this syntax highlighting.
* See {{src|tools/gedit/ascend.lang}} (for older systems based on gtksourceview-1.x)
* See {{src|tools/gtksourceview-2.0/ascend.lang}} (for systems based on gtksourceview-2.x)
* See {{src|tools/gtksourceview-3.0/ascend.lang}} (for current systems based on gtksourceview-3.x)


== Notepad++ ==


[http://notepad-plus-plus.org/ Notepad++] is a pretty nice free open-source text editor for Windows. We have an XML syntax definition file {{src|tools/notepad-plus/userDefineLang_ASCEND.xml}} which you can use to add highlighting for the ASCEND language. The syntax file was contributed by Wojciech Mandziuk. For instructions on how to use this file, see {{src|tools/notepad-plus/README.txt}}


* See {{src|tools/gedit/ascend.lang}} (for older systems based on gtksourceview-1.x)
If anyone would like to help improve this highlighting file, some problems are currently present with nested comments and also with [[ARE_THE_SAME]] when immediately followed by a semicolon. Also some [[ATOM]] types should be added. But it's still very useful as-is.
* See {{src|tools/gtksourceview-2.0/ascend.lang}} (for current systems based on gtksourceview-2.x)


== TextPad ==
== TextPad ==


[http://www.textpad.com TextPad] is a popular text editor on Windows
[http://www.textpad.com TextPad] is a popular text editor on Windows


* see {{src|tools/textpad/ascend.syn}}
* see {{src|tools/textpad/ascend.syn}}
Line 21: Line 23:
== highlight ==
== highlight ==


[http://www.andre-simon.de/index.html highlight] is a syntax highlighting utility that can be used to produce HTML, LaTeX and other forms of highlighted output. It can also be integrated with the scientific wordprocessor [http://www.lyx.org LyX] as well as the online code viewer [http://www.viewvc.org/ ViewVC].
Andre Simon's [http://www.andre-simon.de/ highlight] is a syntax highlighting utility that can be used to produce HTML, LaTeX and other forms of highlighted output. It can also be integrated with the scientific wordprocessor [http://www.lyx.org LyX] as well as the online code viewer [http://www.viewvc.org/ ViewVC].
 
 


* see {{src|tools/highlight/a4c.lang}}
* see {{src|tools/highlight/a4c.lang}}
Line 30: Line 30:


[http://www.vim.org/ Vim] is a very popular Linux/Unix text editor with a history going back to 1976. Syntax file contributed by Edgar Simo.
[http://www.vim.org/ Vim] is a very popular Linux/Unix text editor with a history going back to 1976. Syntax file contributed by Edgar Simo.


* see {{src|tools/vim/ascend.vim}}
* see {{src|tools/vim/ascend.vim}}
Line 37: Line 36:


[http://www.nano-editor.org/ GNU nano] is the default console-based editor for several newer distributions of Linux including Fedora and Ubuntu. It includes support for syntax highlighting since about 2002. A <tt>~/.nanorc</tt> for this editor has been contributed by Ondrej Krc-Jediny.
[http://www.nano-editor.org/ GNU nano] is the default console-based editor for several newer distributions of Linux including Fedora and Ubuntu. It includes support for syntax highlighting since about 2002. A <tt>~/.nanorc</tt> for this editor has been contributed by Ondrej Krc-Jediny.


* see {{src|tools/nano/ASCEND.nanorc}}
* see {{src|tools/nano/ASCEND.nanorc}}
Line 44: Line 42:


Previously, Emacs was used by a lot of the core ASCEND developers, and a special 'ASCEND mode' was developed. See {{srcdir|tools/emacs}}. There is some question about whether this mode still works correctly, see [http://www.mail-archive.com/ascend-sim-users@lists.sourceforge.net/msg00098.html the details].
Previously, Emacs was used by a lot of the core ASCEND developers, and a special 'ASCEND mode' was developed. See {{srcdir|tools/emacs}}. There is some question about whether this mode still works correctly, see [http://www.mail-archive.com/ascend-sim-users@lists.sourceforge.net/msg00098.html the details].


== listings ==
== listings ==


Listings is a LaTeX package that performs syntax highlighting. See the latex preamble of our <tt>book.lyx</tt> file.
Listings is a LaTeX package that performs syntax highlighting. You can extract the necessary code from the latex preamble of the file {{src|doc/book.lyx}}.
 
 
 
 


[[Category:Documentation]]
[[Category:Documentation]]

Latest revision as of 05:24, 7 July 2016

If you would like to make use of syntax highlighting with ASCEND code, we have a number of options available. Contributions for other editors, or improvements for the ones already here, are always welcome!

gedit

gedit is the default text editor in GNOME (Linux: Ubuntu, Fedora, etc) and is also available on Windows and Mac. We have a syntax definition for gedit to support a4c/a4l files. This file, ascend.lang needs to be placed in /usr/share/gtksourceview-N.0/language-specs/ascend.lang. The exact location where you need to put the file may vary depending on your version of GNOME (check the version fo gtksourceview installed on your system). Note that unless you also follow the instructions in Desktop integration, you will still have to manually specify that you want to apply this syntax highlighting.

Notepad++

Notepad++ is a pretty nice free open-source text editor for Windows. We have an XML syntax definition file tools/notepad-plus/userDefineLang_ASCEND.xml which you can use to add highlighting for the ASCEND language. The syntax file was contributed by Wojciech Mandziuk. For instructions on how to use this file, see tools/notepad-plus/README.txt

If anyone would like to help improve this highlighting file, some problems are currently present with nested comments and also with ARE_THE_SAME when immediately followed by a semicolon. Also some ATOM types should be added. But it's still very useful as-is.

TextPad

TextPad is a popular text editor on Windows

highlight

Andre Simon's highlight is a syntax highlighting utility that can be used to produce HTML, LaTeX and other forms of highlighted output. It can also be integrated with the scientific wordprocessor LyX as well as the online code viewer ViewVC.

Vim

Vim is a very popular Linux/Unix text editor with a history going back to 1976. Syntax file contributed by Edgar Simo.

GNU nano

GNU nano is the default console-based editor for several newer distributions of Linux including Fedora and Ubuntu. It includes support for syntax highlighting since about 2002. A ~/.nanorc for this editor has been contributed by Ondrej Krc-Jediny.

GNU Emacs

Previously, Emacs was used by a lot of the core ASCEND developers, and a special 'ASCEND mode' was developed. See tools/emacs. There is some question about whether this mode still works correctly, see the details.

listings

Listings is a LaTeX package that performs syntax highlighting. You can extract the necessary code from the latex preamble of the file doc/book.lyx.