-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM registry.fedoraproject.org/fedora:40 AS builder | ||
|
||
|
||
RUN dnf install -y cargo \ | ||
&& cargo install mdbook \ | ||
&& cargo install mdbook-callouts \ | ||
&& cargo install mdbook-mermaid | ||
|
||
|
||
FROM registry.fedoraproject.org/fedora:40 | ||
|
||
COPY --from=builder /root/.cargo/bin/mdbook /usr/bin | ||
COPY --from=builder /root/.cargo/bin/mdbook-callouts /usr/bin | ||
COPY --from=builder /root/.cargo/bin/mdbook-mermaid /usr/bin | ||
|
||
RUN mkdir -p /workspace | ||
VOLUME /workspace | ||
WORKDIR /workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Fedora image for mdBook-based generation | ||
======================================== | ||
|
||
|
||
This Fedora container image contains: | ||
|
||
- mdBook: https://github.com/rust-lang/mdBook | ||
create book from markdown files, like Gitbook | ||
- mdBook preprocessor: https://crates.io/crates/mdbook-callouts | ||
to add Obsidian Flavored Markdown's Callouts | ||
|
||
|
||
## Usage instructions | ||
Start the container in the folder that contains your documentation source | ||
|
||
```bash | ||
$ podman run --rm -v $PWD:/workspace \ | ||
ghcr.io/gbraad-redhat/mdbook:0.4.42 \ | ||
mdbook build | ||
``` | ||
|
||
This will generate a `book` output. | ||
|
||
Or using | ||
|
||
```bash | ||
$ podman run --rm -v $PWD:/workspace -p 3000:3000 \ | ||
ghcr.io/gbraad-redhat/mdbook:0.4.42 \ | ||
mdbook serve | ||
``` | ||
|
||
the generated content will be published using the embedded server on [`http://localhost:3000`](http://localhost:3000) |