IMP! Helpers
This menu is created by helper headers-nav
Helpers are the scripts, which use new Helpers API for adding various types of content, not supported by regular markdown. Helpers may add static and/or interactive content in asynchronous way and enrich viewer experience. Some examples can be seen here.
This API allows building interactive content blocks, whcih may also provide meaningful content without JavaScript. Links to developer docs are at the end of this page.
How to enable helpers for your IMP!
Ensure, that you have the right IMP! version
Check if you have updated to IMP! version 0.4.2 or higher. File helpers.js
must live in the same directory, where your IMP! file is.
Enable helpers in IMP! GUI
There is a checkbox at the lower part of the page, labeled "enable helpers". You must then save and reload your IMP! file.
Get the helper scripts
Previous step just enables the API. To use helpers, you must get some helper scripts. Good place to start is the git-helpers repo, the helpers
folder there contains bundled scripts.
You'll need to create a folder, named helpers
in the same directory, where your IMP! file is, and put required helpers there.
Use them in markdown
The full syntax for helper will look like this:
```helper:helper-name/helper-subtype
helper parameters in YAML, JSON or some other
format (consult helper doc)
```
Subtype may be omitted, word helper
may be shortened to just h
:
```h:helper-name
helper parameters in YAML, JSON or some other
format (consult helper doc)
```
Things to check
- Name of the helper is the same, as the scipt filename. For example, helper
dsv-render
resides in the filedsv-render.js
in thehelpers
folder. - No spaces before backticks at the start and end of the helper code.
- No spaces after them.
- If helpers enabled, the code will be parsed as you type, which may result in error messages, it's normal, and, sometimes, informative.
- If you use helpers in your IMP! html , file
helpers.js
as well ashelpers
folder must be uploaded to your hosting provider with main html file, unlikeimp.js
file (which is newer required for vieweing your html).
Make your own
There are two other documents on that: