Runtime Options
Runtime options are card options that are applied globally to all JPMN cards. This differs from binary fields, as binary options are options that only affects the one note.
Accessing & Editing¶
To access the runtime options, navigate to your profile's
media folder,
and open the _jpmn-options.js
file as a text file.
The contents of the file should look something like the following:
var JPMNOpts = (function (my) {
my.settings = {
// ... (a bunch of settings)
}
return my;
}(JPMNOpts || {}));
Note
To open the file as a text file on Windows, right click the file and select Edit
.
Do not double-click the file.
TODO add demo for windows to opening the file & editing
Special Option Values¶
New in version 0.11.0.0
(latest version: 0.11.0.4
)
All runtime options can take special values, which are always formatted as the following:
For example, take any key-value pair, such as:
This can be changed to:
pc-mobile
Type¶
New in version 0.11.0.0
(latest version: 0.11.0.4
)
The pc-mobile
type allows you to specify different values depending if
you are using Anki on a mobile device, or PC (non-mobile).
This is formatted as the following:
Example (click here)
Take a sample key-value pair:
The value can be changed to be true
for PC, and false
for mobile.
viewport-width-is
Type¶
New in version 0.11.0.0
(latest version: 0.11.0.4
)
The viewport-width-is
type allows you to specify different values depending
on the screen width.
Note that the viewport width is read for each card flip.
This means that viewport width changes after resizing a window will not be detected,
and will only be updated when you flip the side or go to a new card.
This is formatted as the following:
{
"type": "viewport-width-is",
"value": AN_INTEGER, // measured in pixels
"greater": VALUE_FOR_GREATER, // the value used if the current width is greater than "value"
"lesser": VALUE_FOR_LESSER // the value used if the current width is lesser than (or equal to) "value"
},
Example (click here)
This will enable pa-indicator-color-quotes
on screens that have a viewport width of 1300 pixels or less.
Troubleshooting¶
TODO record specific errors
If you have any error, or an option is simply not working, please check the following:
-
There are commas and double-quotes in the correct places.
-
If a runtime option is not working, ensure that the runtime options file is updated. The option may have been renamed or repositioned.
-
If an error is saying that an option doesn't exist, just like for the above, ensure that the runtime options file is updated.