mosra / m.css

A no-nonsense, no-JavaScript CSS framework, site and documentation theme for content-oriented websites
https://mcss.mosra.cz
Other
406 stars 92 forks source link

error: AttributeError: 'SaneHtmlTranslator' object has no attribute 'object_image_types' #202

Closed fnrizzi closed 2 years ago

fnrizzi commented 3 years ago

hello, I am trying to use m.css to build a website inside a docker container. I have been using my mac to build so far, and everything worked fine, but inside the docker something is not working related to figures. I have python3.7.9 and these packages:

pelican==4.2.0
jinja2
Pyphen==0.9.5
Pillow 
matplotlib==3.3.4
attrs==19.3.0

I get this error:

root@300cbf1680a8:/mysite# pelican -D --ignore-cache -o ./docs -s pelicanconf.py
DEBUG: Pelican version: 4.2.0
DEBUG: Python version: 3.7.9
WARNING: LaTeX not found, fallback to rendering math as code
DEBUG: Adding current directory to system path
DEBUG: Temporarily adding PLUGIN_PATHS to system path
DEBUG: Loading plugin `m.abbr`
DEBUG: Registering plugin `m.abbr`
DEBUG: Loading plugin `m.alias`
DEBUG: Registering plugin `m.alias`
DEBUG: Loading plugin `m.code`
DEBUG: Registering plugin `m.code`
DEBUG: Loading plugin `m.components`
DEBUG: Registering plugin `m.components`
DEBUG: Loading plugin `m.dot`
DEBUG: Registering plugin `m.dot`
DEBUG: Loading plugin `m.dox`
DEBUG: Registering plugin `m.dox`
DEBUG: Loading plugin `m.filesize`
DEBUG: Registering plugin `m.filesize`
DEBUG: Loading plugin `m.gh`
DEBUG: Registering plugin `m.gh`
DEBUG: Loading plugin `m.gl`
DEBUG: Registering plugin `m.gl`
DEBUG: Loading plugin `m.htmlsanity`
DEBUG: Registering plugin `m.htmlsanity`
DEBUG: Loading plugin `m.images`
DEBUG: Registering plugin `m.images`
DEBUG: Loading plugin `m.link`
DEBUG: Registering plugin `m.link`
DEBUG: Loading plugin `m.math`
DEBUG: Registering plugin `m.math`
DEBUG: Loading plugin `m.metadata`
DEBUG: Registering plugin `m.metadata`
DEBUG: Loading plugin `m.sphinx`
DEBUG: Registering plugin `m.sphinx`
DEBUG: Loading plugin `m.vk`
DEBUG: Registering plugin `m.vk`
DEBUG: Restoring system path
DEBUG: Missing dependencies for md, markdown, mkd, mdown
DEBUG: Found generator: <class 'm.alias.AliasGenerator'>
DEBUG: Template list: ['!simple/archives.html', '!simple/article.html', '!simple/author.html', '!simple/authors.html', '!simple/base.html', '!simple/categories.html', '!simple/category.html', '!simple/gosquared.html', '!simple/index.html', '!simple/page.html', '!simple/pagination.html', '!simple/period_archives.html', '!simple/tag.html', '!simple/tags.html', '!simple/translations.html', '!theme/archives.html', '!theme/article.html', '!theme/article_badges.html', '!theme/article_footer.html', '!theme/article_header.html', '!theme/author.html', '!theme/base.html', '!theme/base_blog.html', '!theme/base_blog_section.html', '!theme/category.html', '!theme/index.html', '!theme/page.html', '!theme/pagination.html', '!theme/passthrough.html', '!theme/tag.html', 'archives.html', 'article.html', 'article_badges.html', 'article_footer.html', 'article_header.html', 'author.html', 'authors.html', 'base.html', 'base_blog.html', 'base_blog_section.html', 'categories.html', 'category.html', 'gosquared.html', 'index.html', 'page.html', 'pagination.html', 'passthrough.html', 'period_archives.html', 'tag.html', 'tags.html', 'translations.html']
DEBUG: Read file blog/announcements/2021.06.rst -> Article
DEBUG: Signal article_generator_preread.send(ArticlesGenerator)
DEBUG: Signal article_generator_context.send(ArticlesGenerator, <metadata>)
DEBUG: Read file contact.rst -> Article
ERROR: Skipping /mysite/content/contact.rst: could not find information about 'date'
DEBUG: Read file index.rst -> Article
ERROR: Skipping /mysite/content/index.rst: could not find information about 'date'
DEBUG: Read file algos/hyper.rst -> Article
ERROR: Skipping /mysite/content/algos/hyper.rst: could not find information about 'date'
DEBUG: Read file algos/roms.rst -> Article
ERROR: Could not process algos/roms.rst
  | AttributeError: 'SaneHtmlTranslator' object has no attribute 'object_image_types'
  |___
  | Traceback (most recent call last):
  |   File "/usr/local/lib/python3.7/site-packages/pelican/generators.py", line 624, in generate_context
  |     context_sender=self)
  |   File "/usr/local/lib/python3.7/site-packages/pelican/readers.py", line 594, in read_file
  |     content, reader_metadata = reader.read(path)
  |   File "/usr/local/lib/python3.7/site-packages/pelican/readers.py", line 289, in read
  |     pub = self._get_publisher(source_path)
  |   File "/usr/local/lib/python3.7/site-packages/pelican/readers.py", line 284, in _get_publisher
  |     pub.publish()
  |   File "/usr/local/lib/python3.7/site-packages/docutils/core.py", line 220, in publish
  |     output = self.writer.write(self.document, self.destination)
  |   File "/usr/local/lib/python3.7/site-packages/docutils/writers/__init__.py", line 78, in write
  |     self.translate()
  |   File "/usr/local/lib/python3.7/site-packages/docutils/writers/_html_base.py", line 80, in translate
  |     self.document.walkabout(visitor)
  |   File "/usr/local/lib/python3.7/site-packages/docutils/nodes.py", line 227, in walkabout
  |     if child.walkabout(visitor):
  |   File "/usr/local/lib/python3.7/site-packages/docutils/nodes.py", line 227, in walkabout
  |     if child.walkabout(visitor):
  |   File "/usr/local/lib/python3.7/site-packages/docutils/nodes.py", line 227, in walkabout
  |     if child.walkabout(visitor):
  |   File "/usr/local/lib/python3.7/site-packages/docutils/nodes.py", line 219, in walkabout
  |     visitor.dispatch_visit(self)
  |   File "/usr/local/lib/python3.7/site-packages/docutils/nodes.py", line 2021, in dispatch_visit
  |     return method(node)
  |   File "/mysite/m.css/plugins/m/htmlsanity.py", line 295, in visit_image
  |     if ext in self.object_image_types:
  | AttributeError: 'SaneHtmlTranslator' object has no attribute 'object_image_types'
