ford
ford copied to clipboard
Add markdown extensions to project config
Within my docker setup, I get the following error message which is related to the deprecation of extension configurations with the extension name, see https://github.com/mkdocs/mkdocs/issues/1640 and https://python-markdown.github.io/change_log/release-3.0/#extension-configuration-as-part-of-extension-name-deprecated. The issue can be circumvented by returning to markdown 2.6 but the feature was deprecated then already.
Traceback (most recent call last):
File "/usr/local/bin/ford", line 11, in <module>
load_entry_point('FORD==6.0.0', 'console_scripts', 'ford')()
File "/usr/local/lib/python3.5/dist-packages/ford/__init__.py", line 385, in run
proj_data, proj_docs, md = initialize()
File "/usr/local/lib/python3.5/dist-packages/ford/__init__.py", line 141, in initialize
extension_configs={'markdown_include.include': {'base_path': md_base}})
File "/usr/local/lib/python3.5/dist-packages/markdown/core.py", line 100, in __init__
configs=kwargs.get('extension_configs', {}))
File "/usr/local/lib/python3.5/dist-packages/markdown/core.py", line 127, in registerExtensions
ext = self.build_extension(ext, configs.get(ext, {}))
File "/usr/local/lib/python3.5/dist-packages/markdown/core.py", line 168, in build_extension
module = importlib.import_module(ext_name)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'markdown.extensions.toc(anchorlink=True)'
Please find the Dockerfile to reproduce the issue below.
FROM buildbot/buildbot-worker:v1.4.0-py3
USER root
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install -q \
python3-lxml \
graphviz && \
pip3 install ford
WORKDIR /buildbot
USER buildbot
CMD ["/usr/bin/dumb-init", "twistd", "-ny", "buildbot.tac"]
Building the image picked up following versions in my case:
Collecting ford
Downloading https://files.pythonhosted.org/packages/cd/c0/30f1bdcf011f57a3810d252ed06329d0559260bda922dbc63f1932eebaa1/FORD-6.0.0.tar.gz (627kB)
Collecting markdown
Downloading https://files.pythonhosted.org/packages/f5/e4/d8c18f2555add57ff21bf25af36d827145896a07607486cc79a2aea641af/Markdown-3.1-py2.py3-none-any.whl (87kB)
Collecting markdown-include>=0.5.1 (from ford)
Downloading https://files.pythonhosted.org/packages/ef/44/eb6e9b4fa1110b719abb876c9b6dd8b46af886a94536ec4e9117fe5e7b97/markdown-include-0.5.1.tar.gz
Collecting toposort (from ford)
Downloading https://files.pythonhosted.org/packages/e9/8a/321cd8ea5f4a22a06e3ba30ef31ec33bea11a3443eeb1d89807640ee6ed4/toposort-1.5-py2.py3-none-any.whl
Collecting jinja2>=2.1 (from ford)
Downloading https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl (124kB)
Collecting pygments (from ford)
Downloading https://files.pythonhosted.org/packages/13/e5/6d710c9cf96c31ac82657bcfb441df328b22df8564d58d0c4cd62612674c/Pygments-2.3.1-py2.py3-none-any.whl (849kB)
Collecting beautifulsoup4>=4.5.1 (from ford)
Downloading https://files.pythonhosted.org/packages/1d/5d/3260694a59df0ec52f8b4883f5d23b130bc237602a1411fa670eae12351e/beautifulsoup4-4.7.1-py3-none-any.whl (94kB)
Collecting graphviz (from ford)
Downloading https://files.pythonhosted.org/packages/1f/e2/ef2581b5b86625657afd32030f90cf2717456c1d2b711ba074bf007c0f1a/graphviz-0.10.1-py2.py3-none-any.whl
Collecting md-environ (from ford)
Downloading https://files.pythonhosted.org/packages/68/a9/86666edbf0d3929d5b3be3347c153881139aa1e28af38f6496edcc034003/md-environ-0.1.0.tar.gz
Collecting tqdm (from ford)
Downloading https://files.pythonhosted.org/packages/6c/4b/c38b5144cf167c4f52288517436ccafefe9dc01b8d1c190e18a6b154cd4a/tqdm-4.31.1-py2.py3-none-any.whl (48kB)
Collecting setuptools>=36 (from markdown)
Downloading https://files.pythonhosted.org/packages/ec/51/f45cea425fd5cb0b0380f5b0f048ebc1da5b417e48d304838c02d6288a1e/setuptools-41.0.1-py2.py3-none-any.whl (575kB)
Collecting MarkupSafe>=0.23 (from jinja2>=2.1->ford)
Downloading https://files.pythonhosted.org/packages/6e/57/d40124076756c19ff2269678de7ae25a14ebbb3f6314eb5ce9477f191350/MarkupSafe-1.1.1-cp35-cp35m-manylinux1_x86_64.whl
Collecting soupsieve>=1.2 (from beautifulsoup4>=4.5.1->ford)
Downloading https://files.pythonhosted.org/packages/b9/a5/7ea40d0f8676bde6e464a6435a48bc5db09b1a8f4f06d41dd997b8f3c616/soupsieve-1.9.1-py2.py3-none-any.whl
Installing collected packages: setuptools, markdown, markdown-include, toposort, MarkupSafe, jinja2, pygments, soupsieve, beautifulsoup4, graphviz, md-environ, tqdm, ford
Found existing installation: setuptools 20.7.0
Uninstalling setuptools-20.7.0:
Successfully uninstalled setuptools-20.7.0
Running setup.py install for markdown-include: started
Running setup.py install for markdown-include: finished with status 'done'
Found existing installation: beautifulsoup4 4.4.1
Uninstalling beautifulsoup4-4.4.1:
Successfully uninstalled beautifulsoup4-4.4.1
Running setup.py install for md-environ: started
Running setup.py install for md-environ: finished with status 'done'
Running setup.py install for ford: started
Running setup.py install for ford: finished with status 'done'
Successfully installed MarkupSafe-1.1.1 beautifulsoup4-4.7.1 ford-6.0.0 graphviz-0.10.1 jinja2-2.10.1 markdown-3.1 markdown-include-0.5.1 md-environ-0.1.0 pygments-2.3.1 setuptools-41.0.1 soupsieve-1.9.1 toposort-1.5 tqdm-4.31.1
I'm sorry for the issue. I just realized that it came from my project file. So it's rather a question than an issue; is there a possibility to pass markdown extension configurations through the project file?