fix: Adapted to gitea infrastructure, new README.
parent
c02c7b2210
commit
d08f7691ab
55
README.md
55
README.md
|
@ -1,21 +1,38 @@
|
||||||
# MDBook Plugins
|
# Containerized `mdbook`
|
||||||
The following plugins for `mdbook` are in use:
|
`mdbook` (<https://rust-lang.github.io/mdBook/>) is an easy way to generate beautiful book-like websites from simple Markdown text files.
|
||||||
- `linkcheck`: Checks if links in the book are alive.
|
This repository compiles and packages a ready-to-use contianer running `mdbook`.
|
||||||
- **crates.io**: https://crates.io/crates/mdbook-linkcheck
|
|
||||||
- `mermaid`: Adds support for MermaidJS diagrams.
|
|
||||||
- **MermaidJS Reference**: https://mermaidjs.github.io/
|
|
||||||
- **crates.io**: https://crates.io/crates/mdbook-mermaid
|
|
||||||
- `toc`: Provides inline Table of Contents support.
|
|
||||||
- **crates.io**: https://crates.io/crates/mdbook-toc
|
|
||||||
- `katex`: Provides pre-rendered LaTeX math support.
|
|
||||||
- **crates.io**: https://crates.io/crates/mdbook-katex
|
|
||||||
- `admonish`: Provides styled notes, examples, etc. .
|
|
||||||
- **crates.io**: https://crates.io/crates/mdbook-admonish
|
|
||||||
- `quiz`: Provides interactive quizzes while reading.
|
|
||||||
- **crates.io**: https://crates.io/crates/mdbook-quiz
|
|
||||||
|
|
||||||
# TODO
|
## Easy Book->Website
|
||||||
- [ ] Do an `all()` thing for the checks
|
`mdbook` repositories are very clean: Just a `src/` folder with a bunch of markdown text files.
|
||||||
|
|
||||||
# Pre-Commit Hooks
|
`docker-mdbook` makes it easy to turn that clean bundle of text files into a website deployable as a container.
|
||||||
https://github.com/compilerla/conventional-pre-commit
|
Here's a multi-stage Dockerfile example:
|
||||||
|
```Dockerfile
|
||||||
|
####################
|
||||||
|
# - Stage: SSG
|
||||||
|
####################
|
||||||
|
FROM git.sofus.io/python-support/docker-mdbook:0.1.0 AS base
|
||||||
|
COPY . /src
|
||||||
|
|
||||||
|
RUN mdbook build /src --dest-dir /dist
|
||||||
|
|
||||||
|
####################
|
||||||
|
# - Stage: Serve Static Files
|
||||||
|
####################
|
||||||
|
FROM ghcr.io/static-web-server/static-web-server:2
|
||||||
|
COPY --from=base /dist /app
|
||||||
|
|
||||||
|
ENV SERVER_PORT 8787
|
||||||
|
ENV SERVER_ROOT /app
|
||||||
|
ENV SERVER_LOG_LEVEL info
|
||||||
|
|
||||||
|
USER 5020
|
||||||
|
```
|
||||||
|
Put this `Dockerfile` in your book repository, then build & run with your favorite container tool:
|
||||||
|
```bash
|
||||||
|
podman build . --tag mybook:dev
|
||||||
|
podman run --rm -it -p 8787:8787 mybook:dev
|
||||||
|
## In your browser, go to localhost:8787
|
||||||
|
```
|
||||||
|
|
||||||
|
The principle is the same for hot-reloading with ex. `mdbook serve`.
|
||||||
|
|
2
run.py
2
run.py
|
@ -43,7 +43,7 @@ IMAGE_NAME = "docker-mdbook"
|
||||||
IMAGE_VERSION = ("0", "4", "34")
|
IMAGE_VERSION = ("0", "4", "34")
|
||||||
|
|
||||||
REGISTRY_HOST = "git.sofus.io"
|
REGISTRY_HOST = "git.sofus.io"
|
||||||
REGISTRY_USER = "so-rose"
|
REGISTRY_USER = "python-support"
|
||||||
REGISTRY_PASSWORD = subprocess.check_output(
|
REGISTRY_PASSWORD = subprocess.check_output(
|
||||||
['pass', 'services/home/git.sofus.io/container-registry-token']
|
['pass', 'services/home/git.sofus.io/container-registry-token']
|
||||||
).decode('ascii').strip()
|
).decode('ascii').strip()
|
||||||
|
|
Loading…
Reference in New Issue