mkdocs-pandoc icon indicating copy to clipboard operation
mkdocs-pandoc copied to clipboard

Getting error when mkdocs2pandoc > mydocs.pd

Open VinzentE opened this issue 8 years ago • 7 comments

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

VinzentE avatar Mar 20 '16 11:03 VinzentE

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?

jgrassler avatar Mar 21 '16 12:03 jgrassler

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

VinzentE avatar Mar 21 '16 22:03 VinzentE

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).

jgrassler avatar Mar 22 '16 19:03 jgrassler

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 avatar Mar 22 '16 21:03 VinzentE

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

Thanks

VinzentE avatar Jun 08 '16 13:06 VinzentE

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.

nono-gdv avatar Jul 12 '16 16:07 nono-gdv

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.

jgrassler avatar Jul 12 '16 16:07 jgrassler