by

Script Assets

LightPaper version 1.2 introduces a new feature that allows you to add any local or remote JavaScript or CSS assets. This might sound simple and trivial but it opens a lot of possibilities what you can do with LightPaper now. Think of it as a “plugin” feature for LightPaper powered by JavaScript and CSS.

What can I do with it?

How about adding flowcharts, sequence diagrams and gantt charts to your documents using nothing more than just plain text? Check out this document for more details: Mermaid + LightPaper = ❤️

Seriously? Yep!

Adding a new asset

Adding a new asset is a piece of cake:

  1. Go to Preferences...>Script Assets (if it is hidden, click on the >> button)
  2. Click on the + button and add a local or remote URL for your asset in File Source field, give it a name and click Add.

That’s it!

Seriously? Yep!

Assets are loaded in the order they appear on the table. You can select multiple assets and drag-and-drop them to change the order and can even enable or disable them.

In the above screenshot you can notice that there is a On Update Callback Script button. Here you can add any JavaScript code that gets called as soon as the preview is rendered. This allows you to write your own code to modify the output.

Script Assets brings a lot of possibilities to modify and add new features to your documents. Give it a try and let us know.

  1. Is there a way to specify a relative path to a local asset, relative to the base folder for example?

Comments are closed.