DEBUG: Read file algos/lspg.rst -> Article
ERROR: Skipping /mysite/content/algos/lspg.rst: could not find information about 'date'
DEBUG: Read file algos/wls.rst -> Article
ERROR: Skipping /mysite/content/algos/wls.rst: could not find information about 'date'
DEBUG: Read file overview/design.rst -> Article
ERROR: Skipping /mysite/content/overview/design.rst: could not find information about 'date'
DEBUG: Read file overview/proms.rst -> Article
ERROR: Skipping /mysite/content/overview/proms.rst: could not find information about 'date'
DEBUG: Read file algos.rst -> Article
DEBUG: Read file blog/authors/francesco-rizzi.rst -> Article
ERROR: Skipping /mysite/content/blog/authors/francesco-rizzi.rst: could not find information about 'date'
DEBUG: Read file various/license.rst -> Article
ERROR: Skipping /mysite/content/various/license.rst: could not find information about 'date'
DEBUG: Read file various.rst -> Article
ERROR: Skipping /mysite/content/various.rst: could not find information about 'date'
DEBUG: Read file overview.rst -> Article
ERROR: Skipping /mysite/content/overview.rst: could not find information about 'date'
DEBUG: Read file blog/announcements/2021.06.rst -> Page
DEBUG: Signal page_generator_preread.send(PagesGenerator)
DEBUG: Signal page_generator_context.send(PagesGenerator, <metadata>)
DEBUG: Read file contact.rst -> Page
DEBUG: Read file index.rst -> Page
DEBUG: Read file algos/hyper.rst -> Page
DEBUG: Read file algos/roms.rst -> Page
ERROR: Could not process algos/roms.rst
  | AttributeError: 'SaneHtmlTranslator' object has no attribute 'object_image_types'
  |___
  | Traceback (most recent call last):
  |   File "/usr/local/lib/python3.7/site-packages/pelican/generators.py", line 729, in generate_context
  |     context_sender=self)
  |   File "/usr/local/lib/python3.7/site-packages/pelican/readers.py", line 594, in read_file
  |     content, reader_metadata = reader.read(path)
  |   File "/usr/local/lib/python3.7/site-packages/pelican/readers.py", line 289, in read
  |     pub = self._get_publisher(source_path)
  |   File "/usr/local/lib/python3.7/site-packages/pelican/readers.py", line 284, in _get_publisher
  |     pub.publish()
  |   File "/usr/local/lib/python3.7/site-packages/docutils/core.py", line 220, in publish
  |     output = self.writer.write(self.document, self.destination)
  |   File "/usr/local/lib/python3.7/site-packages/docutils/writers/__init__.py", line 78, in write
  |     self.translate()
  |   File "/usr/local/lib/python3.7/site-packages/docutils/writers/_html_base.py", line 80, in translate
  |     self.document.walkabout(visitor)
  |   File "/usr/local/lib/python3.7/site-packages/docutils/nodes.py", line 227, in walkabout
  |     if child.walkabout(visitor):
  |   File "/usr/local/lib/python3.7/site-packages/docutils/nodes.py", line 227, in walkabout
  |     if child.walkabout(visitor):
  |   File "/usr/local/lib/python3.7/site-packages/docutils/nodes.py", line 227, in walkabout
  |     if child.walkabout(visitor):
  |   File "/usr/local/lib/python3.7/site-packages/docutils/nodes.py", line 219, in walkabout
  |     visitor.dispatch_visit(self)
  |   File "/usr/local/lib/python3.7/site-packages/docutils/nodes.py", line 2021, in dispatch_visit
  |     return method(node)
  |   File "/mysite/m.css/plugins/m/htmlsanity.py", line 295, in visit_image
  |     if ext in self.object_image_types:
  | AttributeError: 'SaneHtmlTranslator' object has no attribute 'object_image_types'
