I am building a hexo blog theme in ejs, which will style my technical docs project. I want to allow the user to select a language (JavaScript or TypeScript). I would then like to type code snippets something like :
{% js %}
```JavaScript
var geolocation = require("nativescript-geolocation");
```
{% endjs %}
{% ts %}
```TypeScript
import geolocation = require("nativescript-geolocation");
```
{% endts %}
Then two button / a slider so the user could choose typescript or javascript (which would default to js). I am comfortable with the UI implementation, but am not sure how I would set a property to determine which of the above snippets is used?
and depending on which language the user had selected, the correct snippet would display. How could I implement this?