
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
@rakutentech/docsify-code-inline
Advanced tools
A Docsify plugin that enables syntax highlighting for inline code.
The plugin automatically loads itself, unless the data-no-autoload attribute is set. It also automatically injects CSS in the DOM, unless the data-no-css-inject attribute is set:
<!-- autoloads, injects CSS -->
<script
src="//unpkg.com/@rakutentech/docsify-code-inline/dist/index.min.js"
></script>
<!-- autoloads, doesn't inject CSS -->
<script
src="//unpkg.com/@rakutentech/docsify-code-inline/dist/index.min.js"
data-no-css-inject
></script>
<!-- doesn't load, doesn't inject CSS -->
<script
src="//unpkg.com/@rakutentech/docsify-code-inline/dist/index.min.js"
data-no-autoload
data-no-css-inject
></script>
You can also import it as an ES module, if using the .esm build:
<script type="module" src="//unpkg.com/@rakutentech/docsify-code-inline/dist/index.esm.min.js"></script>
The module also supports Node. See the API below.
npm install --save-dev @rakutentech/docsify-code-inline
If you wrap `code` with square brackets and add a language identifier, e.g.
[`<link href="foo">` html], then the produced markup will enable syntax
highlighting using PrismJS like in code fences.
…produces the following DOM tree when PrismJS is loaded with HTML support:
<p>
If you wrap
<code>
code
</code>
with square brackets and add a language identifier, e.g.
<code class="language-html">
<span class="token tag">
<span class="token tag">
<span class="token punctuation">
<
</span>
link
</span>
<span class="token attr-name">
href
</span>
<span class="token attr-value">
<span class="token punctuation attr-equals">
=
</span>
<span class="token punctuation">
"
</span>
foo
<span class="token punctuation">
"
</span>
</span>
<span class="token punctuation">
>
</span>
</span>
</code>
, then the produced markup will enable syntax highlighting using PrismJS like in code fences.
</p>
The plugin uses the styles defined by docsify-themeable.
Types are included in the library.
Two things are exported:
const DEFAULT_CSS: string, the CSS rules that are normally added to the DOM when the library is loaded in a browser and data-no-css-inject not used.function transform(markdown: string): string, the method used by the plugin to replace inline code with syntax-highlighted spans in a markdown document.FAQs
Syntax highlighting for inline code
The npm package @rakutentech/docsify-code-inline receives a total of 22 weekly downloads. As such, @rakutentech/docsify-code-inline popularity was classified as not popular.
We found that @rakutentech/docsify-code-inline demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.