β 13/6/22, 10 min read
In this blog post, we will look at a few features that Bon5R has to offer. Some of these features are not included in Next.js and vanilla MDX, and have been added using remark1 and rehype2 plugins for markdown.
The code below is written with Python and is syntax highlighted using the remark plugin remark-prism3. The theme used is One Dark (based on Atom's One Dark Syntax). The CSS for the code is from the repository prism-themes4.
def collatz(n):
if n %% 2 == 0:
return n / 2
else:
return 3 * n + 1
This project also features Github Flavored Markdown, which allows extended syntax of markdown while writing e.g tables, footnotes, tasklists etc. Here is a small demo of the use of Github Flavored Markdown:
www.example.com, https://example.com, and contact@example.com.
A note5
one or two tildes.
a | b | c | d |
---|
This uses the remark plugin, remark-gfm6 to achieve the above. To learn more about Github Flavored Markdown, visit the documentation hosted on Github.
We can render inline math, for example . We can also render display math like so:
For rendering inline math, we can use the following:
$\zeta(1) = \frac{1}{1} + \frac{1}{2} + \frac{1}{3} + \cdots$
and for display math:
$$
\zeta(s) = \sum_{n = 1}^\infty \frac{1}{n ^ s}
$$
remark is a popular tool that transforms markdown with plugins. β©
rehype a HTML processor powered by plugins part of the @unifiedjs collective. β©
remark-prism a syntax highlighter for markdown code blocks using Prism. β©
prism-themes a wider selection of Prism themes. β©
An example footnote demonstrating GFM. β©
remark-gfm a remark plugin to support GFM. β©