Skip to content
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

TOC not generating #169

Open
cvax opened this issue Oct 2, 2016 · 21 comments
Open

TOC not generating #169

cvax opened this issue Oct 2, 2016 · 21 comments
Labels

Comments

@cvax
Copy link

cvax commented Oct 2, 2016

I am not sure what the issue is, but I can't get it to generate the TOC as described in your usage instructions. I setup a super simple test over here: https://github.com/cvax/docpresstest
I am on docpress 0.7.0 and Windows 7.

When I serve this page it generates the root README.md just fine, but it doesn't build any of the TOC's README.md in /docs folder. I also tried to clone one of your showcase's docs to try serving, same result. Root README.md works, but TOCs didn't build.

Is this a docpress installation issue? Perhaps Windows issue? I just installed the npm package globally. There were some npm deprecated warnings on minimatch, native-or-bluebird, and fsevents though.

@knownasilya
Copy link
Member

Try installing it locally in the project you're trying to build.

@cvax
Copy link
Author

cvax commented Nov 1, 2016

I just tried this, but same results. No TOC with chapters built.
I am on Node 6.9.1 with docpress 0.7.1.

npm uninstall docpress -g
npm install docpress
docpress serve

I also tried

npm init
npm install --save-dev --save-exact docpress
docpress serve

They build the page, but the generated TOC has nothing from my /docs/README.md and is blank.

@knownasilya
Copy link
Member

knownasilya commented Nov 1, 2016

Looks to be working fine with your sample repo:
screen shot 2016-11-01 at 12 39 40 pm

Most likely a windows issue.

@cvax
Copy link
Author

cvax commented Nov 1, 2016

Mind if I ask what environment you are using? On my end the left side just says "My project" with nothing underneath.

@knownasilya knownasilya added the bug label Nov 1, 2016
@knownasilya
Copy link
Member

I'm on OSX. I'm going to mark this as a bug.

The issue is probably here https://github.com/docpress/docpress-core/blob/master/lib/tocify.js#L219

knownasilya added a commit to docpress/docpress-core that referenced this issue Nov 1, 2016
@cvax
Copy link
Author

cvax commented Nov 2, 2016

Thanks.

FYI. I just tried this on Windows 10's Linux Subsystem and this is what I got.

