cobalt-org / cobalt.rs

Static site generator written in Rust
cobalt-org.github.io/
Apache License 2.0
1.38k stars 102 forks source link

Support for custom syntaxes and themes #432

Open berkus opened 6 years ago

berkus commented 6 years ago

This is an epic, I will try to update it with more RFC-worthy data when I have time.

Basically, we need to add support for user-definable themes, and then for a way to override/customize these themes if users wish to do so.

One of the good references is hugo - it has a flexible themeing support with local overriding (not for everything though, and configuration file can get at times rather ugly - we need to improve on this).

Prior Art

Gutenberg

Syntaxes and themes are added via pull requests to the main project

See https://www.getgutenberg.io/documentation/content/syntax-highlighting/

epage commented 6 years ago

Closing in favor of https://github.com/cobalt-org/cobalt.rs/issues/301

berkus commented 6 years ago

please open an issue about user-provided syntax highlight themes and syntaxes

Ah, I misunderstood the request. Not sure this is something cobalt can/should do? We have hljs and it's pretty decent as far as markdown code blocks are tagged with the language, which cobalt does.

epage commented 6 years ago

Oh, this is syntax highlighting themes! I thought you meant the cobalt themes.

epage commented 6 years ago

We should keep in mind how #301 might impact this. For example, a cobalt theme might want to set a syntax theme that matches.

berkus commented 6 years ago

In hugo, this was confusing, as the themes have defined themselves how they do syntax highlighting, if at all.

so there was a top-level config theme = which selected which theme and in hyde-x there was params.theme = which selected the theme's color theme (from a list of presets) and then a params.highlight = which selected hljs theme to use.