1.0.476 • Published 2 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
2 years ago
1.0.473
2 years ago
1.0.472
2 years ago
1.0.475
2 years ago
1.0.474
2 years ago
1.0.471
2 years ago
1.0.47
2 years ago
1.0.46
2 years ago
1.0.451
2 years ago
1.0.45
2 years ago
1.0.44
2 years ago
1.0.43
2 years ago
1.0.42
2 years ago
1.0.41
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.26
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago