![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ember-showdown-shiki
Advanced tools
Adds Shiki syntax highlighting for showdown-based markdown code blocks.
ember-showdown-shiki is a drop-in addon that automatically adds Shiki syntax highlighting to code blocks if you are using showdown to render your Markdown.
This addon also provides filename wrappers to the code block if a code block is marked with a data-filename
attribute:
````gjs {data-filename=app/components/blog-post.gjs}
<template>
<h1>{{@model.title}}</h1>
<h2>by {{@model.author}}</h2>
<div class="intro">
{{@model.intro}}
</div>
<hr>
<div class="body">
{{@model.body}}
</div>
</template>
```
You will also notice that the code sample has line numbers, this is built-in behaviour and they will be added to all code blocks.
This is also specifically designed to work in Node environments so that it can run effectively in Fastboot and prember 🎉 and as it is a drop-in addon it will automatically start working if added to any Empress projects, so it can be used to add syntax highlighting to your empress-blog if your template doesn't already provide syntax highlighting.
This addon is inspired by the great work of ember-showdown-prism.
ember install ember-showdown-shiki
When running this addon in Fastboot you have to configure the environment to make the globals used by Shiki available. To do this, create a config/fastboot.js
with the following contents:
module.exports = function () {
return {
buildSandboxGlobals(defaultGlobals) {
return Object.assign({}, defaultGlobals, {
atob: atob,
});
},
};
};
In config/environment.js
you can configure the following options:
module.exports = function (environment) {
const ENV = {
// Other options ...
'ember-showdown-shiki': {
theme: 'github-dark', // The theme to use for highlighting
languages: ['javascript', 'handlebars'], // The languages to highlight
colorReplacements: {
'#24292e': '#1c1e24',
}, // A map of colors to replace in the theme (see https://shiki.style/guide/theme-colors#color-replacements)
},
};
return ENV;
};
By default the theme used is github-dark
and all languages are loaded.
See the Contributing guide for details.
This project is licensed under the MIT License.
FAQs
Adds Shiki syntax highlighting for showdown-based markdown code blocks.
The npm package ember-showdown-shiki receives a total of 10 weekly downloads. As such, ember-showdown-shiki popularity was classified as not popular.
We found that ember-showdown-shiki demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.