summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-02-10 09:17:18 +0100
committerMartin Fischer <martin@push-f.com>2022-02-10 09:19:47 +0100
commit091d3f39435da9de77d0492686acd7bba6f79357 (patch)
tree4831e40e3a6dcb92bb8cba568b78a7400e7b2e48
parent03a1c05a195f83868af94adeb9b405f169098465 (diff)
merge CONTRIBUTING.md into README.md
-rw-r--r--CONTRIBUTING.md18
-rw-r--r--README.md19
-rwxr-xr-xpydoc.py14
-rw-r--r--templates/index.html4
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/
diff --git a/README.md b/README.md
index 6f185bf..5c282c2 100644
--- a/README.md
+++ b/README.md
@@ -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/
diff --git a/pydoc.py b/pydoc.py
index d57a062..619a1ac 100755
--- a/pydoc.py
+++ b/pydoc.py
@@ -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>