twardoch / mkdocs-combine

Convert an MkDocs Markdown source site to a single Markdown document
https://twardoch.github.io/mkdocs-combine/
Apache License 2.0
38 stars 17 forks source link

AttributeError: 'module' object has no attribute 'filename_to_title' #21

Open darkleaf opened 5 years ago

darkleaf commented 5 years ago

Hi. I have a error.

pip install git+https://github.com/twardoch/mkdocs-combine.git

mkdocscombine -o mydocs.pd
Traceback (most recent call last):
  File "/usr/local/bin/mkdocscombine", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/mkdocs_combine/cli/mkdocscombine.py", line 160, in main
    mkdocs_combiner.combine()
  File "/usr/local/lib/python2.7/site-packages/mkdocs_combine/mkdocs_combiner.py", line 169, in combine
    pages = self.flatten_pages(self.config[u'nav'])
  File "/usr/local/lib/python2.7/site-packages/mkdocs_combine/mkdocs_combiner.py", line 150, in flatten_pages
    level + 1)
  File "/usr/local/lib/python2.7/site-packages/mkdocs_combine/mkdocs_combiner.py", line 120, in flatten_pages
    u'title': u'%s {: .page-title}' % mkdocs.utils.filename_to_title(page),
AttributeError: 'module' object has no attribute 'filename_to_title'
backports-abc==0.5
Click==7.0
futures==3.2.0
Jinja2==2.10
livereload==2.5.2
Markdown==3.0.1
MarkupSafe==1.0
mkdocs==1.0.4
PyYAML==3.13
singledispatch==3.4.0.3
six==1.11.0
tornado==5.1.1
Ir1d commented 5 years ago

i think you should try python3

darkleaf commented 5 years ago

I move project to sphinx =)

JDDoesDev commented 5 years ago

I'm running into the same issue. It looks like there was a change in Mkdocs that removed this function. https://github.com/mkdocs/mkdocs/commit/5e59af5ca3350fe2a5a555c0777940967a6b9fb4#diff-730512090b1f15175b2e4e521d35b776

Will this be fixed in a near release?

twardoch commented 5 years ago

MkDocs has undergone major changes since I've worked on this tool. My work has been mostly forking the initial mkdocs-pandoc project, subsequent merging of various commits from different other forks, and some minor changes that I needed.

But with the current MkDocs, I believe that the functionality of mkdocs-combine should be completely rewritten in form of an MkDocs plugin. This would have a number of advantages, including the fact that an MkDocs plugin world be more resilient to changes in MkDocs than this current tool is.

I have no plans to update mkdocs-combine but if people contribute pull requests, I'll merge them.