Skip to content
/ mkdocs Public
  • Sponsor
  • Notifications You must be signed in to change notification settings
  • Fork 2.5k
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

breakage in toc; and doesn't report which file is bad #146

Closed
sandover opened this issue Oct 8, 2014 · 3 comments
Closed

breakage in toc; and doesn't report which file is bad #146

sandover opened this issue Oct 8, 2014 · 3 comments

Comments

@sandover
Copy link

sandover commented Oct 8, 2014

Traceback (most recent call last):
  File "/usr/local/bin/mkdocs", line 46, in <module>
    main(cmd, args=sys.argv[2:], options=dict(opts))
  File "/usr/local/bin/mkdocs", line 29, in main
    serve(config, options=options)
  File "/usr/local/lib/python2.7/site-packages/mkdocs/serve.py", line 81, in serve
    build(config, live_server=True)
  File "/usr/local/lib/python2.7/site-packages/mkdocs/build.py", line 179, in build
    build_pages(config)
  File "/usr/local/lib/python2.7/site-packages/mkdocs/build.py", line 149, in build_pages
    html_content, table_of_contents, meta = convert_markdown(input_content)
  File "/usr/local/lib/python2.7/site-packages/mkdocs/build.py", line 64, in convert_markdown
    table_of_contents = toc.TableOfContents(toc_html)
  File "/usr/local/lib/python2.7/site-packages/mkdocs/toc.py", line 45, in __init__
    self.items = _parse_html_table_of_contents(html)
  File "/usr/local/lib/python2.7/site-packages/mkdocs/toc.py", line 98, in _parse_html_table_of_contents
    parents.pop()
IndexError: pop from empty list

I'd love to provide more detail than this spew, but:

I'm trying to convert an existing (doxygen) documentation set to mkdocs, incrementally, but I've found that mkdocs forces you to include in the document set every document which is linked to by any document -- if there is a single dead link, mkdocs won't build or serve. (Is there a command line flag to turn this strictness off?)

It worked for one file, and now I've added every file, and it's broken. Is there another way to debug? I can't take suspect file(s) out, because then whole docset won't build.

@d0ugal
Copy link
Member

d0ugal commented Oct 8, 2014

Looks like you ran into a bug. I had a quick look and the fix looked simple, so I think f2bee58 will fix it for you. Can you try again against git master?

With regards to turning off link checking, there isn't currently a way to disable it.. However, I think that seems like a reasoble improvement to make if you are interested in giving it a go.

@sandover
Copy link
Author

sandover commented Oct 8, 2014

I'm happy to try git master but not accustomed to Python and I don't see a BUILDING.md or similar file in the repo about how to work from the source tree. (I had done pip install.) Can you advise?

I am in very early evaluation stage on the project, just trying to see if it will work for our needs, so I can't yet commit to patches, but if you can help me get going with the source, I might just start hacking.

Update: I did python setup.py install and it installed fine. The table of contents bug looks fixed. I also temporarily commented out the assert False line you pointed me to and it's helping me out. Thanks!

@d0ugal
Copy link
Member

d0ugal commented Oct 8, 2014

Awesome, Thanks! For future reference, this is an easy way to do it too.

pip install -e git+https://github.com/tomchristie/mkdocs.git#egg=mkdocs

(of course, usual disclaimer about master not neccesarily being stable etc.)

I've opened #150 to track the disabling of the link tracking. If you are happy with the other issue is fixed can you close this one?

As a new user, any other feedback would be great in issues! Thanks :)

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

No branches or pull requests

2 participants