Front matter interface for developers or advanced users
Function denote-filetype-heuristics
Return likely file type of ‘FILE’. If in the process of org-capture, consider the file type to be that of Org. Otherwise, use the file extension to detect the file type of ‘FILE’.
If more than one file type correspond to this file extension, use the first file type for which the :title-key-regexp in denote-file-types matches in the file.
Return nil if the file type is not recognized.
Variable denote-org-front-matter
Specifies the Org front matter. It is passed to format with arguments ‘TITLE’, ‘DATE’, ‘KEYWORDS’, ‘IDENTIFIER’, ‘SIGNATURE’ (Change the front matter format)
Variable denote-yaml-front-matter
Specifies the YAML (Markdown) front matter. It is passed to format with arguments ‘TITLE’, ‘DATE’, ‘KEYWORDS’, ‘IDENTIFIER’, ‘SIGNATURE’ (Change the front matter format)
Variable denote-toml-front-matter
Specifies the TOML (Markdown) front matter. It is passed to format with arguments ‘TITLE’, ‘DATE’, ‘KEYWORDS’, ‘IDENTIFIER’, ‘SIGNATURE’ (Change the front matter format)
Variable denote-text-front-matter
Specifies the plain text front matter. It is passed to format with arguments ‘TITLE’, ‘DATE’, ‘KEYWORDS’, ‘IDENTIFIER’, ‘SIGNATURE’ (Change the front matter format)
Function denote-date-org-timestamp
Format ‘DATE’ using the Org inactive timestamp notation.
Function denote-date-rfc3339
Format ‘DATE’ using the RFC3339 specification.
Function denote-date-iso-8601
Format ‘DATE’ according to ISO 8601 standard.
Function denote-trim-whitespace
Trim whitespace around string ‘S’. This can be used in denote-file-types to format front mattter.
Function denote-trim-whitespace-then-quotes
Trim whitespace then quotes around string ‘S’. This can be used in denote-file-types to format front mattter.
Function denote-format-string-for-org-front-matter
Return string ‘S’ as-is for Org or plain text front matter. If ‘S’ is not a string, return an empty string.
Function denote-format-string-for-md-front-matter
Surround string ‘S’ with quotes. If ‘S’ is not a string, return a literal emptry string. This can be used in denote-file-types to format front mattter.
Function denote-format-keywords-for-md-front-matter
Format front matter ‘KEYWORDS’ for markdown file type. ‘KEYWORDS’ is a list of strings. Consult the denote-file-types for how this is used.
Function denote-format-keywords-for-text-front-matter
Format front matter ‘KEYWORDS’ for text file type. ‘KEYWORDS’ is a list of strings. Consult the denote-file-types for how this is used.
Function denote-format-keywords-for-org-front-matter
Format front matter ‘KEYWORDS’ for org file type. ‘KEYWORDS’ is a list of strings. Consult the denote-file-types for how this is used.
Function denote-extract-keywords-from-front-matter
Format front matter ‘KEYWORDS’ for org file type. ‘KEYWORDS’ is a list of strings. Consult the denote-file-types for how this is used.
Function denote-get-file-type-markdown-yaml
Return ‘markdown-yaml’ if FILE has YAML front matter. YAML front matter starts with ‘---’ on the first line. Consult the denote-file-types for how this is used.
Function denote-get-file-type-markdown-toml
Return ‘markdown-toml’ if FILE has TOML front matter. Consult the denote-file-types for how this is used. TOML front matter starts with ‘+++’ on the first line.
Variable denote-file-types
Alist of denote-file-type and their format properties.
Each element is of the form ‘(SYMBOL PROPERTY-LIST)’. ‘SYMBOL’ is one of those specified in denote-file-type or an arbitrary symbol that defines a new file type.
‘PROPERTY-LIST’ is a plist that consists of the following elements:
- ‘
:extension’ is a string with the file extension including the period. - ‘
:get-file-type-function’ a function with one parameter, a given file, that reads the file contents and returns the file type as a symbol or nil. If there is no function, Denote will fall back to a search for a title in the front matter (per ‘:title-key-regexp’, which is described below). - ‘
:date-function’ is a function that can format a date. See the functionsdenote--date-iso-8601,denote--date-rfc3339, anddenote--date-org-timestamp. - ‘
:front-matter’ is either a string passed toformator a variable holding such a string. Theformatfunction accepts four arguments, which come fromdenotein this order: ‘TITLE’, ‘DATE’, ‘KEYWORDS’, ‘IDENTIFIER’. Read the docstring offormaton how to reorder arguments. - ‘
:title-key-regexp’ is a regular expression that is used to retrieve the title line in a file. The first line matching this regexp is considered the title line. - ‘
:title-value-function’ is the function used to format the raw title string for inclusion in the front matter (e.g. to surround it with quotes). Use theidentityfunction if no further processing is required. - ‘
:title-value-reverse-function’ is the function used to retrieve the raw title string from the front matter. It performs the reverse of ‘:title-value-function’. - ‘
:keywords-key-regexp’ is a regular expression used to retrieve the keywords’ line in the file. The first line matching this regexp is considered the keywords’ line. - ‘
:keywords-value-function’ is the function used to format the keywords’ list of strings as a single string, with appropriate delimiters, for inclusion in the front matter. - ‘
:keywords-value-reverse-function’ is the function used to retrieve the keywords’ value from the front matter. It performs the reverse of the ‘:keywords-value-function’. - ‘
:link’ is a string, or variable holding a string, that specifies the format of a link. See the variablesdenote-org-link-format,denote-md-link-format. - ‘
:link-in-context-regexp’ is a regular expression that is used to match the aforementioned link format. See the variablesdenote-org-link-in-context-regexp,denote-md-link-in-context-regexp.
If denote-file-type is nil, use the first element of this list for new note creation. The default is org.