cheshire-cat-ai / docs

Documentation for the Cheshire Cat AI
https://cheshire-cat-ai.github.io/docs/
33 stars 28 forks source link

Error reading page 'quickstart/writing-tool.md': Document is empty #112

Closed Tudor44 closed 8 months ago

Tudor44 commented 8 months ago

Hello,

I notify this error on building locally the repo using the command mkdocs build

nicola-corbellini commented 8 months ago

Hi, have tried using mkdocs serve?

Tudor44 commented 8 months ago

Hi, have tried using mkdocs serve?

Yes same error using main branch.

nicola-corbellini commented 8 months ago

@Tudor44 I tried to reproduce the error, but both build and serve work. Inspect the logs in the terminal, mkdocs should tell you which file is empty and its path. Otherwise, share the full error trace here please. Maybe you forgot some empty file somewhere..?

Tudor44 commented 8 months ago

@Tudor44 I tried to reproduce the error, but both build and serve work. Inspect the logs in the terminal, mkdocs should tell you which file is empty and its path. Otherwise, share the full error trace here please. Maybe you forgot some empty file somewhere..?

Thank for reply @nicola-corbellini . Here the stacktrace. I have just forked the repo.

pip 21.2.4

Python 3.9.6 (default, Aug 11 2023, 19:44:49) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin

ERROR - Error reading page 'quickstart/writing-tool.md': Document is empty Traceback (most recent call last): File "/Users/gdorsi/Desktop/docs-cat/env/bin/mkdocs", line 8, in <module> sys.exit(cli()) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/mkdocs/__main__.py", line 286, in build_command build.build(cfg, dirty=not clean) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/mkdocs/commands/build.py", line 322, in build _populate_page(file.page, config, files, dirty) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/mkdocs/commands/build.py", line 179, in _populate_page page.content = config.plugins.on_page_content( File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/mkdocs/plugins.py", line 578, in on_page_content return self.run_event('page_content', html, page=page, config=config, files=files) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/mkdocs/plugins.py", line 507, in run_event result = method(item, **kwargs) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/mkdocs_video/plugin.py", line 28, in on_page_content content = lxml.html.fromstring(html) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/lxml/html/__init__.py", line 873, in fromstring doc = document_fromstring(html, parser=parser, base_url=base_url, **kw) File "/Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/lxml/html/__init__.py", line 761, in document_fromstring raise etree.ParserError( lxml.etree.ParserError: Document is empty

Screenshot 2023-12-29 alle 09 38 41

Screenshot 2023-12-29 alle 09 50 05

kodaline commented 8 months ago

@Tudor44 can you tell us how did you installed mkdocs? Can you explain the steps you made after forking the repo? Also, what is your OS?

Tudor44 commented 8 months ago

@Tudor44 can you tell us how did you installed mkdocs? Can you explain the steps you made after forking the repo? Also, what is your OS?

Hello @kodaline here your informations:

MKDOCS version line: mkdocs, version 1.5.3 from /Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/mkdocs (Python 3.9)

OS: I use macOS 14.1.2.

PROCEDURE: I cloned the main branch and installed dependencies with venv environment using pip manager. pip install -r requirements.txt

nicola-corbellini commented 8 months ago

@Tudor44 do you have any chance to test it on a different OS to see if it's a document encoding problem?

kodaline commented 8 months ago

@Tudor44 can you tell us how did you installed mkdocs? Can you explain the steps you made after forking the repo? Also, what is your OS?

Hello @kodaline here your informations:

MKDOCS version line: mkdocs, version 1.5.3 from /Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/mkdocs (Python 3.9)

can you give your output of the command pip3 freeze | grep mkdocs ?

OS: I use macOS 14.1.2.

ah linux is the solution 😛

Tudor44 commented 8 months ago

@Tudor44 can you tell us how did you installed mkdocs? Can you explain the steps you made after forking the repo? Also, what is your OS?

Hello @kodaline here your informations: MKDOCS version line: mkdocs, version 1.5.3 from /Users/gdorsi/Desktop/docs-cat/env/lib/python3.9/site-packages/mkdocs (Python 3.9)

can you give your output of the command pip3 freeze | grep mkdocs ?

mkdocs==1.5.3
mkdocs-autorefs==0.5.0
mkdocs-gen-files==0.5.0
mkdocs-literate-nav==0.6.1
mkdocs-material==9.5.3
mkdocs-material-extensions==1.3.1
mkdocs-section-index==0.3.8
mkdocs-video==1.5.0
mkdocstrings==0.24.0
mkdocstrings-python==1.7.5

OS: I use macOS 14.1.2.

ah linux is the solution 😛

ahahah , I m also a Mac/Apple fan. But I ll test, as soon, with another laptop with Windows, or later Ubuntu. Thanks!

kodaline commented 8 months ago

@Tudor44 just for curiosity, can you remove the emoji in that file that gives the error and try again?

Tudor44 commented 8 months ago

@Tudor44 just for curiosity, can you remove the emoji in that file that gives the error and try again?

I have tried again with MacOS and you won't believe, but it works with this modification. Time to open an issue to mkdocs project then Xd Thanks for the intuition.

kodaline commented 8 months ago

@Tudor44 just for curiosity, can you remove the emoji in that file that gives the error and try again?

I have tried again with MacOS and you won't believe, but it works with this modification. Time to open an issue to mkdocs project then Xd Thanks for the intuition.

you are welcome, there is some issue in the parser I guess, in lxml, when dealing with emojis

@nicola-corbellini I guess we can close this issue, maybe we can put somewhere a note about it for macos users

nicola-corbellini commented 8 months ago

Actually this is a known issue we had previously. The emoji should be replaced with its html code. I'm opening an issue asap, if no one can before

Tudor44 commented 8 months ago

I have prepared a draft. I fixed and tested writing-tool.md and works fine.

nicola-corbellini commented 8 months ago

Indeed, no need for a new issue. This one is the issue :rofl: Thank you! Can I set it ready to be merged?

Tudor44 commented 8 months ago

Indeed, no need for a new issue. This one is the issue 🤣 Thank you! Can I set it ready to be merged?

I have set it ready to merge. I have finished the check, and only the emoji in writing-tool seems with no code entity.

nicola-corbellini commented 8 months ago

@Tudor44 awesome, thank you very much