-
Notifications
You must be signed in to change notification settings - Fork 34
/
prepare_docs.sh
executable file
·34 lines (28 loc) · 1004 Bytes
/
prepare_docs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
# The website is built using MkDocs with the Material theme.
# https://squidfunk.github.io/mkdocs-material/
# Mkdocs requires Python to run.
# Install the packages: `pip install mkdocs-material`
# Build the api docs: `./gradlew dokkaHtmlMultiModule`
# Then run this script to prepare the docs for the website.
# Finally, run `mkdocs serve` to preview the site locally or `mkdocs build` to build the site.
set -ex
# Copy the changelog into the site, omitting the unreleased section
cat CHANGELOG.md \
| grep -v '^## Unreleased' \
| sed '/^## /,$!d' \
> docs/changelog.md
# Add the jinja frontmatter to the index
cat > docs/index.md <<- EOM
---
hide:
- toc # Hide table of contents
---
EOM
# Copy the README into the index, omitting the docs link, license and fixing hrefs
cat README.md \
| sed '/## License/Q' \
| sed -z 's/## Documentation[a-zA-z .\n()/:]*//g' \
| sed 's!https://ajalt.github.io/mordant/!/!g' \
| sed 's!docs/img!img!g' \
>> docs/index.md