-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad handling of block arguments #934
Comments
That's weird, there are tests for all of this: https://github.com/GitbookIO/gitbook/blob/master/test/plugins.js#L195 What version of node are you using ? Are the gitbook unit tests passing for you ? |
I've added more tests and it's still passing correctly (f5afbc9). |
v0.12.7
How can I be able to know what version of GitBook is downloading the gitbook-cli? [OffTopic]: instead of define the version with a field on |
Run Can you run the unit test and tell me if there are passing ? I can't reproduce your issue. To run unit tests:
99% people using GitBook are not node developers, I made the choice of using only one file to define the configuration For plugins, using For example if a book is built with GitBook 2.0.0, and use a plugin This is just choices that I made, bring simplicity to the 90% of our authors, maybe it's a mistake, but I'm currently convince that it's a better idea to not see GitBook as "a node.js library", but as a complete/independent toolchain; even if that hurts some Node.js developers like you. |
[piranna@Mabuk:~/Universidad Rey JuanCarlos/pfc]
(master) > gitbook versions:print
Current version is 2.1.0
Initially they were not passing because I haven't had
I agree, and don't believe it's a bad thing, but being a node.js app it will be inevitable they will find some node.js spikes... That's from the perspective that generating the books manually it's a first-class use case, or if it's only the GitBook editor (both desktop app or cloud one). In that last case your approach it's correct. In my case, I've "fixed" it by adding a postinstall, pdf and serve tasks to the scripts sections of my package.json, so for readers to generate the book is so simple as npm install
npm run pdf
If I understood it correctly, by setting
I don't think it's a bad decission, but definitely they are not incompatibles, we already can have If it's of your interest, that's the {
"name": "NodeOS",
"description": "Sistema operativo ligero para Node.js",
"author": "Jesús Leganés Combarro 'piranna' <[email protected]>",
"version": "0.0.0",
"scripts": {
"pdf": "gitbook pdf . NodeOS.pdf",
"postinstall": "gitbook install && npm install piranna/gitbook-plugin-mermaid#patch-1",
"serve": "gitbook serve ."
},
"repository": {
"type": "git",
"url": "https://github.com/piranna/pfc.git"
},
"bugs": {
"url": "https://github.com/piranna/pfc/issues"
},
"homepage": "https://github.com/piranna/pfc",
"devDependencies": {
"gitbook-cli": "^0.3.6",
"svgexport": "^0.2.5"
},
"dependencies": {
"gitbook-plugin-autocover": "GitbookIO/plugin-autocover",
"gitbook-plugin-mermaid": "piranna/gitbook-plugin-mermaid#patch-1"
}
} |
By the way, the |
args and kwargs fields of block object are incorrectly filled. When using a single argument like
{% mermaid "user.mmd" %}{% endmermaid %}
, the block object get filled asand when using two arguments like
{% mermaid "user.mmd", "2" %}{% endmermaid %}
it gets filled asAccording to the docs, positional arguments should be filled in
args
always, that makes sense. Keyword arguments ({% mermaid src="user.mmd" %}{% endmermaid %}
) seems to works as expected:By the way, I think that
__keywords
field is mostly useless...The text was updated successfully, but these errors were encountered: