Note configuration

The [note] section from the configuration file is used to set the note creation rules. The following properties are customizable:

  • language (string)

    • Two-letters code of the language used when writing notes, e.g. en.

    • This is used to generate slugs or with date formats. For now, only English is fully supported.

  • default-title (string)

    • The default title used for new notes when no --title option is provided.

  • filename (string)

    • Template used to generate the note filename, without its file extension.

  • extension (string)

    • File extension for the generated note. By default, md (Markdown) is used.

  • template (string)

    • Path to the template used to generate the note content.

    • Either an absolute path, or relative to .zk/templates/.

  • exclude (list of strings)

    • List of path globs excluded during note indexing.

  • id-charset (string)

    • Characters set used to generate random IDs.

    • You can use:

      • letters for characters from a to z

      • numbers for characters from 0 to 9

      • alphanum for letters + numbers

      • hex for characters from a to f and 0 to 9

      • a free string for custom characters

  • id-length (integer)

    • Length of the generated random IDs.

  • id-case (enum)

    • Letter case for the generated random IDs.

    • Possible values are lower, upper or mixed.

Common filename templates

Here are some common filename patterns you may want to use:

  • {{id}} – e.g. i2hn8.md

    • Just a random ID, simple and elegant.

    • To use Neuron’s ID format, set:

      [note]
      id-charset = "hex"
      id-length = 8
      id-case = "lower"
      
  • {{slug title}} – e.g. an-interesting-concept.md

    • A slugified version of the title given with --title.

    • Readable and practical for web servers, but fragile in case of renaming.

  • {{id}}-{{slug title}} – e.g. i2hn8-an-interesting-concept.md

    • The best of both worlds? Readable but if you link only with the prefix ID, you can rename without breaking links.

  • {{format-date now 'timestamp'}} – e.g. 200911172034.md

    • Verbose, but sortable by creation date and stable.

  • {{format-date now 'timestamp'}} {{title}} – e.g. 200911172034 An interesting concept.md

  • {{format-date now '%Y-%m-%d'}} – e.g. 2009-11-17.md