Sluggification of file name components
File names can contain any character that the file system permits. Denote imposes a few additional restrictions:
- The tokens "‘
=", =__’ and ‘--’ are interpreted by Denote and should appear only once. - The dot character is not allowed in a note’s file name, except to indicate the file type extension. Denote recognises two extensions for encrypted files, like ‘
.txt.gpg’.
By default, Denote enforces other rules to file names through the user option denote-file-name-slug-functions. These rules are applied to file names by default:
- Many “special characters” are removed.
- Input for a file title is hyphenated. The original value is preserved in the note’s content (Front matter).
- Spaces or other delimiters are removed from keywords, meaning that ‘
hello-world’ becomes ‘helloworld’. This is because hyphens in keywords do not work everywhere, such as in Org. Plus, hyphens are word separators in the title and we want to keep distinct separators for each component to make search easier and semantic (Features of the file-naming scheme for searching or filtering). - Signatures are like the above, but use the equals sign instead of hyphens as a word separator.
- All file name components are downcased. Further down we document how to deviate from these rules, such as to accept input of the form ‘
helloWorld’ or ‘HelloWorld’ verbatim.
Denote imposes these restrictions to enforce uniformity, which is helpful long-term as it keeps all files with the same predictable pattern. Too many permutations make searches more difficult to express accurately and be confident that the matches cover all files. Nevertheless, one of the principles of Denote is its flexibility or hackability and so users can deviate from the aforementioned (User-defined sluggification of file name components).