Closed nagim closed 5 months ago
This would be extremely useful. Especially for technical content/documentation/educational content. I'm about to start writing programming framework documentation of a size that really amounts to a complete book. It will need to be heavily interlinked to be easy to use. And I will certainly need to refactor the structure a lot. As it stands just renaming or moving a file is virtually guaranteed to break links. Something that I will need to do often.
I fear maintaining the links to the degree that that alone might make me decide to not use Gitbook and go with something like AsciidocFX instead.
I think that Gitbook really needs some way of making maintaining links less painful. Validation of links would be a huge step in that direction.*
Any guidance/tips on how to lessen the pain in the meantime would be greatly appreciated.
Edit: It is probably obvious, but I will be using Asciidoc, not Markdown. Just thought I'd make that extra clear :)
Any guidance/tips on how to lessen the pain in the meantime would be greatly appreciated.
I recommend running https://github.com/gjtorikian/html-proofer on the generated site.
@mlidbom It's been a while since I wrote this suggestion. Since then, I've been using GitBook to write and maintain technical documentation.
The build log does contain a warning message for each broken link, so you can identify in which file the problematic link is and where does it point to. Something like this:
warn: page sourcefile.adoc contains an hyperlink to resource outside spine 'linktarget.adoc'
The links of course have to be maintained when moving files around (does AsciidocFX really does it for you (just curious)?), that could be done easier by doing a project-wide search with a text editor or IDE, to see where links should be changed. URL validators are also good to do a double check on the generated pages (I use the Check My Links extension for Chrome, but LinkChecker is also good.
All in all, I have a documentation of ~1600-1800 pages in ~500 files that contain ~3500 links and I barely have a broken link, so the situation is not that bad :smile: .
What would be even more useful, it that the Editor would check the links when you're writing the documents (similar to how it's validating the book.json
now, highlighting on the status bar if it has syntax error).
Cheers, Imre
@afeld
I recommend running https://github.com/gjtorikian/html-proofer on the generated site.
Will check that out. Thank you.
@nagim
the build log does contain a warning message for each broken link
AsciidocFX just prints warnings for broken links. I was actually not aware that Gitbook put that in a log. I should be able to check the log during builds and fail the build if there are any warnings about broken links. Thanks!
Since 3.x.x, GitBook accepts absolute paths
That will be essential if I do go with some way of maintaining all the links in some separate set of variables or something like that :)
All in all, I have a documentation of ~1600-1800 pages in ~500 files that contain ~3500 links and I barely have a broken link, so the situation is not that bad
Sounds good. Hopefully I'm just overthinking this then. But I've been burned too many times by team members just running of and writing an unmaintainable mess at speed to "just do it". I want to at least have thought things through and made sure I have a plan for how to handle it :)
@mlidbom If you're building with CLI, you're seeing the log real-time. If you're building with gitbook.com, you will see the log after it's finished.
That will be essential if I do go with some way of maintaining all the links in some separate set of variables or something like that :)
Could you please elaborate on this, what do you mean exactly?
If you're building with CLI, you're seeing the log real-time. If you're building with gitbook.com, you will see the log after it's finished.
That does not actually work. That is why I'm talking here in this issue.
For proof I put in this broken link in 3 places in a book:
link:BROKEN.adoc[Broken link]
And the build log shows zero warnings. Guess I'm back to the drawing board.
Could you please elaborate on this, what do you mean exactly?
Well I don't know exactly. That is what I'm researching right now.
The general idea is to try extract all the links I need into a structure that makes them easy to maintain, overview, and reuse time and time again. Something that would make the build fail entirely if something was wrong.
Best vague idea I have so far is to set up a a hierarchical representation of all the links in the whole book in book.json. Then use the templating and/or some utility functions to somehow insert/use the links wherever I want them. That way I only need to change a link in one place when i restructure. And I assume the build would fail with a reasonable error if i messed up and referred to links that do not exist.
But I'm having a real hard time finding any reasonable documentation on going beyond the very basics when working with a gitbook. The toolchain documentation is minimal to say the least. More like a quick introduction than full documentation.
Could you paste the build log here, as I don't have access to your book?
You can, BTW, define the link as a variable in book.json and then insert it into documents with templating syntax like this: {{ book.variableName }}
Could you paste the build log here, as I don't have access to your book?
Downloading source
Pulling from S3
Extracting source
tar: .gitignore: time stamp 2016-10-27 06:44:38 is 287.690147344 s in the future
tar: .idea/asciidocscratch.iml: time stamp 2016-10-27 06:44:38 is 287.68991292 s in the future
tar: .idea/jsLibraryMappings.xml: time stamp 2016-10-27 06:44:38 is 287.689857228 s in the future
tar: .idea/modules.xml: time stamp 2016-10-27 06:44:38 is 287.689812257 s in the future
tar: .idea/vcs.xml: time stamp 2016-10-27 06:44:38 is 287.689762754 s in the future
tar: .idea/workspace.xml: time stamp 2016-10-27 06:44:38 is 287.689689683 s in the future
tar: .idea: time stamp 2016-10-27 06:44:38 is 287.689659551 s in the future
tar: Gulpfile.js: time stamp 2016-10-27 06:44:38 is 287.689614114 s in the future
tar: README.adoc: time stamp 2016-10-27 06:44:38 is 287.689562706 s in the future
tar: SUMMARY.adoc: time stamp 2016-10-27 06:44:38 is 287.689516058 s in the future
tar: book.json: time stamp 2016-10-27 06:44:38 is 287.68946837 s in the future
tar: chapter-1/article02/article-1-2-1.adoc: time stamp 2016-10-27 06:44:38 is 287.689369536 s in the future
tar: chapter-1/article02/article2.adoc: time stamp 2016-10-27 06:44:38 is 287.689320216 s in the future
tar: chapter-1/article02/deep-nesting/deep-nesting.adoc: time stamp 2016-10-27 06:44:38 is 287.689244271 s in the future
tar: chapter-1/article02/deep-nesting/really-deep/really_deep.adoc: time stamp 2016-10-27 06:44:38 is 287.689171924 s in the future
tar: chapter-1/article02/deep-nesting/really-deep: time stamp 2016-10-27 06:44:38 is 287.689141988 s in the future
tar: chapter-1/article02/deep-nesting: time stamp 2016-10-27 06:44:38 is 287.689123228 s in the future
tar: chapter-1/article02: time stamp 2016-10-27 06:44:38 is 287.689102783 s in the future
tar: chapter-1/article1.adoc: time stamp 2016-10-27 06:44:38 is 287.689062406 s in the future
tar: chapter-1/readme.adoc: time stamp 2016-10-27 06:44:38 is 287.689015075 s in the future
tar: chapter-1: time stamp 2016-10-27 06:44:38 is 287.688988143 s in the future
tar: chapter-2/readme.adoc: time stamp 2016-10-27 06:44:38 is 287.688922177 s in the future
tar: chapter-2: time stamp 2016-10-27 06:44:38 is 287.688892711 s in the future
tar: chapter-3/readme.adoc: time stamp 2016-10-27 06:44:38 is 287.688827105 s in the future
tar: chapter-3: time stamp 2016-10-27 06:44:38 is 287.688800193 s in the future
tar: chapter-4/readme.adoc: time stamp 2016-10-27 06:44:38 is 287.688737792 s in the future
tar: chapter-4: time stamp 2016-10-27 06:44:38 is 287.688710683 s in the future
tar: package.json: time stamp 2016-10-27 06:44:38 is 287.68866982 s in the future
tar: start-watch.ps1: time stamp 2016-10-27 06:44:38 is 287.688623008 s in the future
tar: styles/website.css: time stamp 2016-10-27 06:44:38 is 287.688552531 s in the future
tar: styles: time stamp 2016-10-27 06:44:38 is 287.688515395 s in the future
GitBook version is 3.2.2
Tweaking book.json
Installing plugins
info: installing 3 plugins using npm@3.9.2
info:
info: installing plugin "disqus"
info: install plugin "disqus" (*) from NPM with version 0.1.0
testgitbook@0.0.1 /tmp/book
└── gitbook-plugin-disqus@0.1.0 extraneous
info: >> plugin "disqus" installed with success
info:
info: installing plugin "collapsible-chapters"
info: install plugin "collapsible-chapters" (*) from NPM with version 0.1.8
testgitbook@0.0.1 /tmp/book
├── gitbook-plugin-collapsible-chapters@0.1.8 extraneous
└── gitbook-plugin-disqus@0.1.0 extraneous
info: >> plugin "collapsible-chapters" installed with success
info:
info: installing plugin "comment"
info: install plugin "comment" (*) from NPM with version 1.0.5
testgitbook@0.0.1 /tmp/book
├── gitbook-plugin-collapsible-chapters@0.1.8 extraneous
├── gitbook-plugin-comment@1.0.5 extraneous
└── gitbook-plugin-disqus@0.1.0 extraneous
info: >> plugin "comment" installed with success
Building Site, will upload
info: 10 plugins are installed
info: 9 explicitly listed
info: loading plugin "disqus"... OK
info: loading plugin "collapsible-chapters"... OK
info: loading plugin "comment"... OK
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-default"... OK
info: found 10 pages
info: found 10 asset files
info: >> generation finished with success in 1.2s !
Site built, uploading now
awscli succeeded :)
Upload finished
You can, BTW, define the link as a variable in book.json and then insert it into documents with templating syntax like this: {{ book.variableName }}
Trying this out right now. Thank you :)
One request, could you please rebuild the book with 2.6.7?
Sure. Might take me a while to learn how though. If you could provide instructions that would help :)
Put this line into your book.json
:
"gitbook": "2.x.x",
Or you mean help with the variable thing?
Building with 2.x.x did log a warning
Downloading source
Pulling from S3
Extracting source
tar: .gitignore: time stamp 2016-10-27 07:15:03 is 92.324259779 s in the future
tar: .idea/asciidocscratch.iml: time stamp 2016-10-27 07:15:03 is 92.324022013 s in the future
tar: .idea/jsLibraryMappings.xml: time stamp 2016-10-27 07:15:03 is 92.323964203 s in the future
tar: .idea/modules.xml: time stamp 2016-10-27 07:15:03 is 92.323917791 s in the future
tar: .idea/vcs.xml: time stamp 2016-10-27 07:15:03 is 92.323867599 s in the future
tar: .idea/workspace.xml: time stamp 2016-10-27 07:15:03 is 92.323792856 s in the future
tar: .idea: time stamp 2016-10-27 07:15:03 is 92.323762048 s in the future
tar: Gulpfile.js: time stamp 2016-10-27 07:15:03 is 92.32371483 s in the future
tar: README.adoc: time stamp 2016-10-27 07:15:03 is 92.323664933 s in the future
tar: SUMMARY.adoc: time stamp 2016-10-27 07:15:03 is 92.323616165 s in the future
tar: book.json: time stamp 2016-10-27 07:15:03 is 92.323567264 s in the future
tar: chapter-1/article02/article-1-2-1.adoc: time stamp 2016-10-27 07:15:03 is 92.323462353 s in the future
tar: chapter-1/article02/article2.adoc: time stamp 2016-10-27 07:15:03 is 92.323407239 s in the future
tar: chapter-1/article02/deep-nesting/deep-nesting.adoc: time stamp 2016-10-27 07:15:03 is 92.323330615 s in the future
tar: chapter-1/article02/deep-nesting/really-deep/really_deep.adoc: time stamp 2016-10-27 07:15:03 is 92.323250036 s in the future
tar: chapter-1/article02/deep-nesting/really-deep: time stamp 2016-10-27 07:15:03 is 92.323204311 s in the future
tar: chapter-1/article02/deep-nesting: time stamp 2016-10-27 07:15:03 is 92.323177854 s in the future
tar: chapter-1/article02: time stamp 2016-10-27 07:15:03 is 92.323157125 s in the future
tar: chapter-1/article1.adoc: time stamp 2016-10-27 07:15:03 is 92.323116583 s in the future
tar: chapter-1/readme.adoc: time stamp 2016-10-27 07:15:03 is 92.323066704 s in the future
tar: chapter-1: time stamp 2016-10-27 07:15:03 is 92.323039654 s in the future
tar: chapter-2/readme.adoc: time stamp 2016-10-27 07:15:03 is 92.322972776 s in the future
tar: chapter-2: time stamp 2016-10-27 07:15:03 is 92.32294266 s in the future
tar: chapter-3/readme.adoc: time stamp 2016-10-27 07:15:03 is 92.322877039 s in the future
tar: chapter-3: time stamp 2016-10-27 07:15:03 is 92.322849276 s in the future
tar: chapter-4/readme.adoc: time stamp 2016-10-27 07:15:03 is 92.32278541 s in the future
tar: chapter-4: time stamp 2016-10-27 07:15:03 is 92.322757461 s in the future
tar: package.json: time stamp 2016-10-27 07:15:03 is 92.322716253 s in the future
tar: start-watch.ps1: time stamp 2016-10-27 07:15:03 is 92.322667992 s in the future
tar: styles/website.css: time stamp 2016-10-27 07:15:03 is 92.322596027 s in the future
tar: styles: time stamp 2016-10-27 07:15:03 is 92.322557786 s in the future
Installing GitBook 2.6.7
gitbook@2.6.7 ../tmp-40SVqab4y7HG9t/node_modules/gitbook
├── bash-color@0.0.3
├── escape-string-regexp@1.0.3
├── gitbook-plugin-livereload@0.0.1
├── nunjucks-filter@1.0.0
├── spawn-cmd@0.0.2
├── gitbook-plugin-sharing@1.0.1
├── gitbook-plugin-fontsettings@1.0.2
├── nunjucks-autoescape@1.0.0
├── github-slugid@1.0.0
├── jsonschema@1.0.2
├── json-schema-defaults@0.1.1
├── q@1.0.1
├── graceful-fs@3.0.5
├── semver@5.0.1
├── urijs@1.17.0
├── crc@3.2.1
├── tmp@0.0.24
├── dom-serializer@0.1.0 (domelementtype@1.1.3, entities@1.1.1)
├── npmi@0.1.1 (semver@4.3.6)
├── merge-defaults@0.2.1 (lodash@2.4.2)
├── resolve@0.6.3
├── send@0.2.0 (range-parser@1.0.3, fresh@0.2.4, mime@1.2.11, debug@2.2.0)
├── i18n@0.5.0 (sprintf@0.1.5, mustache@2.2.1, debug@2.2.0)
├── request@2.51.0 (tunnel-agent@0.4.3, aws-sign2@0.5.0, forever-agent@0.5.2, caseless@0.8.0, oauth-sign@0.5.0, stringstream@0.0.5, json-stringify-safe@5.0.1, mime-types@1.0.2, node-uuid@1.4.7, qs@2.3.3, tough-cookie@2.3.2, combined-stream@0.0.7, http-signature@0.10.1, form-data@0.2.0, bl@0.9.5, hawk@1.1.1)
├── fs-extra@0.16.5 (jsonfile@2.4.0, rimraf@2.5.4)
├── tiny-lr@0.2.1 (parseurl@1.3.1, livereload-js@2.2.2, qs@5.1.0, debug@2.2.0, body-parser@1.14.2, faye-websocket@0.10.0)
├── nunjucks@2.2.0 (asap@2.0.5, optimist@0.6.1)
├── chokidar@1.0.6 (arrify@1.0.1, path-is-absolute@1.0.1, is-glob@1.1.3, async-each@0.1.6, is-binary-path@1.0.1, glob-parent@1.3.0, readdirp@1.4.0, anymatch@1.3.0)
├── fstream-ignore@1.0.2 (inherits@2.0.3, minimatch@2.0.10, fstream@1.0.10)
├── cheerio@0.19.0 (entities@1.1.1, css-select@1.0.0, htmlparser2@3.8.3)
├── gitbook-plugin-search@1.1.0 (lunr@0.5.12)
├── gitbook-parsers@0.8.9 (q@1.4.1, gitbook-restructuredtext@0.2.3, gitbook-markdown@0.5.3, gitbook-asciidoc@0.2.4)
├── gitbook-plugin-highlight@1.0.3 (highlight.js@8.8.0)
├── lodash@3.10.1
├── juice@1.5.0 (commander@2.3.0, slick@1.12.1, batch@0.5.2, cssom@0.3.0, web-resource-inliner@1.1.4)
└── npm@2.4.1
GitBook version is 2.6.7
Tweaking book.json
Installing plugins
info: 3 plugins to install
info: No version specified, resolve plugin disqus
info: install plugin disqus from npm (gitbook-plugin-disqus) with version 0.1.0
gitbook-plugin-disqus@0.1.0 node_modules/gitbook-plugin-disqus
info: >> plugin disqus installed with success
info: No version specified, resolve plugin collapsible-chapters
info: install plugin collapsible-chapters from npm (gitbook-plugin-collapsible-chapters) with version 0.1.8
gitbook-plugin-collapsible-chapters@0.1.8 node_modules/gitbook-plugin-collapsible-chapters
info: >> plugin collapsible-chapters installed with success
info: No version specified, resolve plugin comment
info: install plugin comment from npm (gitbook-plugin-comment) with version 0.2.1
gitbook-plugin-comment@0.2.1 node_modules/gitbook-plugin-comment
info: >> plugin comment installed with success
Done, without error
Building Site, will upload
info: loading book configuration....OK
info: load plugin gitbook-plugin-disqus ....OK
info: load plugin gitbook-plugin-collapsible-chapters ....OK
info: load plugin gitbook-plugin-comment ....OK
info: load plugin gitbook-plugin-highlight ....OK
info: load plugin gitbook-plugin-search ....OK
info: load plugin gitbook-plugin-sharing ....OK
info: load plugin gitbook-plugin-fontsettings ....OK
info: >> 7 plugins loaded
info: start generation with website generator
info: clean website generatorOK
warn: page chapter-1/article1.adoc contains an hyperlink to resource outside spine 'BROKEN.adoc'
info: generation is finished
Done, without error
Site built, uploading now
awscli succeeded :)
Upload finished
Thanks, that's what I wanted to confirm, I had a feeling that this message is omitted from the logs only in case of v3.
I will let the team know about this, so they can check it and put it back.
Thank you. That's great :)
I'm having real trouble editing book.json by the way. Pasting is working about 10% of the time. Most of the time when I try to paste something nothing visible is inserted, but the counter of changes goes up.
What editor you use?
Gitbook Editor
Desktop or in the browser?
Locally on windows 10
I've yet to manage to paste this link link:README.adoc[Introduction]
from SUMMARY.adoc
Into the value of a variable in book.json.
It appears that something changes since the updates counter goes up, but nothing visible is inserted.
Seems it depends on where I try to paste it. If I paste outside the actual json structure the content is inserted.
Anywhere within the {...}
and nothing visible happens.
Instead of CTRL-V, use right-click and Paste.
Yes. That workaround works. Thanks :) I assume this is still considered a bug to be fixed though right? :)
Sure, this is a known bug and will be fixed in the next Editor release (as well as many other things).
Great :)
@nagim I'm trying out your suggestion:
You can, BTW, define the link as a variable in book.json and then insert it into documents with templating syntax like this: {{ book.variableName }}
But from what I can tell the templating engine does not even try to handle anything I write. Seems like it is not running at all as part of the build. I've read through the toolchain documentation on templating and conrefs (two short pages) and I can find no mention of having to do anything to enable it.
This is my README.adoc from the root of the book.
= Introduction
{{ book.testlink }}
{ % include "./nosuchfile.adoc" % }
link:{{ book.testurl }}[Manual link name]
My sandbox for figuring out how to work with Asciidoc and Gitbook.
Except for {{ book.testurl }}
disappearing the build does not seem to do anything with any of this. It looks the same in the built book as in the original adoc file.
Is youre repo on GitHub? If not, please send me your book.json, I can have a look at it.
Repo is hosted on Gitbook for now while I'm evaluating gitbook. Here's the book.json:
{
"plugins": [
"disqus",
"collapsible-chapters"
],
"pluginsConfig": {
"disqus": {
"shortName": "composable"
},
"collapsible-chapters":{}
},
"testlink" : "link:README.adoc[Introduction from links is book.json]",
"testurl" : "README.adoc",
"links" : {
"introduction" : {
"introduction" : "link:README.adoc[Introduction from links is book.json]"
}
}
}
The problem is in your book.json.
Try this instead:
{
"plugins": [
"disqus",
"collapsible-chapters"
],
"pluginsConfig": {
"disqus": {
"shortName": "composable"
},
"collapsible-chapters":{}
},
"variables" : {
"testlink" : "link:README.adoc[Introduction from links is book.json]",
"testurl" : "README.adoc"
}
}
You have to put all variables into the variables
list.
Then you can access them with {{ book.variableName }}
.
Also, I think you also want to correct this one:
{ % include "./nosuchfile.adoc" % }
to {% include "./nosuchfile.adoc" %}
Be careful not to put spaces between {
and %
. This path also needs to be absolute.
Out of curiosity, where did you checked the GitBook documentation (which link)?
You have to put all variables into the variables list.
Thanks. That made variable expansion work. Now on to getting it to work with links :)
Also, I think you also want to correct this one: ...
Ah spaces. Thank you that fixed the "why is nothing happening" problem and caused the build to fail as I would expect :)
Out of curiosity, where did you checked the GitBook documentation (which link)?
:+1:
Yes, having a more complete documentation is another target I think.
Here are some other variables, maybe these can be of use for you as well: http://toolchain.gitbook.com/templating/variables.html
Here are some other variables, maybe these can be of use for you as well:
Thanks. I've actually read pretty much the whole guide though :)
Afraid that the linking thing does not seem to work out as hoped. The templating is apparently invoked via javascript in the finished pages. Long after all the Asciidoc parsing. So the link remains as .adoc instead of being transformed as I want it to. Surprisingly and confusingly some Asciidoc parsing does seem to appear in the browser since it was actually rendered as a link.
I tried going back to 2.6.7 so that I could get the link validation. But I cannot install that version locally.
Cannot find module internal/fs
Full log:
gitbook.cmd install
Installing GitBook 2.6.7
gitbook@2.6.7 ..\..\..\..\AppData\Local\Temp\tmp-63888kJ7Cvf1WzQqN\node_modules\gitbook
├── bash-color@0.0.3
├── escape-string-regexp@1.0.3
├── nunjucks-filter@1.0.0
├── gitbook-plugin-sharing@1.0.1
├── gitbook-plugin-livereload@0.0.1
├── gitbook-plugin-fontsettings@1.0.2
├── github-slugid@1.0.0
├── nunjucks-autoescape@1.0.0
├── spawn-cmd@0.0.2
├── jsonschema@1.0.2
├── q@1.0.1
├── json-schema-defaults@0.1.1
├── graceful-fs@3.0.5
├── crc@3.2.1
├── urijs@1.17.0
├── tmp@0.0.24
├── semver@5.0.1
├── dom-serializer@0.1.0 (domelementtype@1.1.3, entities@1.1.1)
├── merge-defaults@0.2.1 (lodash@2.4.2)
├── npmi@0.1.1 (semver@4.3.6)
├── send@0.2.0 (fresh@0.2.4, range-parser@1.0.3, mime@1.2.11, debug@2.2.0)
├── resolve@0.6.3
├── i18n@0.5.0 (sprintf@0.1.5, mustache@2.2.1, debug@2.2.0)
├── request@2.51.0 (tunnel-agent@0.4.3, aws-sign2@0.5.0, forever-agent@0.5.2, caseless@0.8.0, oauth-sign@0.5.0, stringstream@0.0.5, json-stringify-safe@5.0.1, mime-types@1.0.2, qs@2.3.3, node-uuid@1.4.7, tough-cookie@2.3.2, combined-stream@0.0.7, form-data@0.2.0, http-signature@0.10.1, bl@0.9.5, hawk@1.1.1)
├── fs-extra@0.16.5 (jsonfile@2.4.0, rimraf@2.5.4)
├── tiny-lr@0.2.1 (parseurl@1.3.1, livereload-js@2.2.2, qs@5.1.0, debug@2.2.0, body-parser@1.14.2, faye-websocket@0.10.0)
├── nunjucks@2.2.0 (asap@2.0.5, optimist@0.6.1)
├── chokidar@1.0.6 (arrify@1.0.1, is-glob@1.1.3, path-is-absolute@1.0.1, async-each@0.1.6, is-binary-path@1.0.1, glob-parent@1.3.0, readdirp@1.4.0, anymatch@1.3.0)
├── fstream-ignore@1.0.2 (inherits@2.0.3, minimatch@2.0.10, fstream@1.0.10)
├── cheerio@0.19.0 (entities@1.1.1, css-select@1.0.0, htmlparser2@3.8.3)
├── gitbook-plugin-search@1.1.0 (lunr@0.5.12)
├── gitbook-parsers@0.8.9 (q@1.4.1, gitbook-restructuredtext@0.2.3, gitbook-markdown@0.5.3, gitbook-asciidoc@0.2.4)
├── gitbook-plugin-highlight@1.0.3 (highlight.js@8.8.0)
├── lodash@3.10.1
├── juice@1.5.0 (commander@2.3.0, slick@1.12.1, batch@0.5.2, cssom@0.3.0, web-resource-inliner@1.1.4)
└── npm@2.4.1
Error loading version latest: Error: Cannot find module 'internal/fs'
at Function.Module._resolveFilename (module.js:472:15)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at evalmachine.<anonymous>:17:20
at Object.<anonymous> (C:\Users\malm\.gitbook\versions\2.6.7\node_modules\graceful-fs\fs.js:11:1)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
TypeError: Cannot read property 'commands' of null
Afraid that the linking thing does not seem to work out as hoped. The templating is apparently invoked via javascript in the finished pages. Long after all the Asciidoc parsing. So the link remains as .adoc instead of being transformed as it want it to. Surprisingly and confusingly some Asciidoc parsing does seem to appear in the browser since it was actually rendered as a link.
This is quite strange, as I had no problems with it at all. Could you show me the current book.json
and the content of the file where you're using the variable?
Re install issue: don't know what could be the problem there, it installed for me without issue. How did you install it? Usually the way to install a gitbook version is to specify the version in book.json
and it will install it automagically when running gitbook build
.
Re install issue: don't know what could be the problem there, it installed for me without issue. How did you install it? Usually the way to install a gitbook version is to specify the version in book.json and it will install it automagically when running gitbook buil
Thats what I did first. That results in the same logg that I pasted above.
I'll get back to you about the link thing when I have a running build environment :)
Thanks again for all your help. And sorry for kind of making this issue a personal support thread. Should we take this somewhere else?
You can register on the Slack channel and send me a DM there (my username is the same as here).
Hi,
This is an enhancement suggestion rather than an issue. It would be useful if some kind of link validation would be included in the tool chain when building the book (check for broken links, etc.). Or have some configuration option/variables which keeps the links up-to-date even if we move the files within the file structure. I saw some examples in Jekyll, but it involved usin YAML files, if I recall correctly.