fix: Adapted to gitea infrastructure, new README.

main
Sofus Albert Høgsbro Rose 2023-08-13 22:45:03 +02:00
parent c02c7b2210
commit d08f7691ab
Signed by: so-rose
GPG Key ID: AD901CB0F3701434
2 changed files with 37 additions and 20 deletions

View File

@ -1,21 +1,38 @@
# MDBook Plugins
The following plugins for `mdbook` are in use:
- `linkcheck`: Checks if links in the book are alive.
- **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
# Containerized `mdbook`
`mdbook` (<https://rust-lang.github.io/mdBook/>) is an easy way to generate beautiful book-like websites from simple Markdown text files.
This repository compiles and packages a ready-to-use contianer running `mdbook`.
# TODO
- [ ] Do an `all()` thing for the checks
## Easy Book->Website
`mdbook` repositories are very clean: Just a `src/` folder with a bunch of markdown text files.
# Pre-Commit Hooks
https://github.com/compilerla/conventional-pre-commit
`docker-mdbook` makes it easy to turn that clean bundle of text files into a website deployable as a container.
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
View File

@ -43,7 +43,7 @@ IMAGE_NAME = "docker-mdbook"
IMAGE_VERSION = ("0", "4", "34")
REGISTRY_HOST = "git.sofus.io"
REGISTRY_USER = "so-rose"
REGISTRY_USER = "python-support"
REGISTRY_PASSWORD = subprocess.check_output(
['pass', 'services/home/git.sofus.io/container-registry-token']
).decode('ascii').strip()