yakivmospan / github-wikito-converter

Generate HTML & PDF documentation from Github wiki or any other markdown-based wiki.
Other
293 stars 52 forks source link

Converting a GitLab wiki 🏆 #17

Closed ninjayoto closed 6 years ago

ninjayoto commented 6 years ago

Thanks @yakivmospan for a great tool, after trying it on a Github wiki, I thought I would try it on Gitlab. When I've tried it on a Gitlab repo wiki, it seemed to detect all the files and TOC fine, except it just errors out on Unhandled rejection Error: Unknown language: "text" 🤔

here is the complete command and complete output.

gwtc -v ./mkvtoolnix.wiki

debug:   gwc launched with options format=html, output=./, filename=documentation, title=Documentation , logoImage=null, footer=null, pdfPageCount=null, tocFile=null, tocLevel=3, highlightTheme=github, userCssFile=null, verbose=true, disableInlineAssets=false
debug:   Found 54 markdown files and 54 links pointing to them in TOC
Unhandled rejection Error: Unknown language: "text"
Please report this to https://github.com/markedjs/marked.
    at Object.highlight (/usr/local/lib/node_modules/github-wikito-converter/node_modules/highlight.js/lib/highlight.js:443:13)
    at Renderer.mainRenderer.code (/usr/local/lib/node_modules/github-wikito-converter/dist/markdown.js:34:79)
    at Parser.tok (/usr/local/lib/node_modules/github-wikito-converter/node_modules/marked/lib/marked.js:1054:28)
    at Parser.parse (/usr/local/lib/node_modules/github-wikito-converter/node_modules/marked/lib/marked.js:999:17)
    at Function.Parser.parse (/usr/local/lib/node_modules/github-wikito-converter/node_modules/marked/lib/marked.js:981:17)
    at marked (/usr/local/lib/node_modules/github-wikito-converter/node_modules/marked/lib/marked.js:1317:19)
    at Markdown.convertMarkdownString (/usr/local/lib/node_modules/github-wikito-converter/dist/markdown.js:109:14)
    at Markdown.convertMarkdownFile (/usr/local/lib/node_modules/github-wikito-converter/dist/markdown.js:116:19)
    at WikiConverter.<anonymous> (/usr/local/lib/node_modules/github-wikito-converter/dist/wiki-converter.js:87:41)
    at Array.forEach (native)
    at WikiConverter.computePages (/usr/local/lib/node_modules/github-wikito-converter/dist/wiki-converter.js:83:27)
    at WikiConverter.getPages (/usr/local/lib/node_modules/github-wikito-converter/dist/wiki-converter.js:96:14)
    at HtmlWriter.write (/usr/local/lib/node_modules/github-wikito-converter/dist/html-writer.js:33:34)
    at WikiConverter.<anonymous> (/usr/local/lib/node_modules/github-wikito-converter/dist/wiki-converter.js:60:43)
    at tryCatcher (/usr/local/lib/node_modules/github-wikito-converter/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/github-wikito-converter/node_modules/bluebird/js/main/promise.js:510:31)

this is the sample public wiki I've cloned from gitlab: git clone git@gitlab.com:mbunkus/mkvtoolnix.wiki.git

Any theories on why I'm getting that error?

yakivmospan commented 6 years ago

Hey, seems that code highlighter used in gwtc is not able to parse ``` text from SRT-subtitle-file-not-recognized.md file. Change it to ``` instead (remove text) and it will work fine. Attached pdf and html files, generated from mkvtoolnix wiki.

ninjayoto commented 6 years ago

Thanks again. I don't maintain that wiki, so I too can only make that change locally. But it's great to know that wikito-converter works well with other *.wiki.git repos not only github. Will leave this issue open, hope that in a future iteration wikito-converter can overcome issues caused by the likes of ```text on it's own. Will post about wikito for the gitlab community, thanks again for the prompt responses.

yakivmospan commented 6 years ago

Moving this topic under #21