cvax@U36SG-DP:/mnt/c/Users/cvax/Desktop/docpresstest$ docpress s
  Docpress
  starting development - ^C to exit

   395ms    first build
    ✓ on    livereload
    ✓ on    http://localhost:3000

            Running
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: watch /mnt/c/Users/cvax/Desktop/docpresstest EPERM
    at exports._errnoException (util.js:1026:11)
    at FSWatcher.start (fs.js:1429:19)
    at Object.fs.watch (fs.js:1456:11)
    at createFsWatchInstance (/mnt/c/Users/cvax/Desktop/docpresstest/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/mnt/c/Users/cvax/Desktop/docpresstest/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/mnt/c/Users/cvax/Desktop/docpresstest/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleDir (/mnt/c/Users/cvax/Desktop/docpresstest/node_modules/chokidar/lib/nodefs-handler.js:407:19)
    at FSWatcher.<anonymous> (/mnt/c/Users/cvax/Desktop/docpresstest/node_modules/chokidar/lib/nodefs-handler.js:455:19)
    at FSWatcher.<anonymous> (/mnt/c/Users/cvax/Desktop/docpresstest/node_modules/chokidar/lib/nodefs-handler.js:460:16)
    at FSReqWrap.oncomplete (fs.js:123:15)

@Kikobeats
Copy link
Contributor

@cvax did you try the current PR that resolve the problem?

@cvax
Copy link
Author

cvax commented Nov 21, 2016

@Kikobeats Sorry, just gave it a shot now. This is what I got with that PR in docpress-core.

 docpress serve

  Docpress
  starting development - ^C to exit

   err ✗    first build
    ✓ on    livereload
    ✓ on    http://localhost:3000

            Running

  ✗ docs\README.md: Unknown reference '../README.md'
    at fix (C:\Users\cvax\AppData\Roaming\nvm\v6.9.1\node_modules\docpress\node_modules\docpress-core\lib\fix_html.js:64:13)
    at Object.<anonymous> (C:\Users\cvax\AppData\Roaming\nvm\v6.9.1\node_modules\docpress\node_modules\docpress-core\lib\fix_html.js:41:29)

    at initialize.exports.each (C:\Users\cvax\AppData\Roaming\nvm\v6.9.1\node_modules\docpress\node_modules\cheerio\lib\api\traversing.js:300:24)
    at fixReferences (C:\Users\cvax\AppData\Roaming\nvm\v6.9.1\node_modules\docpress\node_modules\docpress-core\lib\fix_html.js:39:22)
    at fixHtml (C:\Users\cvax\AppData\Roaming\nvm\v6.9.1\node_modules\docpress\node_modules\docpress-core\lib\fix_html.js:15:3)
    at m (C:\Users\cvax\AppData\Roaming\nvm\v6.9.1\node_modules\docpress\node_modules\docpress-core\lib\index.js:241:7)
    at memoize (C:\Users\cvax\AppData\Roaming\nvm\v6.9.1\node_modules\docpress\node_modules\docpress-core\lib\memoize.js:19:15)
    at each (C:\Users\cvax\AppData\Roaming\nvm\v6.9.1\node_modules\docpress\node_modules\docpress-core\lib\index.js:239:15)
    at C:\Users\cvax\AppData\Roaming\nvm\v6.9.1\node_modules\docpress\node_modules\lodash\_createBaseFor.js:17:11
    at baseForOwn (C:\Users\cvax\AppData\Roaming\nvm\v6.9.1\node_modules\docpress\node_modules\lodash\_baseForOwn.js:13:20)

Without that PR it would build, but no TOC. I tried changing the path, but anything I put in was giving this error.

@knownasilya
Copy link
Member

Looks like a path issue still exists..

@cvax
Copy link
Author

cvax commented Nov 21, 2016

@knownasilya ya, looks like there are still some Windows incompatible pathing coded into fix_html.js. Believe that might be the problem.

@bendulum
Copy link

bendulum commented Dec 5, 2016

Same issue for me, ToC is not created. Using Windows 10.
No errors in the console.
node 7.0.0
npm 3.10.8
docpress 0.7.1

@cvax
Copy link
Author

cvax commented Dec 23, 2016

@knownasilya @Kikobeats just wanted to ask if there was any other info you might need to potentially address this. Thanks.

@Kikobeats
Copy link
Contributor

actually I don't know

@knownasilya
Copy link
Member

I had issues debugging with node debug .., @rstacruz is there a trick to debug?

@rstacruz
Copy link
Contributor

rstacruz commented Dec 23, 2016 via email

@rstacruz
Copy link
Contributor

I think I know what's up here. Docpress keeps a list of files like so:

/* _docpress.json */
{
  sources: {
    'README.md': ...
    'intro/index.md': ...
  }
}

These are generated from docpress-core, and it assumes posix-style /slash/delimited/paths. Unfortunately there are many places that assume this :\

@cvax
Copy link
Author

cvax commented Dec 27, 2016

@rstacruz Running from Win10 Linux Subsystem has the posix paths though. Maybe the issue on that Linux Subsystem is different than the issue on regular Windows.

@jasondavis
Copy link

anyone get this working on windows yet?

@thedaviddias
Copy link

I have the same issue on MAC OSX 10.11.6, Node v7.1.0

@celroid
Copy link

celroid commented Sep 17, 2019

On windows I downloaded the sources of the docpress project itself and when I tried to generate the docs I got the same error.
✗ README.md: Unknown reference 'docs/showcase.md'

@sushanpth
Copy link

sushanpth commented May 10, 2020

I used docpress for https://github.com/namedframework/docs and worked fine from Mac few years back. Working documentation is at https://docs.namedframework.com/

I am trying to update same documentation now on Windows system and TOC is not generating.

OS: Windows 10 (Version 1909)
node: v12.16.3
docpress: v0.8.1

docpress toc issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants