Skip to content

Commands

Insert Skribi

Opens a prompt to insert a template. Will prompt you for variables, as defined in the Template Metadata.

View Templates

Opens a modal that displays your loaded templates. Clicking an entry will open the template file in the editor (currently only works for .md files). Templates that failed to compile will have an error indicator displayed that you can click to open an error modal with more information.

The list will automatically refresh whenever the template cache is updated (so you can leave this open while you edit templates in an external editor, and see them move to/from the error list immediately). You can also force a refresh with the refresh index button (just in case).

Render Template / Render Preset

Opens a modal and renders a template within. See Render Modal for details.

Reload Skribis

Causes all extant skribis to rerender themselves. Skribis will automatically rerender themselves if the loaded scripts or source template is modified, but maybe there's a use to doing it manually?

Reload Scripts

Reloads scripts from the script directory. Scripts should automatically reload but I'll leave this in for now just in case.

Performance Test

This command opens a modal that can perform bulk renders and report the results. This is intended as a utility for those who are making complex skribis and want an indication of execution times.

The Text To Evaluate field is autofilled from highlighted text, or the clipboard contents, if any is found. The text in this field is treated as the text of the virtual skribi that will be evaluated.

Evaluation Iterations is the number of times to render the skribi. The result will be an averaged value of the processing times. I recommend using 10, but I've only tested on my machine. Using very high values will overload the system, causing each render to be slower, and returning values not representative of the expected processing time during normal use.

Eval As Individual Blocks toggles between placing all the skribis into one block, as would be the case with multiple inline skribis, or as individual blocks.

Notes about results

Because of how async code works in javascript, using promises introduces some time-bloat that isn't really indicative of the actual execution times. You can see that even evaluating empty text takes time (on my machine, about 2.6ms) where in reality it's nearly instant. This extra time is generated by the nature of promises. I'll look into adding a synchronous evaluation method in the future.

Generally, you don't really need to worry about the performance unless you're doing heavy operations.