-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat(template): Add API documentation to the template 2/4 (Sphinx) #124
Conversation
src/scicookie/{{cookiecutter.project_slug}}/docs-sphinx/index.rst
Outdated
Show resolved
Hide resolved
@@ -1 +1,4 @@ | |||
Introduction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that now I got the point you mentioned on discord.
that makes more sense to call this file to intro.rst
also please rename it https://github.com/osl-incubator/scicookie/pull/124/files#diff-e5704837157913d9457988b9450bc2f363e27663bd5e2ecd098e580a44e9adb9R11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for working on that @YurelyCamacho
in general it looks good to me.
just added few comments here.
thanks!
Co-authored-by: Ivan Ogasawara <ivan.ogasawara@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xmnlab We have several comments here:
- In line 4, we add the README directly, so that it appears as an introduction. When generating the documentation, sphinx does not recognise titles starting with #. The same happens when we create a link to an introduction page (where we use the readme.rst file already created). If you add
../README.md
to the index, this link will not be generated. The same situation occurs ifreadme.rst
has no title. - There is a problem generating the contents of the
example.ipynb
notebook. It says that the title is not recognised and therefore it does not generate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xmnlab The issue here is whether to leave the readme as in line 4 or 11? And any suggestions on how to solve the problem of not recognising the headers (which are in md with #)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok give me until tomorrow to digest all of this and I will be back here tomorrow
thanks for your work here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YurelyCamacho, I am back here. I got the problem now. sorry for being late ...
I am investigating it now and I will be back here in a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reading a bit this SO: https://stackoverflow.com/questions/46278683/include-my-markdown-readme-into-sphinx
it seems it has 3 options:
- using symlink https://stackoverflow.com/a/48931594
- creating a new file inside the docs folder that includes the README https://stackoverflow.com/a/68005314
not sure if it would be necessary to add a recommonmark as a (dev) dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xmnlab We will try to see if it works for us and let you know, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xmnlab Do you prefer the readme to appear on the first page (as an introduction) with the table of contents or in a link called introduction?
We have already resolved the issue of titles. What it still doesn't show us is the notebook information example.ipynb
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion about that right now
so feel free to pick one that you think that would be better.
maybe soon we can get some feedback from some users and change it if it is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you ping me tomorrow so we can see this issue with example.ipynb together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you ping me tomorrow so we can see this issue with example.ipynb together?
All right, see you tomorrow
@YurelyCamacho it seems that |
@xmnlab We made a few changes and locally all the documentation now shows up fine, with the readme as a link called Introduction and the notebook called Example. |
@YurelyCamacho it seems that the problem is about the pandoc package from pypi: https://stackoverflow.com/questions/62398231/building-docs-fails-due-to-missing-pandoc probably the way to go is to add pandoc just in the conda env. just not sure if the user decided to not use conda XD let me know if that solutions works for you |
@YurelyCamacho it seems we will need both packages, one installed by conda and the other one by poetry.
|
@@ -7,3 +7,4 @@ dependencies: | |||
- poetry | |||
- nodejs # used by semantic-release | |||
- shellcheck | |||
- pandoc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xmnlab @YurelyCamacho I think it should be:
- pandoc | |
{% if cookiecutter.documentation_engine == 'sphinx' -%} | |
- pandoc | |
{% endif %} |
Am I right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YurelyCamacho could implement this idea @Anavelyz suggested?
please just to ensure to use the jinja tags correctly .. maybe:
{% if cookiecutter.documentation_engine == 'sphinx' -%}
- pandoc
{%- endif %}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YurelyCamacho maybe you can try this:
{%- if cookiecutter.documentation_engine == 'sphinx' %}
- pandoc
{%- endif %}
btw, I recommend you to play with: http://jinja.quantprogramming.com/
for this case, you can use as value (yaml)
, this input:
cookiecutter:
project_slug: test
documentation_engine: sphinx
@YurelyCamacho it seems that the tag jinja2 in the conda env file is not working properly yet with the fix-end-of-file pre-commit XD |
@xmnlab Done |
thanks @YurelyCamacho ! |
🎉 This PR is included in version 0.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Pull Request description
By @YurelyCamacho and @Anavelyz