Skip to content

Commit

Permalink
doc: employ mdbook
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Oct 22, 2024
1 parent f11265c commit c9dfee1
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: deploy-github-pages
on: [push]
jobs:
deploy-github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
with:
nix_path: nixpkgs=channel:nixos-24.05
- run: nix-shell --run "make doc -j"
- uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book
force_orphan: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ sim_build
# for gtkwave
*.fst
*.gtkw

# for docs
*.py.dot
*.py.svg
book
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ clean:
################################################################################
# doc
################################################################################
doc: ./docs/images/arch.py.dot
MDs=$(shell find docs/ -name "*.md")
doc: ./docs/images/arch.py.svg ./docs/images/arch.configure.py.svg $(MDs)
mdbook build
%.py.dot: %.dot.py
python3 $<
%.py.svg: %.py.dot
dot -Tsvg $< -o $@
9 changes: 9 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[book]
authors = ["xieby1"]
language = "en"
multilingual = false
src = "docs/"
title = "OpenAIA.scala"

[output.html]
git-repository-url = "https://github.com/xieby1/OpenAIA.scala"
5 changes: 5 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Summary

# 🏠主页

* [📔OpenAIA.scala](./index.md)
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
![](./images/arch.py.svg)

![](./images/arch.configure.py.svg)
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ in pkgs.mkShell {
pkgs.zlib
# for docs
pkgs.graphviz
pkgs.mdbook
];

shellHook = let
Expand Down

0 comments on commit c9dfee1

Please sign in to comment.