Skip to content

Commit d8de9c2

Browse files
5.2 docs update (#406)
* Enable mdbook-linkcheck, fix lots of links * Magic link preprocessor! * Fix links * Universal depth parsing * Lint * Disable linkcheck * 5.2 features * Changelog
1 parent 0cbfc29 commit d8de9c2

35 files changed

+170
-149
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ jobs:
4040
${{ runner.os }}-venv-
4141
4242
- name: Set up mdBook
43-
uses: peaceiris/actions-mdbook@v1
44-
with:
45-
mdbook-version: '0.4.18'
43+
uses: jontze/action-mdbook@v1
4644

4745
- name: Install project
4846
run: make install

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test: ## Run test suite
3131

3232
docs: ## Build docs
3333
cd docs
34-
make -s clean docs lint || true
34+
make -s clean docs markdownlint orphans || true
3535

3636
homepage: ## Build homepage
3737
cd docs

docs/Makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ serve:
3737
wc:
3838
find . -name \*.md -type f -exec wc {} \;
3939

40-
lint: markdown orphans links
41-
42-
markdown:
40+
markdownlint:
4341
markdownlint -f . --disable=MD013 --disable=MD033 || true
4442

4543
clean:
@@ -49,9 +47,6 @@ orphans:
4947
cat SUMMARY.md | grep ".md" > mentioned.tmp
5048
sed -i -E 's@^.*\[(.*)\]\((.*)\).*$$@\2@p' mentioned.tmp
5149
cat mentioned.tmp | uniq | sort -o mentioned.tmp
52-
find . | grep ".md" | grep -v -e "node_modules/" -e " book/" -e "placeholders.md" -e "SUMMARY.md" | cut -c "3-" | sort -o existing.tmp
50+
find . | grep ".md" | grep -v -e "node_modules/" -e " book/" -e "placeholders.md" -e "SUMMARY.md" -e "mdbook-summary" | cut -c "3-" | sort -o existing.tmp
5351
diff --color mentioned.tmp existing.tmp
5452
rm mentioned.tmp existing.tmp
55-
56-
links:
57-
python -m linkcheckmd -r .

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{#include ../README.md}}
1+
{{ #include ../README.md }}

docs/advanced/datasources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,4 @@ Datasource HTTP connection parameters (ratelimit, backoff, etc.) are applied on
123123

124124
> 🤓 **SEE ALSO**
125125
>
126-
> * [12.4. datasources](../config/datasources.md)
126+
> * {{ #summary config/datasources.md}}

docs/advanced/hooks/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Hooks
22

3-
Hooks are user-defined callbacks called either from the [`ctx.fire_hook`](../advanced/handler-context.md#helpers) method or by scheduler ([`jobs`](jobs.md) config section, we'll return to this topic later).
3+
Hooks are user-defined callbacks called either from the [`ctx.fire_hook`](../context/reference.md) method or by scheduler ([`jobs`](jobs.md) config section, we'll return to this topic later).
44

55
Let's assume we want to calculate some statistics on-demand to avoid blocking an indexer with heavy computations. Add the following lines to DipDup config:
66

@@ -46,4 +46,4 @@ By default, hooks execute SQL scripts from the corresponding subdirectory of `sq
4646

4747
> 🤓 **SEE ALSO**
4848
>
49-
> * [12.6. hooks](../../config/hooks.md)
49+
> * {{ #summary config/hooks.md}}

docs/advanced/hooks/default.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ This hook fires when every active index reaches a realtime state. Here you can c
2222

2323
> 🤓 **SEE ALSO**
2424
>
25-
> * [5.3. Reindexing](../../advanced/reindexing.md)
26-
> * [5.5. Executing SQL scripts](../sql.md)
27-
> * [Handler context](../advanced/handler-context.md)
25+
> * {{ #summary advanced/reindexing.md}}
26+
> * {{ #summary advanced/sql.md}}
27+
> * {{ #summary advanced/context/README.md}}

docs/advanced/index-factories.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
DipDup allows spawning new indexes from a template in runtime. There are two ways to do that:
44

55
* From another index (e.g., handling factory originations)
6-
* In [`on_configure` hook](../cli/dipdup-run.md#custom-initialization)
6+
* In `on_configure` hook (see {{ #summary advanced/hooks/default.md}})
77

88
> **WARNING**
99
>
10-
> DipDup is currently not able to automatically generate types and handlers for template indexes unless there is at least one [static instance](indexes/template.md).
10+
> DipDup is currently not able to automatically generate types and handlers for template indexes unless there is at least one [static instance](../config/indexes/template.md).
1111
12-
DipDup exposes several context methods that extend the current configuration with new contracts and template instances. See [5.8. Handler context](../advanced/handler-context.md) for details.
12+
DipDup exposes several context methods that extend the current configuration with new contracts and template instances. See {{ #summary advanced/context/README.md}} for details.
1313

14-
See [12.13. templates](../config/templates.md) for details.
14+
See {{ #summary config/templates.md}} for details.

docs/advanced/performance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ By default, DipDup retries failed requests infinitely, exponentially increasing
6666
>
6767
> * [Tortoise ORM documentation](https://tortoise-orm.readthedocs.io/en/latest/)
6868
> * [Tortoise ORM examples](https://tortoise-orm.readthedocs.io/en/latest/examples.html)
69-
> * [8.1. Database engines](../deployment/database-engines.md)
70-
> * [8.9. Backup and restore](../deployment/backups.md)
69+
> * {{ #summary deployment/database-engines.md}}
70+
> * {{ #summary deployment/backups.md}}
7171

72-
See [12.4. datasources](../../config/datasources.md) for details.
72+
See [12.4. datasources](../config/datasources.md) for details.
7373

7474
## Use TimescaleDB for time-series
7575

docs/book.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ language = "en"
44
multilingual = false
55
src = "."
66
title = "DipDup framework"
7+
8+
[preprocessor.summary]
9+
command = "python mdbook-summary"

0 commit comments

Comments
 (0)