-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: automatic
this.md
generation (#705)
* docs: automatic 'this' rendering * workaround with hooks * rm this.md
- Loading branch information
Showing
4 changed files
with
42 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
from typing import Final | ||
|
||
from sklego.this import poem | ||
|
||
DESTINATION_PATH: Final[Path] = Path("docs") / "this.md" | ||
|
||
content = f""" | ||
# Import This | ||
In Python there's a poem that you can read by importing the `this` module. | ||
```py | ||
import this | ||
``` | ||
It has wonderful lessons that the authors of the language learned while designing the python language. | ||
In the same tradition we've done the same thing. Folks who have made significant contributions have also been asked to | ||
contribute to the poem. | ||
You can read it via: | ||
```py | ||
from sklego import this | ||
``` | ||
```console | ||
{poem} | ||
``` | ||
""" | ||
|
||
with DESTINATION_PATH.open(mode="w") as destination: | ||
destination.write(content) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,3 +158,6 @@ nav: | |
|
||
not_in_nav: | | ||
_static | ||
hooks: | ||
- docs/generate_this_content.py |