Skip to content

Commit 91fc23f

Browse files
authored
fix(python): make document inclusion in docs allow relative paths. (#395)
* fix(python): Python Lints. * fix(python): Fix comment in Justfile * fix(python): spelling fixes * fix(python): Remove subprocess._ENV it doesn't exist... * fix(python): name named parameters * fix(python): Name non positional parameters * fix(python): disable lints for print * fix(python): fix more bool flags * fix(python): Its ok if the docs dir exists * fix(python): bin was renamed to bin_file * fix(python): filename needs to be a string not a path * fix(python): Make `indent` default to 0, not None. * fix(python): Use relative includes for files in sub directories. * docs(python): Update mkdocs and fix relative includes. * fix(python): Bump to python 13 * fix(python): update dependencies as it no longer builds * fix(python): update docs * fix(python): add UV to base python builder * fix(python): Add UV to the path
1 parent 8bf8202 commit 91fc23f

File tree

47 files changed

+1663
-1370
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1663
-1370
lines changed

.config/dictionaries/project.dic

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ cytopia
1414
depgraph
1515
devenv
1616
dind
17+
direnv
1718
dockerhub
19+
docstrings
20+
doctests
1821
doseq
1922
doublecircle
2023
Earthfile
@@ -48,6 +51,7 @@ gopls
4851
gosec
4952
graphviz
5053
idents
54+
ipynb
5155
JDBC
5256
jorm
5357
jormungandr
@@ -90,7 +94,9 @@ projectcatalyst
9094
pubout
9195
pubspec
9296
pymdownx
97+
pypackages
9398
PYTHONDONTWRITEBYTECODE
99+
pytype
94100
rankdir
95101
rivo
96102
runewidth

Earthfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ IMPORT ./earthly/mdlint AS mdlint-ci
44
IMPORT ./earthly/cspell AS cspell-ci
55
IMPORT ./earthly/bash AS bash-ci
66
IMPORT ./earthly/spectral AS spectral-ci
7+
IMPORT ./earthly/python AS python-ci
78

89
# cspell: words livedocs sitedocs
910

@@ -49,6 +50,7 @@ repo-config:
4950

5051
WORKDIR /repo
5152
COPY --dir .sqlfluff .
53+
COPY --dir ruff.toml .
5254

5355
SAVE ARTIFACT /repo repo
5456

@@ -57,4 +59,9 @@ edit-docs:
5759
LOCALLY
5860

5961
RUN ./earthly/docs/dev/local.py cat-ci-docs:latest
60-
62+
63+
# We lint python globally in repos, so that all scripts and programs
64+
# are linted equally.
65+
# Its also fast.
66+
check-python:
67+
DO python-ci+LINT_PYTHON

Justfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# use with https://github.com/casey/just
22
#
3-
4-
# cspell: words prereqs, commitlog
3+
# Developer convenience functions
54

65
default:
76
@just --list --unsorted
87

9-
108
# Fix and Check Markdown files
119
check-markdown:
1210
earthly +markdown-check-fix
@@ -17,14 +15,19 @@ check-spelling:
1715
earthly +check-spelling
1816

1917

20-
# Fix and Check Markdown files
18+
# Fix and Check Code Format for Python files
2119
format-python-code:
2220
ruff check --select I --fix .
2321
ruff format .
2422

25-
# Fix and Check Markdown files
26-
lint-python:
23+
# Fix and Check Lint for Python files
24+
lint-python: format-python-code
25+
ruff check --fix .
2726
ruff check .
2827

2928
# Pre Push Checks - intended to be run by a git pre-push hook.
3029
pre-push: check-markdown check-spelling format-python-code lint-python
30+
31+
# Preview docs locally
32+
preview-docs:
33+
earthly/docs/dev/local.py cat-ci-docs:latest

docs/includes/abbreviations.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!-- markdownlint-disable MD041 MD043-->
2+
*[HTML]: Hyper Text Markup Language
3+
*[W3C]: World Wide Web Consortium

docs/src/appendix/examples/abbreviations.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ The HTML Specification is maintained by the W3C.
1111
!!! note
1212

1313
Abbreviations go in the `docs/includes/abbreviations.md` file.
14+
Except that doesn't work for some reason...
15+
So embed them like this at the end of a document:
16+
17+
```md
18+
*[HTML]: Hyper Text Markup Language
19+
*[W3C]: World Wide Web Consortium
20+
```
21+
22+
*[HTML]: Hyper Text Markup Language
23+
*[W3C]: World Wide Web Consortium

docs/src/appendix/examples/d2-diagrams.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ example:
2929
This is the sample valid CQL schema code:
3030

3131
```cql
32-
{{ include_file('src/appendix/examples/diagrams/sample_d2.cql') }}
32+
{{ include_file('./diagrams/sample_d2.cql') }}
3333
```
3434

3535
Resulted in D2:
3636

3737
```d2
38-
{{ include_file('src/appendix/examples/diagrams/sample_d2.d2') }}
38+
{{ include_file('./diagrams/sample_d2.d2') }}
3939
```

docs/src/appendix/examples/graphviz-diagrams.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ icon: material/draw
77
## Graphviz SVG's
88

99
=== "Trees"
10-
<!-- markdownlint-disable no-inline-html -->
10+
<!-- markdownlint-disable no-inline-html -->
1111
<center>
12-
<!-- markdownlint-enable no-inline-html -->
12+
<!-- markdownlint-enable no-inline-html -->
1313

1414
```dot
1515
graph G {
@@ -150,21 +150,21 @@ icon: material/draw
150150
???- note "graphviz in UnExpanded Block"
151151

152152
```dot
153-
{{ include_file('src/appendix/examples/diagrams/invasion_plan.dot', indent=4) }}
153+
{{ include_file('./diagrams/invasion_plan.dot', indent=4) }}
154154
```
155155

156156
???+ note "graphviz in Expanded Block"
157157

158158
```dot
159-
{{ include_file('src/appendix/examples/diagrams/invasion_plan.dot', indent=4) }}
159+
{{ include_file('./diagrams/invasion_plan.dot', indent=4) }}
160160
```
161161

162162
## Graphviz PNG's (lower quality than SVGs)
163163

164164
=== "Graphviz Render"
165165

166166
```graphviz dot attack_plan.png
167-
{{ include_file('src/appendix/examples/diagrams/invasion_plan.dot', indent=4) }}
167+
{{ include_file('./diagrams/invasion_plan.dot', indent=4) }}
168168
```
169169

170170
=== "Example of Code Syntax"
@@ -173,6 +173,6 @@ icon: material/draw
173173

174174
~~~
175175
``` graphviz dot attack_plan.png
176-
{{ include_file('src/appendix/examples/diagrams/invasion_plan.dot', indent=4) }}
176+
{{ include_file('./diagrams/invasion_plan.dot', indent=4) }}
177177
```
178178
~~~

docs/src/appendix/examples/kroki-diagrams.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

docs/src/appendix/examples/mermaid-diagrams.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ icon: material/draw
44

55
# Mermaid Diagrams
66

7-
There is overlap between Kroki and Mermaid
8-
9-
Mermaid can not zoom, but it can embed links.
7+
Mermaid diagrams can be embedded inline.
108

119
``` mermaid
1210
graph LR

docs/src/appendix/important/license.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ icon: material/license
99
??? note "Apache 2 License"
1010

1111
```text
12-
{{ include_file('includes/repo/LICENSE-APACHE', 0, -1, 8) }}
12+
{{ include_file('includes/repo/LICENSE-APACHE', indent = 8) }}
1313
```
1414

1515
??? note "MIT License"
1616

1717
```text
18-
{{ include_file('includes/repo/LICENSE-MIT', 0, -1, 8) }}
18+
{{ include_file('includes/repo/LICENSE-MIT', indent = 8) }}
1919
```

0 commit comments

Comments
 (0)