Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andre-dietrich/liascript-preview-vscode-web

A VSCode Preview Web-Extension for LiaScript
https://github.com/andre-dietrich/liascript-preview-vscode-web

Last synced: 19 days ago
JSON representation

A VSCode Preview Web-Extension for LiaScript

Awesome Lists containing this project

README

        

# liascript-preview-web

This is a preview module for [LiaScript](https://LiaScript.github.io) courses developed in Markdown.

![Demo of the previewer](assets/demo.gif)

## Usage

After installing press F1 to open the fuzzy search and type "liascript", three options will be presented:

* __LiaScript: Toggle Preview [Alt L] - (on Mac [Cmd L])__

This will open a panel on the right side (or close it).
The preview will be updated only with manual intervention, when you select the option "Update Preview" or hit the keyboard short-cut [Ctrl S] or when you completely reload the document without caching [Alt F5].

* __LiaScript: Toggle Preview in JIT mode [Shift Alt L] - (on Mac [Shift Cmd L])__

The difference between this and the upper mode is, that with this option a faster update mode (Just-In-Time compilation) will be used, which will only compile the differences between the current and the previous version.
This results in optimized update times, especially for large documents, but it also may result in glitches, when state changes of quizzes, code, etc. might be involved.
If this happens, you simply have to reload the Preview, which will result in an entire re-interpretation of the entire document.

* __LiaScript: Update Preview [Ctrl S]__

Reload the entire document, which is okay if you are writing Markdown, but when you import some JavaScript or CSS, then it is better to reload the entire document.

* __LiaScript: Reload Preview [Alt F5]__

This will reload the entire document and all imported sources.
This is the best way if you are developing JavaScript or CSS, if you only write Markdown, then use the update option, which will will only compile the document.

As an alternative you can also use the keyboard shortcuts directly.

## Navigation

__Preview to Editor:__
Double-click onto a an element within the preview and the cursor position within the editor will jump to the associated line.

__Editor to Preview:__
Currently not activated.

## Text 2 Speech

> Text to speech uses currently the internal browser text-to-speech engine.
> Depending on the browser you are using, the results might differ.

## MathJS & Formula Support

Put a equation between dollars and click on the hint to get some replacement options, or simply use it for fast calculations.

![Formula evaluation](assets/formulas.gif)

---

$(12 km * 3 m)/(12 h)$

$2 miles to m$

$2 miles/h to km/h$

You can define a dictionary after a `%` sign, which is used as a comment.
This dictionary will then be used as a substitution for your formula.

$sin(12 x) * 33 % {x:0.5}$

A similar approach can also be used to check the result of some TeX formulas.

$12 \cdot \frac{e}{x} % {x: 2}$

---

Last but not least, the following example shall demonstrate, how one formula can be presented in different ways:

$sqrt(75 / 3) + det([[-1, 2], [3, 1]]) - sin(pi / 4)^2$

$sqrt(75 / 3) + det([[-1, 2], [3, 1]]) - sin(pi / 4)^2$

$sqrt(75 / 3) + det([[-1, 2], [3, 1]]) - sin(pi / 4)^2$