Giter VIP home page Giter VIP logo

Comments (6)

azu avatar azu commented on August 26, 2024

Maybe related https://github.com/honkit/honkit/tree/master/packages/%40honkit/markdown

from honkit.

azu avatar azu commented on August 26, 2024

https://github.com/vowstar/gitbook-plugin-uml/blob/99ad7443d2a2c051c2327c7ebda63a0ca19f1621/index.js#L138-L203
convert to

{% uml %}
@startuml

	Class Stage
	Class Timeout {
		+constructor:function(cfg)
		+timeout:function(ctx)
		+overdue:function(ctx)
		+stage: Stage
	}
 	Stage <|-- Timeout

@enduml
{% enduml %}

from honkit.

azu avatar azu commented on August 26, 2024

return parser.preparePage(currentPage.getContent());

convert indent to backtick(codeblock)

from honkit.

azu avatar azu commented on August 26, 2024

I figure out it.
#58 (comment)

The plugin CodeBlock to Block Tags.

and then,

function preparePage(src) {
let levelRaw = 0;
const content = markdown.toContent(src, {
math: true,
template: true,
});
const textMarkdown = markdown.toText(content, {
annotate: function (state, raw, token) {
const tokenType = token.getType();
if (tokenType === MarkupIt.ENTITIES.TEMPLATE) {
const type = token.getData().get("type");
const expr = token.getAsPlainText();
if (type === "expr") {
if (expr === "raw") {
levelRaw = levelRaw + 1;
} else if (expr == "endraw") {
levelRaw = 0;
}
}
}
if ((tokenType === MarkupIt.BLOCKS.CODE || tokenType === MarkupIt.STYLES.CODE) && levelRaw === 0) {
return escape(raw);
}
return raw;
},
});
return textMarkdown;
}
convert \t to CodeBlock.

from honkit.

azu avatar azu commented on August 26, 2024

https://github.com/GitbookIO/gitbook-markdown/blob/master/package.json
GitBook use 1.3.2. But HonKit use 2.x

from honkit.

azu avatar azu commented on August 26, 2024

#60 will fix this issue.

But, still exist edge case like following.
&lt; should be parse error. We not have solution for the edge case.

{% uml %}
@startuml

	Class Stage
	Class Timeout {
		+constructor:function(cfg)
		+timeout:function(ctx)
		+overdue:function(ctx)
		+stage: Stage
	}
 	Stage &lt;|-- Timeout

@enduml
{% enduml %}

from honkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.