
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
doczen-convert
Advanced tools
npm install -g doczen-convert
doczen /path/to/my/document.md
Doczen syntax is a superset of markdown. You can use the full power of markdown, plus these additions:
A REPL is attached to a section, so to have multiple REPLs on a page, you need to use multiple sections.
You denote a new section with 3 or more colons in a row on a line alone.
More than 3 is allowed, but not necessary.
A blank line before/after the divider is allowed, but not necessary.
:::
This is a section
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
This is another section.
And here is section 2 paragraph 2
If you don't want your section to have a REPL, put an x
after the divider, like this:
:::x
This is a section without a REPL
A document starts with an implicit section, so there's no need to add a divider at the beginning of the file.
All triple-backtick code blocks will be runnable by default, so you don't have to do anything special.
You can use a few "classes" to customize the code block:
.not-runnable
- Omit the "execute in REPL" button.no-highlight
- Omit syntax highlightingYou can combine "classes". Use them like this:
```javascript.not-runnable.no-highlight
```
You can make a fill-in-the-blank section in any triple-backtick code block by
wrapping any number of underscores or spaces inside [[ ]]
. Like this:
```javascript
console.log([[_______]] + ", World!")
```
The number of spaces or underscores you use will determine the width of the blank space.
You may or may not need these:
You can give a code block an ID like this:
```javascript#my-code-block
```
You'll probably also want to use the .hidden
class on the code block:
```javascript#my-code-block.hidden
```
You can combine an ID with any of the "classes" listed above. This is mostly useful for preloaded REPL contexts...
If you want to preload some context into your REPL (say, to define some functions or make a global variable available), you can do it like this:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
<#id-of-tag-with-code
Then whatever's inside $('#id-of-tag-with-code')
will be eval'd in the REPL.
Here's a full example:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
<#my-section-context
Hey look, i'm in a section!
```javascript#my-section-context.hidden
function say_hello() {
console.log("Hello, World!")
}
```
Now if a user executes say_hello()
in the section's REPL, "Hello, World!" will be printed
to the console.
var doczen = require('doczen-convert/stream')
gulp.src('docs/**/*.md')
.pipe(doczen(optional_options))
.pipe(gulp.dest('output_docs'))
Options object passed to .stream(opts)
:
// Or with options:
{
// All options are optional
// specify template
template: '<div id="docs"></div>',
// OR optionally specify template_file (asynchronous read)
template_file: './template.html',
// If a template is specified, you'll want to set the selector
container_selector: '#docs',
// If you want to modify the marked settings
marked: {...}
}
FAQs
Converts Markdown into Doczen-compatible HTML
The npm package doczen-convert receives a total of 0 weekly downloads. As such, doczen-convert popularity was classified as not popular.
We found that doczen-convert 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.