ryneeverett / python-markdown-comments

A Python-Markdown extension to ignore html comments opened by three dashes.
10 stars 6 forks source link

Error when adding to mkdocs 1.1.2 #6

Closed mrmanc closed 4 years ago

mrmanc commented 4 years ago

When I use python-markdown-comments 1.1.0 with mkdocs 1.1.2 I get the following error:

ERROR   -  Config value: 'markdown_extensions'. Error: Failed loading extension "mkdcomments". 

My mkdocs.yml file contains the following to add the extension:

markdown_extensions:
  - mkdcomments

Am I doing something obviously wrong?

ryneeverett commented 4 years ago

Looks correct to me. That error message sure isn't very helpful.

mrmanc commented 4 years ago

Thanks. Are you aware of any way I can get any more info for you?

ryneeverett commented 4 years ago

I'm pretty sure your error is because python-markdown-comments is not installed in an environment accessible to mkdocs. Did you install python-markdown-comments? Can you run pip freeze to confirm that python-markdown-comments and mkdocs are both installed?

mrmanc commented 4 years ago

Thanks. I was installing python-markdown-comments using pip and a requirements.txt file. I’m building within a container, but I’ve added pip freeze to the Dockerfile and I get the following output, which seems to indicate both are installed.

Step 14/16 : RUN pip3 freeze
 ---> Running in 9fa5e4ed23e2
attrs==19.3.0
Babel==2.8.0
CacheControl==0.12.6
cachy==0.3.0
certifi==2020.4.5.1
cffi==1.14.0
chardet==3.0.4
cleo==0.7.6
click==7.1.1
clikit==0.4.3
cryptography==2.9
fontawesome-markdown==0.2.6
future==0.18.2
gitdb==4.0.5
GitPython==3.1.7
html5lib==1.0.1
idna==2.9
importlib-metadata==1.1.3
jeepney==0.4.3
Jinja2==2.11.2
joblib==0.16.0
jsonschema==3.2.0
keyring==20.0.1
livereload==2.6.2
lockfile==0.12.2
lunr==0.5.8
Markdown==3.2.2
MarkupSafe==1.1.1
mkdocs==1.1.2
mkdocs-awesome-pages-plugin==2.2.1
mkdocs-git-revision-date-localized-plugin==0.5.0
mkdocs-material==5.2.0
mkdocs-material-extensions==1.0
mkdocs-redirects==1.0.1
msgpack==1.0.0
nltk==3.5
pastel==0.2.0
pexpect==4.8.0
pkginfo==1.5.0.1
poetry==1.0.5
ptyprocess==0.6.0
pycparser==2.20
Pygments==2.6.1
pylev==1.3.0
pymdown-extensions==7.0
pyparsing==2.4.7
pyrsistent==0.14.11
python-markdown-comments==1.1.0
pytz==2020.1
PyYAML==5.3.1
regex==2020.7.14
requests==2.23.0
requests-toolbelt==0.8.0
SecretStorage==3.1.2
shellingham==1.3.2
six==1.14.0
smmap==3.0.4
tomlkit==0.5.11
tornado==6.0.4
tqdm==4.48.0
urllib3==1.25.9
webencodings==0.5.1
zipp==3.1.0
Removing intermediate container 9fa5e4ed23e2
 ---> c97f794643d7
Step 15/16 : RUN python3 -m mkdocs build --strict
 ---> Running in 2669e01897c9
ERROR   -  Config value: 'markdown_extensions'. Error: Failed loading extension "mkdcomments". 
ryneeverett commented 4 years ago

Ah, it appears that you've installed python-markdown-comments from pypi rather than from this git repository. I'm not the maintainer of the fork from which that package was published.

mrmanc commented 3 years ago

For people like me in the future… I got this working by using the below line in requirements.txt to install the correct dependency:

git+https://github.com/ryneeverett/python-markdown-comments.git@aa82610#egg=python-markdown-comments