Skip to content

How can I set headless mode? #107

Answered by Saul-Mirone
devrsi0n asked this question in Q&A
Discussion options

You must be logged in to vote

For now, you can set it like this:

import { commonmarkNodes, commonmarkPlugins, heading, paragraph } from '@milkdown/preset-commonmark';

const nodes = commonmark
    .configure(paragraph, {
        headless: true
    })
    .configure(heading, {
        headless: true
    });

new Editor().use(nodes).use(commonmarkPlugins);

There is a feature that is not released yet, that you can simple set all nodes to headless like:

const nodes = commonmark.headless();

new Editor().use(nodes).use(commonmarkPlugins);

I still need to make sure all plugins and nodes support headless mode before ship this feature, but it won't take long time.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@devrsi0n
Comment options

@Saul-Mirone
Comment options

@Saul-Mirone
Comment options

Answer selected by Saul-Mirone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants