Syntax highlighting for therion files (.th, .th2 and .thconfig)
Dear all, I am not sure to have post this info for those who are interested in it. I often edit my therion file inside an external editor as Textwrangler or Brackets. I wrote some configuration files for both softwares to color the Therion’s syntax. That is not complete, they may be still errors, but you can find them here : For Texwrangler : https://github.com/robertxa/Therion-TextWrangler For Brackets : https://github.com/robertxa/Therion-Brackets Have a good weekend, Xavier
Hello everyone - Xavier's effort inspired me to take a look at syntax highlighting definitions for other editors. I run Fedora 27 with KDE desktop, so the editor I use most is Kate/KWrite. KDE has a system-wide syntax highlighting system that is part of KatePart. The attached XML file is for use in either Kate or KWrite. It is very much a work in progress. I have only scratched the surface of what is possible. One major thing I want to look at is to see if there is a way to make the syntax highlighting change in "code metapost" and "code tex-map" sections. KatePart already has highlighting files for metafont and latex. With any luck there is a way to reuse those. Copy the XML file to your user profile directory. The exact location will vary depending on your distribution. On my Fedora 27 system it is $HOME/.local//share/org.kde.syntax-highlighting/syntax You may have to create this directory. The file can also go in the common syntax highlighting directory which (on my system) is /usr/share/kde4/apps/katepart/syntax You will need root permissions to copy to this folder. The next time you start either Kate or KWrite, the new file will be used. I plan to look at syntax highlighting files for both joe and gvim. -- Bill Gee On Saturday, March 24, 2018 12:39:40 PM CDT Xavier Robert via Therion wrote:
Dear all,
I am not sure to have post this info for those who are interested in it.
I often edit my therion file inside an external editor as Textwrangler or Brackets. I wrote some configuration files for both softwares to color the Therion’s syntax. That is not complete, they may be still errors, but you can find them here : For Texwrangler : https://github.com/robertxa/Therion-TextWrangler For Brackets : https://github.com/robertxa/Therion-Brackets
Have a good weekend,
Xavier
On 2018-03-26 11:00 -0500, Bill Gee via Therion wrote:
I plan to look at syntax highlighting files for both joe and gvim.
emacs, please Bill :-) Survex has vim syntax highlingting files. If anyone was enthused to add more for that software too (should be fairly mild variations of the therion versions) it would no doubt be appreciated. Wookey -- Principal hats: Linaro, Debian, Wookware, ARM http://wookware.org/
Hi Wookey - I don't have a computer that runs the emacs operating system. :-) For what it's worth, I discovered another Linux text editor that can use KatePart syntax files. It is called Code-Editor. I can't find a good Web site for it, but it can be installed from the Fedora repository. -- Bill Gee On Monday, March 26, 2018 12:23:52 PM CDT Wookey via Therion wrote:
On 2018-03-26 11:00 -0500, Bill Gee via Therion wrote:
I plan to look at syntax highlighting files for both joe and gvim.
emacs, please Bill :-)
Survex has vim syntax highlingting files. If anyone was enthused to add more for that software too (should be fairly mild variations of the therion versions) it would no doubt be appreciated.
Wookey
You might like to check and or edit what I have added here https://therion.speleo.sk/wiki/contrib:externaleditors#katepart_kate_kwrite Bruce From: Therion <therion-bounces@speleo.sk> On Behalf Of Bill Gee via Therion Sent: Tuesday, 27 March 2018 5:01 AM To: therion@speleo.sk Cc: Bill Gee <bgee@campercaver.net> Subject: Re: [Therion] Syntax highlighting for therion files (.th, .th2 and .thconfig) Hello everyone - Xavier's effort inspired me to take a look at syntax highlighting definitions for other editors. I run Fedora 27 with KDE desktop, so the editor I use most is Kate/KWrite. KDE has a system-wide syntax highlighting system that is part of KatePart. The attached XML file is for use in either Kate or KWrite. It is very much a work in progress. I have only scratched the surface of what is possible. One major thing I want to look at is to see if there is a way to make the syntax highlighting change in "code metapost" and "code tex-map" sections. KatePart already has highlighting files for metafont and latex. With any luck there is a way to reuse those. Copy the XML file to your user profile directory. The exact location will vary depending on your distribution. On my Fedora 27 system it is $HOME/.local//share/org.kde.syntax-highlighting/syntax You may have to create this directory. The file can also go in the common syntax highlighting directory which (on my system) is /usr/share/kde4/apps/katepart/syntax You will need root permissions to copy to this folder. The next time you start either Kate or KWrite, the new file will be used. I plan to look at syntax highlighting files for both joe and gvim. -- Bill Gee On Saturday, March 24, 2018 12:39:40 PM CDT Xavier Robert via Therion wrote:
Dear all,
I am not sure to have post this info for those who are interested in it.
I often edit my therion file inside an external editor as Textwrangler or
Brackets. I wrote some configuration files for both softwares to color the
Therion’s syntax. That is not complete, they may be still errors, but you
can find them here : For Texwrangler :
https://github.com/robertxa/Therion-TextWrangler For Brackets :
Have a good weekend,
Xavier
Hi Bruce - Excellent! Thanks for doing that. I hope my contribution is useful. I see that same page has links for both vi and emacs syntax files. I'll check out the vi file against gvim and report how it works. A minor carp about that entry ... strictly speaking, syntax highlighting is not possible in vi. It requires vim. For most modern systems they are one and the same, but there may be exceptions. Some systems use tiny-vim as the default, which does not support syntax highlighting. -- Bill Gee On Tuesday, March 27, 2018 3:27:38 AM CDT Bruce Mutton via Therion wrote:
You might like to check and or edit what I have added here https://therion.speleo.sk/wiki/contrib:externaleditors#katepart_kate_kwrite
Bruce
From: Therion <therion-bounces@speleo.sk> On Behalf Of Bill Gee via Therion Sent: Tuesday, 27 March 2018 5:01 AM To: therion@speleo.sk Cc: Bill Gee <bgee@campercaver.net> Subject: Re: [Therion] Syntax highlighting for therion files (.th, .th2 and .thconfig)
Hello everyone -
Xavier's effort inspired me to take a look at syntax highlighting definitions for other editors. I run Fedora 27 with KDE desktop, so the editor I use most is Kate/KWrite. KDE has a system-wide syntax highlighting system that is part of KatePart.
The attached XML file is for use in either Kate or KWrite. It is very much a work in progress. I have only scratched the surface of what is possible. One major thing I want to look at is to see if there is a way to make the syntax highlighting change in "code metapost" and "code tex-map" sections. KatePart already has highlighting files for metafont and latex. With any luck there is a way to reuse those.
Copy the XML file to your user profile directory. The exact location will vary depending on your distribution. On my Fedora 27 system it is
$HOME/.local//share/org.kde.syntax-highlighting/syntax
You may have to create this directory.
The file can also go in the common syntax highlighting directory which (on my system) is
/usr/share/kde4/apps/katepart/syntax
You will need root permissions to copy to this folder.
The next time you start either Kate or KWrite, the new file will be used.
I plan to look at syntax highlighting files for both joe and gvim.
Dear all,
I am not sure to have post this info for those who are interested in it.
I often edit my therion file inside an external editor as Textwrangler or
Brackets. I wrote some configuration files for both softwares to color the
Therion’s syntax. That is not complete, they may be still errors, but you
can find them here : For Texwrangler :
https://github.com/robertxa/Therion-TextWrangler For Brackets :
https://github.com/robertxa/Therion-Brackets
Have a good weekend,
Xavier
Hello everyone - I spent more time this morning working through some details in the syntax highlighting file for Kate and KWrite. Attached is version 1.1. Bruce, can you put this on the Web site? Changes: -- Added several more keywords such as ceiling-step and floor-step. -- Created a rule for MetaPost keywords. This is not perfect - it probably has only a few of the keywords it should have. But it is a start. -- Numbers are now highlighted in color. -- Cleaned up some stuff left over from the file I used as a base. To Do: The thing that bothers me most is that some keywords (such as "def") are used in both MetaPost and TeX code. I would like to find a way to detect "code metapost/endcode" and "code tex-map/endcode" sections, then change the rules within those sections. I think it can be done, but there is a learning curve to deal with. -- Bill Gee On Monday, March 26, 2018 11:00:51 AM CDT Bill Gee wrote:
Hello everyone -
Xavier's effort inspired me to take a look at syntax highlighting definitions for other editors. I run Fedora 27 with KDE desktop, so the editor I use most is Kate/KWrite. KDE has a system-wide syntax highlighting system that is part of KatePart.
The attached XML file is for use in either Kate or KWrite. It is very much a work in progress. I have only scratched the surface of what is possible. One major thing I want to look at is to see if there is a way to make the syntax highlighting change in "code metapost" and "code tex-map" sections. KatePart already has highlighting files for metafont and latex. With any luck there is a way to reuse those.
Copy the XML file to your user profile directory. The exact location will vary depending on your distribution. On my Fedora 27 system it is
$HOME/.local//share/org.kde.syntax-highlighting/syntax
You may have to create this directory.
The file can also go in the common syntax highlighting directory which (on my system) is
/usr/share/kde4/apps/katepart/syntax
You will need root permissions to copy to this folder.
The next time you start either Kate or KWrite, the new file will be used.
I plan to look at syntax highlighting files for both joe and gvim.
Dear all,
I am not sure to have post this info for those who are interested in it.
I often edit my therion file inside an external editor as Textwrangler or Brackets. I wrote some configuration files for both softwares to color the Therion’s syntax. That is not complete, they may be still errors, but you can find them here : For Texwrangler : https://github.com/robertxa/Therion-TextWrangler For Brackets : https://github.com/robertxa/Therion-Brackets
Have a good weekend,
Xavier
Check: https://mailman.ntg.nl/pipermail/ntg-context/2005/011875.html https://github.com/khiri-co/language-metapost https://lists.gnu.org/archive/html/emacs-pretest-bug/2005-02/msg00327.html https://users.dimi.uniud.it/~nicola.vitacolonna/software/metapost-smultron/ http://users.dimi.uniud.it/~nicola.vitacolonna/software/metapost-textwrangle... http://hackage.haskell.org/package/highlighting-kate-0.5.7/src/Text/Highligh... etc. google: "metapost syntax coloring" Martin S. On Mar 28, 2018, at 04:36 PM, Bill Gee via Therion <therion@speleo.sk> wrote: Hello everyone - I spent more time this morning working through some details in the syntax highlighting file for Kate and KWrite. Attached is version 1.1. Bruce, can you put this on the Web site? Changes: -- Added several more keywords such as ceiling-step and floor-step. -- Created a rule for MetaPost keywords. This is not perfect - it probably has only a few of the keywords it should have. But it is a start. -- Numbers are now highlighted in color. -- Cleaned up some stuff left over from the file I used as a base. To Do: The thing that bothers me most is that some keywords (such as "def") are used in both MetaPost and TeX code. I would like to find a way to detect "code metapost/endcode" and "code tex-map/endcode" sections, then change the rules within those sections. I think it can be done, but there is a learning curve to deal with. -- Bill Gee On Monday, March 26, 2018 11:00:51 AM CDT Bill Gee wrote: Hello everyone - Xavier's effort inspired me to take a look at syntax highlighting definitions for other editors. I run Fedora 27 with KDE desktop, so the editor I use most is Kate/KWrite. KDE has a system-wide syntax highlighting system that is part of KatePart. The attached XML file is for use in either Kate or KWrite. It is very much a work in progress. I have only scratched the surface of what is possible. One major thing I want to look at is to see if there is a way to make the syntax highlighting change in "code metapost" and "code tex-map" sections. KatePart already has highlighting files for metafont and latex. With any luck there is a way to reuse those. Copy the XML file to your user profile directory. The exact location will vary depending on your distribution. On my Fedora 27 system it is $HOME/.local//share/org.kde.syntax-highlighting/syntax You may have to create this directory. The file can also go in the common syntax highlighting directory which (on my system) is /usr/share/kde4/apps/katepart/syntax You will need root permissions to copy to this folder. The next time you start either Kate or KWrite, the new file will be used. I plan to look at syntax highlighting files for both joe and gvim.
Dear all,
I am not sure to have post this info for those who are interested in it.
I often edit my therion file inside an external editor as Textwrangler or Brackets. I wrote some configuration files for both softwares to color the Therion’s syntax. That is not complete, they may be still errors, but you can find them here : For Texwrangler : https://github.com/robertxa/Therion-TextWrangler For Brackets : https://github.com/robertxa/Therion-Brackets
Have a good weekend,
Xavier
_______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
Hi Martin - Thanks for the links! I looked them but in the end found little that is useful for what I am doing. One of the links (the one for Haskell) mentions that it is based on the KatePost syntax definition for metafont. I figured out this morning how to use KatePost's existing syntax files for both LaTeX and MetaFont in my Therion syntax file. It was actually pretty easy! :-) -- Bill Gee On Wednesday, March 28, 2018 10:33:59 AM CDT Martin Sluka via Therion wrote:
Check:
https://mailman.ntg.nl/pipermail/ntg-context/2005/011875.html
https://github.com/khiri-co/language-metapost
https://lists.gnu.org/archive/html/emacs-pretest-bug/2005-02/msg00327.html
https://users.dimi.uniud.it/~nicola.vitacolonna/software/metapost-smultron/
http://users.dimi.uniud.it/~nicola.vitacolonna/software/metapost-textwrangle r/
http://hackage.haskell.org/package/highlighting-kate-0.5.7/src/Text/Highligh ting/Kate/Syntax/Metafont.hs
etc.
google: "metapost syntax coloring"
Martin S.
On Mar 28, 2018, at 04:36 PM, Bill Gee via Therion <therion@speleo.sk> wrote:
Hello everyone -
I spent more time this morning working through some details in the syntax highlighting file for Kate and KWrite. Attached is version 1.1. Bruce, can you put this on the Web site?
Changes:
-- Added several more keywords such as ceiling-step and floor-step. -- Created a rule for MetaPost keywords. This is not perfect - it probably has only a few of the keywords it should have. But it is a start. -- Numbers are now highlighted in color. -- Cleaned up some stuff left over from the file I used as a base.
To Do:
The thing that bothers me most is that some keywords (such as "def") are used in both MetaPost and TeX code. I would like to find a way to detect "code metapost/endcode" and "code tex-map/endcode" sections, then change the rules within those sections. I think it can be done, but there is a learning curve to deal with.
Dear all,
I am not sure to have post this info for those who are interested in it.
I often edit my therion file inside an external editor as Textwrangler or Brackets. I wrote some configuration files for both softwares to color the Therion’s syntax. That is not complete, they may be still errors, but you can find them here : For Texwrangler : https://github.com/robertxa/Therion-TextWrangler For Brackets : https://github.com/robertxa/Therion-Brackets
Have a good weekend,
Xavier
_______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
Check this is OK. https://therion.speleo.sk/wiki/contrib:externaleditors#katepart_kate_kwrite Bruce -----Original Message----- From: Therion <therion-bounces@speleo.sk> On Behalf Of Bill Gee via Therion Sent: Thursday, 29 March 2018 3:36 AM To: therion@speleo.sk Cc: Bill Gee <bgee@campercaver.net> Subject: [Therion] Updated syntax highlight file for Kate/KWrite Hello everyone - I spent more time this morning working through some details in the syntax highlighting file for Kate and KWrite. Attached is version 1.1. Bruce, can you put this on the Web site? Changes: -- Added several more keywords such as ceiling-step and floor-step. -- Created a rule for MetaPost keywords. This is not perfect - it probably has only a few of the keywords it should have. But it is a start. -- Numbers are now highlighted in color. -- Cleaned up some stuff left over from the file I used as a base. To Do: The thing that bothers me most is that some keywords (such as "def") are used in both MetaPost and TeX code. I would like to find a way to detect "code metapost/endcode" and "code tex-map/endcode" sections, then change the rules within those sections. I think it can be done, but there is a learning curve to deal with. -- Bill Gee On Monday, March 26, 2018 11:00:51 AM CDT Bill Gee wrote:
Hello everyone -
Xavier's effort inspired me to take a look at syntax highlighting definitions for other editors. I run Fedora 27 with KDE desktop, so the editor I use most is Kate/KWrite. KDE has a system-wide syntax highlighting system that is part of KatePart.
The attached XML file is for use in either Kate or KWrite. It is very much a work in progress. I have only scratched the surface of what is possible. One major thing I want to look at is to see if there is a way to make the syntax highlighting change in "code metapost" and "code tex-map" sections. KatePart already has highlighting files for metafont and latex. With any luck there is a way to reuse those.
Copy the XML file to your user profile directory. The exact location will vary depending on your distribution. On my Fedora 27 system it is
$HOME/.local//share/org.kde.syntax-highlighting/syntax
You may have to create this directory.
The file can also go in the common syntax highlighting directory which (on my system) is
/usr/share/kde4/apps/katepart/syntax
You will need root permissions to copy to this folder.
The next time you start either Kate or KWrite, the new file will be used.
I plan to look at syntax highlighting files for both joe and gvim.
Dear all,
I am not sure to have post this info for those who are interested in it.
I often edit my therion file inside an external editor as Textwrangler or Brackets. I wrote some configuration files for both softwares to color the Therion’s syntax. That is not complete, they may be still errors, but you can find them here : For Texwrangler : https://github.com/robertxa/Therion-TextWrangler For Brackets : https://github.com/robertxa/Therion-Brackets
Have a good weekend,
Xavier
Hi Bruce - Thanks! The update looks good to me. -- Bill Gee On Wednesday, March 28, 2018 1:32:44 PM CDT Bruce Mutton via Therion wrote:
Check this is OK. https://therion.speleo.sk/wiki/contrib:externaleditors#katepart_kate_kwrite Bruce
-----Original Message----- From: Therion <therion-bounces@speleo.sk> On Behalf Of Bill Gee via Therion Sent: Thursday, 29 March 2018 3:36 AM To: therion@speleo.sk Cc: Bill Gee <bgee@campercaver.net> Subject: [Therion] Updated syntax highlight file for Kate/KWrite
Hello everyone -
I spent more time this morning working through some details in the syntax highlighting file for Kate and KWrite. Attached is version 1.1. Bruce, can you put this on the Web site?
Changes:
-- Added several more keywords such as ceiling-step and floor-step. -- Created a rule for MetaPost keywords. This is not perfect - it probably has only a few of the keywords it should have. But it is a start. -- Numbers are now highlighted in color. -- Cleaned up some stuff left over from the file I used as a base.
To Do:
The thing that bothers me most is that some keywords (such as "def") are used in both MetaPost and TeX code. I would like to find a way to detect "code metapost/endcode" and "code tex-map/endcode" sections, then change the rules within those sections. I think it can be done, but there is a learning curve to deal with.
Hello everyone -
Xavier's effort inspired me to take a look at syntax highlighting definitions for other editors. I run Fedora 27 with KDE desktop, so the editor I use most is Kate/KWrite. KDE has a system-wide syntax highlighting system that is part of KatePart.
The attached XML file is for use in either Kate or KWrite. It is very much a work in progress. I have only scratched the surface of what is possible.
One major thing I want to look at is to see if there is a way to make the
syntax highlighting change in "code metapost" and "code tex-map" sections. KatePart already has highlighting files for metafont and latex. With any luck there is a way to reuse those.
Copy the XML file to your user profile directory. The exact location will vary depending on your distribution. On my Fedora 27 system it is
$HOME/.local//share/org.kde.syntax-highlighting/syntax
You may have to create this directory.
The file can also go in the common syntax highlighting directory which (on my system) is
/usr/share/kde4/apps/katepart/syntax
You will need root permissions to copy to this folder.
The next time you start either Kate or KWrite, the new file will be used.
I plan to look at syntax highlighting files for both joe and gvim.
Dear all,
I am not sure to have post this info for those who are interested in it.
I often edit my therion file inside an external editor as Textwrangler or Brackets. I wrote some configuration files for both softwares to color the Therion’s syntax. That is not complete, they may be still errors, but you can find them here : For Texwrangler : https://github.com/robertxa/Therion-TextWrangler For Brackets : https://github.com/robertxa/Therion-Brackets
Have a good weekend,
Xavier
_______________________________________________ Therion mailing list Therion@speleo.sk https://mailman.speleo.sk/listinfo/therion
Hello everyone - I did even more work on the Kate/KWrite syntax highlighting file this morning. The new file is version 1.2 and is attached to this message. I figured out how to apply different rules for "code metapost", "code tex-map" and "code tex-atlas" sections. I also cleaned up some duplicate keyword entries and added more entries to both keywords and built-ins. KatePart in a base install includes syntax highlighting files for both LaTeX and Metafont/Metapost. Rather than reinvent the wheel, I have used those rule sets for the code sections of Therion files. The highlighting for tex-map sections does not really show much because (at least in my files) almost nothing in there is part of the base LaTeX definitions. It mostly comes through as normal text, except for "\def". Comment highlighting is correct. I have two questions for the group: 1) Has anyone tried this file? I would like some feedback. How does it look? Is it sane? Do I need to add any more strings? 2) The division between keywords and built-ins seems a bit arbitrary to me. I started with Xavier's choices as to which strings go in which group, but the more I look at it the more I think a good hard look needs to be taken. In the current scheme keywords are displayed in bold-face black. Built-ins are displayed in purple. I think a third category is needed for parameters. For example, the line line border subtype invisible I think "line" is a keyword. "Subtype" is a built-in. "Border" and "invisible" are parameters. What thoughts do you have? A list of available default styles is about half-way down this web page: https://docs.kde.org/stable5/en/applications/katepart/highlight.html Thanks! -- Bill Gee On Wednesday, March 28, 2018 9:36:04 AM CDT Bill Gee wrote:
Hello everyone -
I spent more time this morning working through some details in the syntax highlighting file for Kate and KWrite. Attached is version 1.1. Bruce, can you put this on the Web site?
Changes:
-- Added several more keywords such as ceiling-step and floor-step. -- Created a rule for MetaPost keywords. This is not perfect - it probably has only a few of the keywords it should have. But it is a start. -- Numbers are now highlighted in color. -- Cleaned up some stuff left over from the file I used as a base.
To Do:
The thing that bothers me most is that some keywords (such as "def") are used in both MetaPost and TeX code. I would like to find a way to detect "code metapost/endcode" and "code tex-map/endcode" sections, then change the rules within those sections. I think it can be done, but there is a learning curve to deal with.
Hello everyone -
Xavier's effort inspired me to take a look at syntax highlighting definitions for other editors. I run Fedora 27 with KDE desktop, so the editor I use most is Kate/KWrite. KDE has a system-wide syntax highlighting system that is part of KatePart.
The attached XML file is for use in either Kate or KWrite. It is very much a work in progress. I have only scratched the surface of what is possible.
One major thing I want to look at is to see if there is a way to make the
syntax highlighting change in "code metapost" and "code tex-map" sections. KatePart already has highlighting files for metafont and latex. With any luck there is a way to reuse those.
Copy the XML file to your user profile directory. The exact location will vary depending on your distribution. On my Fedora 27 system it is
$HOME/.local//share/org.kde.syntax-highlighting/syntax
You may have to create this directory.
The file can also go in the common syntax highlighting directory which (on my system) is
/usr/share/kde4/apps/katepart/syntax
You will need root permissions to copy to this folder.
The next time you start either Kate or KWrite, the new file will be used.
I plan to look at syntax highlighting files for both joe and gvim.
Dear all,
I am not sure to have post this info for those who are interested in it.
I often edit my therion file inside an external editor as Textwrangler or Brackets. I wrote some configuration files for both softwares to color the Therion’s syntax. That is not complete, they may be still errors, but you can find them here : For Texwrangler : https://github.com/robertxa/Therion-TextWrangler For Brackets : https://github.com/robertxa/Therion-Brackets
Have a good weekend,
Xavier
participants (5)
-
Bill Gee -
Bruce Mutton -
Martin Sluka -
Wookey -
Xavier Robert