Field formatting
Last updated
Was this helpful?
Last updated
Was this helpful?
Starting with v0.1.0 it's possible to specify custom formatting and to use templates.
The internal link preference influences how file names and therefore how links look.
[[wiki links]]
can contain spaces and maintain their case
[Markdown links](markdown-links.md)
are all lower case and spaces are replaced with dashes.
Zotero Notes are formated in HTML. The hidden preference extensions.mdnotes.html_to_md
has a dictionary of how the HTML elements are translated into markdown.
With a few exceptions, you can format any placeholder by adding (or modifying) them in the settings. You can reach the hidden preferences menu from Edit > Preferences > Advanced > Config Editor
. You can use the search to find existing configurations:
By default, placeholder contents are replaced with:
Where:
{{bullet}}
- Defined in extensions.mdnotes.bullet
{{field_name}}
- The name of the field transformed from camel case into sentence case.
{{field_contents}}
- The contents of the field as described below.
Any placeholder that doesn't have their formatting defined in the hidden preferences has the following defaults:
list_separator
: For fields that contain more than one value, the default is ,
.
change_case
: How to capitalize the contents of the field: title
, sentence
, lower
or upper
case. The default will return the field content in its original case.
remove_spaces
: If this is set to true
spaces will be replaced with dashes.
If you want to add custom formatting for any field not currently there, you can add the format for a placeholder with right-click and New > String
.
The value of the preference should be enclosed in braces, and defined as key/value pairs, e.g {"key": "value"}
.
field_contents
- Formatting the field itself, which defaults to {{content}}
Examples
Replacing the field label with custom text and changing the list separator to make a list:
Making the tags placeholder remove spaces and adding a hash sign before each tag:
link_style
: As defined by the preference of . Valid values include wiki
, markdown
and no-links
.
The preference name should be extensions.mdnotes.placeholder.<yourFieldHere>
, where yourFieldHere
should match a . Keep in mind that Zotero fields are usually accessed using camel case, and should be (usually) formatted as fieldName
, e.g. seriesTitle
.
In addition to the fields described in the , the following options can be specified:
content
- Formatting the placeholder's content ()