beef331 / website

Code for the official Nim programming language website
https://nim-lang.org
19 stars 1 forks source link

This Month With Nim: nimitheme #74

Closed neroist closed 1 year ago

neroist commented 1 year ago

Name: nimitheme

Author: Jasmine (aka @neroist)

Posting: nimitheme is a nimble library that enables easy styling of nimib documents. Currently there are ~30 different themes available, and I plan on adding more. You can enable themes either by passing them into nbInit like this:

import nimitheme
import nimib

nbInit(useSakuraEarthly)

Or calling the function directly:

nb.useSakuraEarthly()

In addition, you can also easily choose the highlight.js theme nimib uses via highlight=. For example, you could do something like this:

import nimitheme
import nimib

nbInit

nb.highlight = codeschool
...

All highlight.js themes are supported, so style your code to your heart's content!

In addition, you can also enable Dark Reader in your nimib document by calling useDarkReader, like so:

nb.useDarkReader()

An example of a website using nimitheme is up here: https://neroist.github.io/nimitheme/, which uses the Awsm Big Stone theme.