Ulysses2SourceView is a script for converting Ulysses Themes to GtkSourceView compatible styles.
If you're writing in Markdown, I highly recommend Ulysses if you're using a Mac or iPad. It's my favorite Markdown editor.
The styles should hopefully
be compatible with GtkSourceView3 and GtkSourceView4.
A sample of converting Dracula, but they already have a gEdit style.
Don't look at the source code... or if you do have forgiveness.
So I should probably use an XML parser, and a more widely used language... I'll probably switch to Python of Vala... For now...
I thought it'd be fast to just parse the theme with Regex, but I was wrong... but it works... for the most part...
First, extract the Theme.xml from the Ulysses theme package. Then run ./ulysses2sourceview Theme.xml Output.xml
. Add the Theme in gEdit.
Usage:
./ulysses2sourceview [--dark] <input-file> <output-file>
<input-file> a Ulysses theme to convert
<output-file> name of location to write output to
--dark Convert dark mode instead of light
There's some magic numbers and strings that I have no idea what they do... so we just did stuff to them until themes looked okayish. If you want the theme to work well, I highly recommend Ulysses.