1.0.476 • Published 3 years ago
octokit-to-highlightjs v1.0.476
octokit-to-highlightjs
if you are using github's markdown renderer and want to use highlightjs themes, use this to convert github's/octokit's syntax highlighting method with highlightjs's syntax highlighting method
Here's an example of how you use it
// importing
var oth = require("octokit-to-highlightjs")
// only if your raw markdown uses `<pre>` in a sentence (e.g. If you typed something like: "the tag <pre> is used to...")
var optimizer = require("octokit-to-highlightjs/dist/optimizer")
// raw is the markdown code and is a string in case you are wondering
// use optimizer only if your raw markdown uses `<pre>` in a sentence (e.g. If you typed something like: "the tag <pre> is used to...")
raw = optimizer(raw)
let octokitRendered: string = await (await octokit.rest.markdown.render({text: raw, mode: "markdown"})).data
let toHighlight: any = new oth(raw, octokitRendered)
let highlightedVersion = toHighlight.replaceWithHighlighted()
1.0.476
3 years ago
1.0.473
3 years ago
1.0.472
3 years ago
1.0.475
3 years ago
1.0.474
3 years ago
1.0.471
3 years ago
1.0.47
3 years ago
1.0.46
3 years ago
1.0.451
3 years ago
1.0.45
3 years ago
1.0.44
3 years ago
1.0.43
3 years ago
1.0.42
3 years ago
1.0.41
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.26
3 years ago
1.0.22
3 years ago
1.0.21
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago