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

Getting error when mkdocs2pandoc > mydocs.pd #12

Open
VinzentE opened this issue Mar 20, 2016 · 7 comments
Open

Getting error when mkdocs2pandoc > mydocs.pd #12

VinzentE opened this issue Mar 20, 2016 · 7 comments

Comments

@VinzentE
Copy link

Hi there,

I just tried to convert my mydocs docu but I am getting these errors:

Traceback (most recent call last):
File "/usr/local/bin/mkdocs2pandoc", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/mkdocs_pandoc/cli/mkdocs2pandoc.py", line 80, in main
for line in pconv.convert():
File "/usr/local/lib/python2.7/site-packages/mkdocs_pandoc/pandoc_converter.py", line 103, in convert
pages = self.flatten_pages(self.config['pages'])
KeyError: 'pages'

Appreciate any help!

thanks

@jgrassler
Copy link
Owner

From the looks of it it shouldn't work with vanilla mkdocs either (since there appears to be no pages data structure). If it does, though, the problem may indeed be with mkdocs-pandoc. Can you share your documentation or a minimum example to reproduce the problem with?

@VinzentE
Copy link
Author

Hi Johannes,

thanks for the reply. I just tried to run it with a brand new "mkdocs new mytest" but still getting the exact same error.
Now sure what exactly I could provide? Pls. guide me and I will send you the info you need.
We could also do a quick call?
Thanks for your efforts
Vinz

@jgrassler
Copy link
Owner

Apparently mkdocs assumes the following entry in your mkdocs.yml if there's no pages data structure:

pages:
  - 'SITENAME': 'index.md'

(with "SITENAME" substituted by the value of site name).

Add these lines and it should work for mkdocs-pandoc as well (I'll try to add similar behaviour to mkdocs-pandoc some time this week).

@VinzentE
Copy link
Author

Great - thanks! I got it to work. But there is on issue:
We have set up the documentation to be in folders and subfolders (= headings and subheadings).
We don't keep track of that in the yaml. Now when I tried the compilation, it only printed the index page - I assume as that was the only one in the yaml file.

Any idea on how I can just print everything in the the (sub)folders as well?

@VinzentE
Copy link
Author

VinzentE commented Jun 8, 2016

Any idea about my last question? As i still can't get it to work ...

Thanks

@nono-gdv
Copy link

nono-gdv commented Jul 12, 2016

I ran into the same issue. You can use the repo at https://github.com/vitusventure/5thSRD (not mine) as a test case. :-) It works as expected with mkdocs, but not with mkdocs2pandocs.

@jgrassler
Copy link
Owner

Sorry, I must have missed the notification about this one :-(

Yes, mkdocs2pandoc relies on the component files being in the YAML file, so you'll have to add them manually or generate it as part of your documentation's build process.

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

3 participants