DEBUG: Read file algos/lspg.rst -> Page
DEBUG: Read file algos/wls.rst -> Page
DEBUG: Read file overview/design.rst -> Page
DEBUG: Read file overview/proms.rst -> Page
DEBUG: Read file algos.rst -> Page
DEBUG: Read file blog/authors/francesco-rizzi.rst -> Page
DEBUG: Read file various/license.rst -> Page
DEBUG: Read file various.rst -> Page
DEBUG: Read file overview.rst -> Page
DEBUG: Read file img/pressio_stack_tex/schem.tex -> Static
DEBUG: Signal static_generator_preread.send(StaticGenerator)
DEBUG: Signal static_generator_context.send(StaticGenerator, <metadata>)
DEBUG: Read file img/329313.jpg -> Static
DEBUG: Read file img/pressiologo.png -> Static
DEBUG: Read file img/pressio_stack_tex/schem.aux -> Static
DEBUG: Read file img/top3.jpg -> Static
DEBUG: Read file img/1116905.jpg -> Static
DEBUG: Read file img/pressio_stack_tex/schem.svg -> Static
DEBUG: Read file img/top1.jpg -> Static
DEBUG: Read file img/383967.jpg -> Static
DEBUG: Read file img/schem.svg -> Static
DEBUG: Read file img/b1.jpg -> Static
DEBUG: Read file img/.DS_Store -> Static
DEBUG: Read file img/favicon.ico -> Static
DEBUG: Read file img/top2.png -> Static
DEBUG: Read file img/plogo.png -> Static
DEBUG: Read file img/pressio_stack_tex/schem.log -> Static
DEBUG: Read file img/pressio_stack_tex/schem.pdf -> Static
DEBUG: Read file img/authors/francesco-rizzi.jpeg -> Static
-> Writing /mysite/docs/algos.html
-> Writing /mysite/docs/announcements/2021.06.html
-> Writing /mysite/docs/archives/index.html
-> Writing /mysite/docs/tag/c/index.html
-> Writing /mysite/docs/tag/euler/index.html
-> Writing /mysite/docs/tag/weno/index.html
-> Writing /mysite/docs/tag/python/index.html
-> Writing /mysite/docs/category/announcements/index.html
-> Writing /mysite/docs/category/misc/index.html
-> Writing /mysite/docs/author/francesco-rizzi/index.html
-> Writing /mysite/docs/announcements/2021.06/index.html
-> Writing /mysite/docs/algos/index.html
-> Writing /mysite/docs/contact/index.html
-> Writing /mysite/docs/overview/design/index.html
-> Writing /mysite/docs/authors/francesco-rizzi/index.html
-> Writing /mysite/docs/algos/hyper/index.html
-> Writing /mysite/docs/index.html
-> Writing /mysite/docs/various/license/index.html
-> Writing /mysite/docs/algos/lspg/index.html
-> Writing /mysite/docs/overview/index.html
-> Writing /mysite/docs/overview/proms/index.html
-> Writing /mysite/docs/various/index.html
-> Writing /mysite/docs/algos/wls/index.html
-> Copying /mysite/m.css/pelican-theme/static/pygments-console.css to /mysite/docs/static/./pygments-console.css
-> Copying /mysite/m.css/pelican-theme/static/m-theme-dark.css to /mysite/docs/static/./m-theme-dark.css
-> Copying /mysite/m.css/pelican-theme/static/m-debug.css to /mysite/docs/static/./m-debug.css
-> Copying /mysite/m.css/pelican-theme/static/m-layout.css to /mysite/docs/static/./m-layout.css
-> Copying /mysite/m.css/pelican-theme/static/m-theme-light.css to /mysite/docs/static/./m-theme-light.css
-> Copying /mysite/m.css/pelican-theme/static/m-light.css to /mysite/docs/static/./m-light.css
-> Copying /mysite/m.css/pelican-theme/static/pygments-dark.css to /mysite/docs/static/./pygments-dark.css
-> Copying /mysite/m.css/pelican-theme/static/m-dark.compiled.css to /mysite/docs/static/./m-dark.compiled.css
-> Copying /mysite/m.css/pelican-theme/static/m-light.compiled.css to /mysite/docs/static/./m-light.compiled.css
-> Copying /mysite/m.css/pelican-theme/static/m-grid.css to /mysite/docs/static/./m-grid.css
-> Copying /mysite/m.css/pelican-theme/static/m-components.css to /mysite/docs/static/./m-components.css
-> Copying /mysite/m.css/pelican-theme/static/m-dark.css to /mysite/docs/static/./m-dark.css
-> Copying /mysite/content/img/pressio_stack_tex/schem.tex to /mysite/docs/static/img/pressio_stack_tex/schem.tex
-> Copying /mysite/content/img/pressio_stack_tex/schem.tex to static/img/pressio_stack_tex/schem.tex
-> Copying /mysite/content/img/329313.jpg to /mysite/docs/static/img/329313.jpg
-> Copying /mysite/content/img/329313.jpg to static/img/329313.jpg
-> Copying /mysite/content/img/pressiologo.png to /mysite/docs/static/img/pressiologo.png
-> Copying /mysite/content/img/pressiologo.png to static/img/pressiologo.png
-> Copying /mysite/content/img/pressio_stack_tex/schem.aux to /mysite/docs/static/img/pressio_stack_tex/schem.aux
-> Copying /mysite/content/img/pressio_stack_tex/schem.aux to static/img/pressio_stack_tex/schem.aux
-> Copying /mysite/content/img/top3.jpg to /mysite/docs/static/img/top3.jpg
-> Copying /mysite/content/img/top3.jpg to static/img/top3.jpg
-> Copying /mysite/content/img/1116905.jpg to /mysite/docs/static/img/1116905.jpg
-> Copying /mysite/content/img/1116905.jpg to static/img/1116905.jpg
-> Copying /mysite/content/img/pressio_stack_tex/schem.svg to /mysite/docs/static/img/pressio_stack_tex/schem.svg
-> Copying /mysite/content/img/pressio_stack_tex/schem.svg to static/img/pressio_stack_tex/schem.svg
-> Copying /mysite/content/img/top1.jpg to /mysite/docs/static/img/top1.jpg
-> Copying /mysite/content/img/top1.jpg to static/img/top1.jpg
-> Copying /mysite/content/img/383967.jpg to /mysite/docs/static/img/383967.jpg
-> Copying /mysite/content/img/383967.jpg to static/img/383967.jpg
-> Copying /mysite/content/img/schem.svg to /mysite/docs/static/img/schem.svg
-> Copying /mysite/content/img/schem.svg to static/img/schem.svg
-> Copying /mysite/content/img/b1.jpg to /mysite/docs/static/img/b1.jpg
-> Copying /mysite/content/img/b1.jpg to static/img/b1.jpg
-> Copying /mysite/content/img/.DS_Store to /mysite/docs/static/img/.DS_Store
-> Copying /mysite/content/img/.DS_Store to static/img/.DS_Store
-> Copying /mysite/content/img/favicon.ico to /mysite/docs/favicon.ico
-> Copying /mysite/content/img/favicon.ico to static/../favicon.ico
-> Copying /mysite/content/img/top2.png to /mysite/docs/static/img/top2.png
-> Copying /mysite/content/img/top2.png to static/img/top2.png
-> Copying /mysite/content/img/plogo.png to /mysite/docs/static/img/plogo.png
-> Copying /mysite/content/img/plogo.png to static/img/plogo.png
-> Copying /mysite/content/img/pressio_stack_tex/schem.log to /mysite/docs/static/img/pressio_stack_tex/schem.log
-> Copying /mysite/content/img/pressio_stack_tex/schem.log to static/img/pressio_stack_tex/schem.log
-> Copying /mysite/content/img/pressio_stack_tex/schem.pdf to /mysite/docs/static/img/pressio_stack_tex/schem.pdf
-> Copying /mysite/content/img/pressio_stack_tex/schem.pdf to static/img/pressio_stack_tex/schem.pdf
-> Copying /mysite/content/img/authors/francesco-rizzi.jpeg to /mysite/docs/static/img/authors/francesco-rizzi.jpeg
-> Copying /mysite/content/img/authors/francesco-rizzi.jpeg to static/img/authors/francesco-rizzi.jpeg
Done: Processed 2 articles, 0 drafts, 13 pages, 0 hidden pages and 0 draft pages in 0.91 seconds.
root@300cbf1680a8:/mysite#

Thanks for the help !

fnrizzi commented 3 years ago

after some exploring, I figured out it was due to docutils missing. (unless I missed it), I think it would be helpful to list on the website the minimum set of packages needed.

mosra commented 2 years ago

(Sorry for very late replies, finally got a chance to get back to this project.)

This particular issue had been fixed with f9ec8ea832313d37789ed078f5def98908b4be08 (Apr 2021) already, so I guess the underlying problem on your side was not due to docutils missing but rather docutils installed but your copy of m.css not being compatible with that version of docutils yet.

There's now another problem that current version of m.css doesn't work with docutils 0.18. I'll resolve that separately.