NekowebWiki / WikiGen

Static site generator made specifically for the Nekoweb Wiki.
https://wiki.nekoweb.org/
Other
1 stars 0 forks source link

Port regular syntax colors for editor #15

Open Steve0Greatness opened 1 month ago

Steve0Greatness commented 1 month ago

I'll probably come up with some kind of solution a bit later. This may come down to adding a custom function for parsing Pygments styles to turn them into CodeMirror-compatible stylesheets.

IE, parsing this:

class WikiCode(PygmentsStyle):
    background_color = "#7b8888"

    styles = {
        Token: "",
        Comment: "#ccc",
        Keyword: "#f00",
        String: "italic #f99",
        Number: "",
        Operator: "#e9f",

        Name: "#47baff",
        Name.Attribute: "#b0e5ff",
    }

To output CSS that is able to be used with CodeMirror editors. I'm guessing (possibly a little too early) that background_color may come in handy (although I couldn't get Pygments to use it initially).