diff options
-rw-r--r-- | CONTRIBUTING.md | 18 | ||||
-rw-r--r-- | README.md | 19 | ||||
-rwxr-xr-x | pydoc.py | 14 | ||||
-rw-r--r-- | templates/index.html | 4 |
4 files changed, 30 insertions, 25 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 3e25908..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,18 +0,0 @@ -## How to contribute - -* You can give feedback and suggest packages to be included, - either by [email] or in the [#pydoc] IRC channel on [Libera.Chat]. - -* You can contribute to [pydoctor]. - -* You can contribute to the individual Python projects - to improve their [docstrings]. - -* If you want to support pydoc.dev by providing hosting, - [please get in touch][email]. - -[email]: mailto:martin@push-f.com -[#pydoc]: https://web.libera.chat/?channel=#pydoc -[Libera.Chat]: https://libera.chat/ -[pydoctor]: https://github.com/twisted/pydoctor -[docstrings]: https://www.python.org/dev/peps/pep-0257/ @@ -9,7 +9,26 @@ often is not structured after the Python modules. It works by downloading the source files from the [Python Package Index], the API documentation is then generated with [pydoctor]. +<!-- package list --> + +## How to contribute + +* You can give feedback and suggest packages to be included, + either by [email] or in the [#pydoc] IRC channel on [Libera.Chat]. + +* You can contribute to [pydoctor]. + +* You can contribute to the individual Python projects + to improve their [docstrings]. + +* If you want to support pydoc.dev by providing hosting, + [please get in touch][email]. + [Sphinx]: https://www.sphinx-doc.org/ [docs.rs]: https://docs.rs/ [Python Package Index]: https://pypi.org/ [pydoctor]: https://github.com/twisted/pydoctor +[email]: mailto:martin@push-f.com +[#pydoc]: https://web.libera.chat/?channel=#pydoc +[Libera.Chat]: https://libera.chat/ +[docstrings]: https://www.python.org/dev/peps/pep-0257/ @@ -3,6 +3,7 @@ import configparser import io import json import shutil +import sys import tarfile import tempfile import zipfile @@ -313,15 +314,18 @@ if __name__ == '__main__': readme_html = mistletoe.markdown( pkg_resources.resource_string(__name__, 'README.md').decode() ) - contributing_html = mistletoe.markdown( - pkg_resources.resource_string(__name__, 'CONTRIBUTING.md').decode() - ) + + sep = '<!-- package list -->' + try: + before, after = readme_html.split(sep) + except ValueError: + sys.exit(f'[fatal error] expected {sep} in README.md') with open(dist / 'index.html', 'w') as f: f.write( env.get_template('index.html').render( - readme=readme_html, - contributing=contributing_html, + before=before, packages=package_infos.items(), + after=after, ) ) diff --git a/templates/index.html b/templates/index.html index d368271..d62ddf6 100644 --- a/templates/index.html +++ b/templates/index.html @@ -9,7 +9,7 @@ </style> </head> <body> - {{ readme | safe }} + {{ before | safe }} <p>pydoc.dev is currently in early alpha and only hosts documentation for {{ packages | length }} packages:</p> @@ -20,6 +20,6 @@ {% endfor %} </ul> - {{ contributing | safe }} + {{ after | safe }} </body> </html> |