Retire the use of symlinks for the README and the changelog
Marco Ricci

Marco Ricci commited on 2024-11-27 18:21:17
Zeige 7 geänderte Dateien mit 7 Einfügungen und 4 Löschungen.


Symlinks interact very poorly with online git repository viewers, and
while they are offline viewable on Unixish systems, readers only see the
source view, not the rendered view.

For the documentation frontpage `docs/index.md`, use the Snippets
extension (Material for MkDocs/Python-Markdownx) to include the contents
of `README.md`.  This will allow future customization of the frontpage
by either appending further content or only embedding parts of the
README.

For the changelog, because we use `scriv` to maintain it
semi-automatically and thus want the changelog snippets to stay out of
the top-level directory, we do not want `docs/changelog.md` to symlink
to or to snippet-include the top-level `CHANGELOG.md`.  Instead, we let
`CHANGELOG.md` point to the `docs` directory (in prose), and purge the
symlinks to the SVG badges.  The original intent was to make the
changelog renderable at the top-level, without the MkDocs machinery, but
this is only really feasible if the changelog is handwritten, which
hasn't been the case anymore for quite some time already.
... ...
@@ -1 +0,0 @@
1
-docs/changelog.md
2 0
\ No newline at end of file
... ...
@@ -0,0 +1 @@
1
+(See docs/ directory.)
... ...
@@ -1 +0,0 @@
1
-docs/Keep_a_changelog-E05735.svg
2 0
\ No newline at end of file
... ...
@@ -1 +0,0 @@
1
-docs/SemVer-3F4551.svg
2 0
\ No newline at end of file
... ...
@@ -1 +0,0 @@
1
-../README.md
2 0
\ No newline at end of file
... ...
@@ -0,0 +1 @@
1
+--8<-- "README.md"
... ...
@@ -125,6 +125,11 @@ markdown_extensions:
125 125
   - toc:
126 126
       permalink: true
127 127
   - pymdownx.details
128
+  - pymdownx.snippets:
129
+      base_path:
130
+        - 'docs'
131
+        - '.'
132
+      check_paths: true
128 133
   - pymdownx.superfences
129 134
   - pymdownx.tabbed:
130 135
       alternate_style: true
131 136