-
Notifications
You must be signed in to change notification settings - Fork 400
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
Feature: Convert docstring to Markdown #2159
Feature: Convert docstring to Markdown #2159
Conversation
…ture3/feature/docstring2markdown
Pull Request Test Coverage Report for Build 7239165628Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
For the repo in the permission to create PRs must be enabled (only the checkbox is necessary!). |
The other permissions should not be changed right? As all read and write permissions for actions is mostly not necessary and can also be adjusted on other ways. |
Did you mean your doc-update branch? On the s-martin#26 branch i dont see the generated docs. |
Correct |
You are right, s-martin#28 is the result PR. s-martin#26 was just me fiddling around. |
Most of the docs are empty. This should then be filled over time, right? Also the Readme.md contains links to the subpages, but also all other information. It looks pretty rough and not really usable. |
It's empty, when there's no docstring in the Python file. Unfortunately the action doesn't have the possibility to filter for "empty documentation" yet. Probably something to improve. |
PRs from forked repos are restricted to only have read permissions, no matter what settings are made. So after the merge it should run fine, if not pull_request trigger is needed.
|
I checked the result PR in my repo s-martin#28 at least 80% of the files contain at least some doc info, so I would say in general it’s usable and I would not put effort in implementing to skip empty content, but rather focus on adding the missing info. For that we could use flake-docstring to help with identifying missing content. To enforce docstrings with flake8 we could use something like s-martin#29 later. the Readme here contains also the class description, which I find personally OK for an overview. What do you think? PS. I have a fork of the action to create the markdown docs to make it working here: https://github.com/s-martin/markdown-docs |
Building up the docs should be the way, so fine for me 👍
The class overview is ok, also it's unsorted and has duplications. But I rather meant the functions section. I can't really tell what they are about. Just an unordered list of all functions available? Edit: ok found an answer in the Readme
Im really unsure about that. Maybe just leave it as is for now, so we can use it as a base to check later on, if all function scopes are correct or could be improved? |
👍 |
And i think we have to set our own configuration. |
Good catch 👍 |
Couldn't docstring not be handled as a Git pre-commit hook instead of a Github Action to PR? |
I don't know, but this would at least create the docs with the source code change. |
This looks a little bit more mature than the GitHub Action this PR is using: If we use this in a pre commit hook, is it possible to stage the generated files for the same commit? |
Not a bad idea either. And sounds like less overhead.
So there is a chance that it's not run by the user, if the setup is not performed (like the current hook for flake8 ). So maybe a solution to address this is to supply a development container? And for activation something like this? |
A few thoughts. Some of it has been said to some extend, I just wanted to summarize it.
|
My main driver was to make the plugin docs hidden in I like the approach enforcing the docs before the commit, I’m not bound to the Action :) I don’t know, if pydoc markdown is the most suitable tool, it was just a little googling and it seemed simple enough and did not require stuff like Sphinx etc. Docker container sounds like an interesting idea, but can’t we expect that someone implementing stuff in Python having Python installed? 😜 Right now, the pre commit hook is a custom implementation, right? Is it worth it to use something like https://github.com/pre-commit/pre-commit-hooks, which was already suggested in #1941? |
Simpler solution here: #2181 Closing this one |
This PR adds an action, which creates a new PR, every time Python code changes have been merged to
future3/develop
.This PR creates Markdown documentation of the Python code from docstring.
The Markdown files are written to
documentation/developers/docstring
.See s-martin#28 for proof of concept.