Custom CSS styling

Parts of your Markdown may be styled using custom CSS classes provided by TailwindCSS.

The attributes extension provides the ability to set CSS classes on inline or block level elements of Markdown. You can also specify a “class map” in index.yaml, the default value of which provides some builtin-in styles.

Built-in styles

Emanote provides some built-in styles.

sticky-note

Rapidly build modern websites without ever leaving your HTML.

Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the building blocks you need to build bespoke designs without any annoying opinionated styles you have to fight to override.

You should expect the above text to appear styled like a yellow sticky note, because the default index.yaml specifies a “sticky-note” class, which rewrites to a list of Tailwind classes, and that class in turn is (re)used in Markdown notes.

highlight-block

A portion of Markdown that is highlighted compared to the rest

Advanced styling

Using fenced_divs with attributes extension, you can wrap parts of your Markdown using a div, and then style it en masse. For example, to embed multiple notes in a “matrix” arrangement 1 you can make use of CSS grids as provided by Tailwind’s classes.

Examples
Getting Started

Follow these steps to get started with Emanote.

  • Install Emanote
  • Use your existing notebook, or create one from emanote-template 1 .
  • Run emanote run --port=8080 (or just emanote) in terminal after cd’ing to that notebook folder; this will launch the live server.
    • Or, if you only want to generate the HTML files (for deployment), run mkdir /tmp/output; emanote gen /tmp/output.
  • Visit Guide to learn more about Emanote, or Examples to get inspired first. 2
Footnotes
1.
emanote-template also includes the GitHub Pages workflow for static site deployment.
2.
If you are Haskell developer, see Architecture.
File WikiLinks

[[..]] style wikilinks can link to not only Markdown files, but also to any other files.

For example,

In the live server, links to static files will open in new browser tab.

If a wikilink refers to a display-able resource like image or video, it will appear embedded in the generated HTML.

Customizing Default Styling and Templates

Emanote allows you to customize the appearance of HTML components without the need for manual styling each time. This can be accomplished by overriding default templates in your notebook.

To start customizing, create a templates directory in your notebook. From there, you can override any templates you wish by copying them from Emanote’s default templates into your notebook’s templates directory. For example, if you want to customize the default pandoc styling, you can copy the pandoc.tpl file from Emanote’s GitHub repository into your templates/components directory and edit it accordingly.

How it works

This customization process works through a “union” of the default layer (provided by Emanote) and your notebook’s layer. Essentially, it’s similar to the unionfs concept - both the default layer and your notebook are union-mounted in Haskell using srid/unionmount. This way, you only need to copy and modify the specific files you want to override, without affecting the rest of the default templates.

Several users have successfully implemented this customization approach in their projects. Refer to the following examples for inspiration:

For additional information and discussion on this topic, check out this discussion on GitHub.

Footnotes
1.
If you are viewing this page on mobile or smaller screens, the embedded notes will be stacked on top of one another because we use Tailwind’s responsive classes. Incidentally, we use the {class=".."} syntax, rather than the {.someClass} syntax, only because the former is more lenient in accepting non-standard class names, such as the Tailwind responsive classes (eg. lg:grid-cols-2).
Links to this page
#emanote/syntax/demo