Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadtheDocs cannot parse tables in markdown #4466

Closed
wilsonyou opened this issue Aug 3, 2018 · 26 comments
Closed

ReadtheDocs cannot parse tables in markdown #4466

wilsonyou opened this issue Aug 3, 2018 · 26 comments
Labels
Support Support question

Comments

@wilsonyou
Copy link

wilsonyou commented Aug 3, 2018

Details

I build my file from github to readthedocs but found the tables in markdown files cannot be parsed.

Could you please give an effective way to solve the issue.

This is my project address:
https://github.com/wilsonyou/hopeone

this is location for the build

https://hopeone.readthedocs.io/en/latest/generating-addresses.html

If you can provide an easy-to-understand method to solve this problem, I would really appreciate.

@stsewd stsewd added the Support Support question label Aug 3, 2018
@stsewd
Copy link
Member

stsewd commented Aug 3, 2018

This is a problem with sphinx and markdown file, here you can see some solutions readthedocs/recommonmark#3 readthedocs/recommonmark#103, or maybe you can consider writing your docs using reStructuredText.

@stsewd stsewd closed this as completed Aug 3, 2018
@wilsonyou
Copy link
Author

Thank you for you suggestions. But I cannot get the issue solved.

I don't know what files are needed or how to configure the Admin in ReadtheDocS.

Some says that the setup.py is needed or the requirements.txt is needed. I am not sure how to handle this.

Could you help me on this ?

Thanks

@wilsonyou
Copy link
Author

@stsewd
Thank you for you suggestions. But I cannot get the issue solved.

I don't know what files are needed or how to configure the Admin in ReadtheDocS.

Some says that the setup.py is needed or the requirements.txt is needed. I am not sure how to handle this.

Could you help me on this ?

Thanks

@stsewd
Copy link
Member

stsewd commented Aug 6, 2018

You can use the admin interface of your project to specify a requirements.txt file or use a yaml file https://docs.readthedocs.io/en/latest/yaml-config.html#requirements-file

@wilsonyou
Copy link
Author

@stsewd

Thank you for your quick turnaround.

But I still cannot solve my issue.

The major issue is that I have many tables in md files, but these tables cannot be parsed. If you could give me a real example about what files are needed and how to configure these file, then I think I can figure out.

Thanks

@stsewd
Copy link
Member

stsewd commented Aug 6, 2018

In the related issue, there is a suggestion about using https://github.com/ryanfox/sphinx-markdown-tables, you may want to read those instructions

@wilsonyou
Copy link
Author

@ I have read these instructions and did as the guide told. But the tables are still not parsed
Could you check my projects?
https://hopeone.readthedocs.io/en/latest/generating-addresses.html
Thanks

@wilsonyou
Copy link
Author

@stsewd
I have read these instructions and did as the guide told. But the tables are still not parsed
Could you check my project?
https://hopeone.readthedocs.io/en/latest/generating-addresses.html

Thanks

@stsewd
Copy link
Member

stsewd commented Aug 6, 2018

I think you need to add a requirements.txt on your project with sphinx-markdown-tables as requirement.

@stsewd
Copy link
Member

stsewd commented Aug 6, 2018

@wilsonyou
Copy link
Author

@stsewd
Yes, I think you are right. A requirement.txt is needed. But I don't know how to configure the requirement.txt even I read the link you provided.

Could you please check my project and provide a reqirement.txt which is configured and ready to use?

Thank you for your support.

@wilsonyou
Copy link
Author

@stsewd
If you could provide that requirement.txt file. Please send it to me
Email: [email protected]
BTW, I think readthedocs is a great website to host documentation but if table conversion is not supported, I would feel really disappointed.

@wilsonyou
Copy link
Author

I read your documentation on the website. It seems that the backend will read the conf.py file by default. But in this way, the table conversion is not supported. So, I tried to configure the Advanced Setting, but got stuck in it. In Advanced Setting, when I clikc the option 'Install your project inside a virtualenv using setup.py install', I have to input the requirement.txt file below the option.
But now, I don't know how to configure the setup.py and requirement.txt files.

@stsewd
Copy link
Member

stsewd commented Aug 7, 2018

You need to create a requirements.txt file with this content

sphinx-markdown-tables

The link to the docs explains how to setup rtd to use the requirements.txt file.

BTW, I think readthedocs is a great website to host documentation but if table conversion is not supported, I would feel really disappointed.

I think that is a problem with the sphinx extension that does the markdown supports, sphinx is mainly focused in reStructuredText, you also have mkdocs, which does support markdown.

BTW, your setup.py file doesn't seem to be right https://github.com/wilsonyou/hopeone/blob/master/setup.py. I'd recommend you to read a little about python packaging here https://packaging.python.org/guides/

@wilsonyou
Copy link
Author

@stsewd
Thank you for your suggestion. But I have little programming experience, and I don't know how to get started with your suggested link. Could you help on how to configure my setup.py?

@stsewd
Copy link
Member

stsewd commented Aug 8, 2018

I think you may not need a conf.py file, can you try having only the requirements.txt file?

@wilsonyou
Copy link
Author

I just now tried to input the requirements.txt file without selecting the conf.py. But it did not work.

@wilsonyou
Copy link
Author

@stsewd I just now tried to input the requirements.txt file without selecting the conf.py. But it did not work.

@stsewd
Copy link
Member

stsewd commented Aug 8, 2018

@wilsonyou
Copy link
Author

@stsewd Do you mean that I should delete the following codes?

from unittest.mock import MagicMock

class Mock(MagicMock):
@classmethod
def getattr(cls, name):
return MagicMock()

MOCK_MODULES = ['pygtk', 'gtk', 'gobject', 'argparse', 'numpy', 'pandas','sphinx_markdown_tables']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

@stsewd
Copy link
Member

stsewd commented Aug 8, 2018

I'm not sure if your project needs to mock the other packages, but you only need to delete the sphinx_markdown_tables from that list

@wilsonyou
Copy link
Author

Hi man, finally, it works! Thank you so much!

By the way, if you want to know anything about China, please do not hesitate to ask me.

I am a technical writer in Beijing, China.

If you come to China in the near future, please contact me, I must buy a dinner.

Phone number : +86 13671352506
WeChat: 13671352506

@stsewd
Copy link
Member

stsewd commented Aug 8, 2018

haha, glad that it works! I don't have plans to go to China in the near future, but who knows, I'll keep it in mind, thanks!

@anvithks
Copy link

anvithks commented Mar 4, 2019

Hi man, finally, it works! Thank you so much!

By the way, if you want to know anything about China, please do not hesitate to ask me.

I am a technical writer in Beijing, China.

If you come to China in the near future, please contact me, I must buy a dinner.

Phone number : +86 13671352506
WeChat: 13671352506

@wilsonyou how did you manage to get this working?

@wilsonyou
Copy link
Author

@anvithks Hi, you can refer to the following link : https://github.com/bumoproject/bumo-docs-cn

@anvithks
Copy link

anvithks commented Mar 8, 2019

@wilsonyou thank you. I managed to get it to work.

craigsteffen added a commit to craigsteffen/BW_new_docs that referenced this issue Jan 20, 2022
readthedocs/readthedocs.org#4466

Perhaps just this file will make all the types of markdown tables work.  Here's hoping!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support question
Projects
None yet
Development

No branches or pull requests

3 participants