yakivmospan / github-wikito-converter

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

locally installed wiki converter can't find things #67

Open jsoref opened 3 years ago

jsoref commented 3 years ago

Steps

$ yarn add github-wikito-converter
$ ./node_modules/.bin/gwtc -d .                                              
(node:44111) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
Unhandled rejection Error: ENOENT: no such file or directory, stat '/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/github-wikito-converter/node_modules/jquery/dist/jquery.min.js'
    at Object.statSync (node:fs:1141:3)
    at Object.statSync (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/graceful-fs/polyfills.js:312:16)
    at Object.copySync (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/fs-extra/lib/copy-sync/copy-sync.js:20:58)
    at WikiConverter.<anonymous> (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/github-wikito-converter/dist/wiki-converter.js:166:12)
    at Array.forEach (<anonymous>)
    at WikiConverter.copyAssets (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/github-wikito-converter/dist/wiki-converter.js:165:19)
    at WikiConverter.<anonymous> (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/github-wikito-converter/dist/wiki-converter.js:54:16)
    at tryCatcher (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/bluebird/js/main/promise.js:510:31)
    at Promise._settlePromiseAt (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/bluebird/js/main/promise.js:584:18)
    at Promise._settlePromises (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/bluebird/js/main/promise.js:700:14)
    at Async._drainQueue (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/jsoref/code/spelling-org/check-spelling.wiki/node_modules/bluebird/js/main/async.js:15:14)
    at processImmediate (node:internal/timers:464:21)

Workaround

--- node_modules/github-wikito-converter/dist/wiki-converter.js 2021-05-02 12:37:52.000000000 -0400
+++ node_modules.0/github-wikito-converter/dist/wiki-converter.js       2021-05-02 12:41:42.000000000 -0400
@@ -135,7 +135,7 @@
     key: "computeCssFiles",
     value: function computeCssFiles() {

-      this.cssFiles = [path.join(__dirname, '..', 'node_modules', 'bootstrap', 'dist', 'css', 'bootstrap.min.css'), path.join(__dirname, '..', 'node_modules', 'highlight.js', 'styles', 'default.css'), path.join(__dirname, '..', 'node_modules', 'highlight.js', 'styles', this.options.highlightTheme + '.css'), path.join(this.cssPath, 'doc.css')];
+      this.cssFiles = [path.join(__dirname, '..', '..', '..', 'node_modules', 'bootstrap', 'dist', 'css', 'bootstrap.min.css'), path.join(__dirname, '..', '..', '..', 'node_modules', 'highlight.js', 'styles', 'default.css'), path.join(__dirname, '..', '..', '..', 'node_modules', 'highlight.js', 'styles', this.options.highlightTheme + '.css'), path.join(this.cssPath, 'doc.css')];

       this.options.userCssFile && this.cssFiles.push(path.resolve(this.options.userCssFile));
       return this;
@@ -149,7 +149,7 @@
     key: "computeJsFiles",
     value: function computeJsFiles() {

-      this.jsFiles = [path.join(__dirname, '..', 'node_modules', 'jquery', 'dist', 'jquery.min.js'), path.join(__dirname, '..', 'node_modules', 'bootstrap', 'dist', 'js', 'bootstrap.min.js')];
+      this.jsFiles = [path.join(__dirname, '..', '..', '..', 'node_modules', 'jquery', 'dist', 'jquery.min.js'), path.join(__dirname, '..', '..', '..', 'node_modules', 'bootstrap', 'dist', 'js', 'bootstrap.min.js')];

       this.options.userJsFile && this.jsFiles.push(path.resolve(this.options.userJsFile));
       return this;