diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..5abf5e5 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,35 @@ +name: pages + +on: + push: + branch: main + pull_request: + workflow_dispatch: + +jobs: + render: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/cache@v3 + with: + path: | + cache/pip + key: cache-pip-${{ runner.os }}-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + cache-pip-${{ runner.os }} + - run: make build + env: + PIP_CACHE_DIR: cache/pip + - uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: site + publish_branch: site + commit_message: |- + render: ${{ github.event.head_commit.message }} + + Render static website for GitHub pages from + commit diff --git a/.gitignore b/.gitignore index 9cd5496..f86c606 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ *.bin *.elf *.o + +site +pages/README.md +Makefile.venv +.venv diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f306261 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +.PHONY: serve build +serve build: | venv + $(VENV)/mkdocs $@ + +.INTERMEDIATE: pages/README.md +serve build: pages/README.md +pages/README.md: README.md + cp $< $@ + +include Makefile.venv +Makefile.venv: + curl \ + -o Makefile.fetched \ + -L "https://github.com/sio/Makefile.venv/raw/v2023.04.17/Makefile.venv" + echo "fb48375ed1fd19e41e0cdcf51a4a0c6d1010dfe03b672ffc4c26a91878544f82 *Makefile.fetched" \ + | sha256sum --check - \ + && mv Makefile.fetched Makefile.venv diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..0d05d08 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,20 @@ +site_name: Осваиваем STM32 снизу +repo_name: vbezhenar/stm32-tutorial +repo_url: https://github.com/vbezhenar/stm32-tutorial + +docs_dir: pages + +nav: + - 1-explore/README.md + - 2-loop/README.md + - 3-blink/README.md + - 4-loopc/README.md + - 5-blinkc/README.md + - 6-blinkt/README.md + +theme: + name: material + language: ru + palette: + primary: green + accent: green diff --git a/1-explore/README.md b/pages/1-explore/README.md similarity index 100% rename from 1-explore/README.md rename to pages/1-explore/README.md diff --git a/2-loop/Makefile b/pages/2-loop/Makefile similarity index 100% rename from 2-loop/Makefile rename to pages/2-loop/Makefile diff --git a/2-loop/README.md b/pages/2-loop/README.md similarity index 100% rename from 2-loop/README.md rename to pages/2-loop/README.md diff --git a/2-loop/loop.ld b/pages/2-loop/loop.ld similarity index 100% rename from 2-loop/loop.ld rename to pages/2-loop/loop.ld diff --git a/2-loop/loop.s b/pages/2-loop/loop.s similarity index 100% rename from 2-loop/loop.s rename to pages/2-loop/loop.s diff --git a/3-blink/Makefile b/pages/3-blink/Makefile similarity index 100% rename from 3-blink/Makefile rename to pages/3-blink/Makefile diff --git a/3-blink/README.md b/pages/3-blink/README.md similarity index 100% rename from 3-blink/README.md rename to pages/3-blink/README.md diff --git a/3-blink/blink.s b/pages/3-blink/blink.s similarity index 100% rename from 3-blink/blink.s rename to pages/3-blink/blink.s diff --git a/3-blink/linker.ld b/pages/3-blink/linker.ld similarity index 100% rename from 3-blink/linker.ld rename to pages/3-blink/linker.ld diff --git a/4-loopc/Makefile b/pages/4-loopc/Makefile similarity index 100% rename from 4-loopc/Makefile rename to pages/4-loopc/Makefile diff --git a/4-loopc/README.md b/pages/4-loopc/README.md similarity index 100% rename from 4-loopc/README.md rename to pages/4-loopc/README.md diff --git a/4-loopc/linker.ld b/pages/4-loopc/linker.ld similarity index 100% rename from 4-loopc/linker.ld rename to pages/4-loopc/linker.ld diff --git a/4-loopc/loopc.c b/pages/4-loopc/loopc.c similarity index 100% rename from 4-loopc/loopc.c rename to pages/4-loopc/loopc.c diff --git a/4-loopc/reset_exception_handler.s b/pages/4-loopc/reset_exception_handler.s similarity index 100% rename from 4-loopc/reset_exception_handler.s rename to pages/4-loopc/reset_exception_handler.s diff --git a/5-blinkc/Makefile b/pages/5-blinkc/Makefile similarity index 100% rename from 5-blinkc/Makefile rename to pages/5-blinkc/Makefile diff --git a/5-blinkc/README.md b/pages/5-blinkc/README.md similarity index 100% rename from 5-blinkc/README.md rename to pages/5-blinkc/README.md diff --git a/5-blinkc/blinkc.c b/pages/5-blinkc/blinkc.c similarity index 100% rename from 5-blinkc/blinkc.c rename to pages/5-blinkc/blinkc.c diff --git a/5-blinkc/linker.ld b/pages/5-blinkc/linker.ld similarity index 100% rename from 5-blinkc/linker.ld rename to pages/5-blinkc/linker.ld diff --git a/5-blinkc/reset_exception_handler.s b/pages/5-blinkc/reset_exception_handler.s similarity index 100% rename from 5-blinkc/reset_exception_handler.s rename to pages/5-blinkc/reset_exception_handler.s diff --git a/6-blinkt/Makefile b/pages/6-blinkt/Makefile similarity index 100% rename from 6-blinkt/Makefile rename to pages/6-blinkt/Makefile diff --git a/6-blinkt/README.md b/pages/6-blinkt/README.md similarity index 100% rename from 6-blinkt/README.md rename to pages/6-blinkt/README.md diff --git a/6-blinkt/blinkt.c b/pages/6-blinkt/blinkt.c similarity index 100% rename from 6-blinkt/blinkt.c rename to pages/6-blinkt/blinkt.c diff --git a/6-blinkt/linker.ld b/pages/6-blinkt/linker.ld similarity index 100% rename from 6-blinkt/linker.ld rename to pages/6-blinkt/linker.ld diff --git a/6-blinkt/reset_exception_handler.s b/pages/6-blinkt/reset_exception_handler.s similarity index 100% rename from 6-blinkt/reset_exception_handler.s rename to pages/6-blinkt/reset_exception_handler.s diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..664606c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,35 @@ +# Direct dependencies +mkdocs==1.5.2 +mkdocs-material==9.2.7 +mkdocs-material-extensions==1.1.1 + +# Indirect dependencies +Babel==2.12.1 +certifi==2023.7.22 +charset-normalizer==3.2.0 +click==8.1.7 +colorama==0.4.6 +ghp-import==2.1.0 +idna==3.4 +importlib-metadata==6.7.0 +Jinja2==3.1.2 +Markdown==3.4.4 +MarkupSafe==2.1.3 +mergedeep==1.3.4 +packaging==23.1 +paginate==0.5.6 +pathspec==0.11.2 +platformdirs==3.10.0 +Pygments==2.16.1 +pymdown-extensions==10.2.1 +python-dateutil==2.8.2 +pytz==2023.3.post1 +PyYAML==6.0.1 +pyyaml_env_tag==0.1 +regex==2022.10.31 +requests==2.31.0 +six==1.16.0 +typing_extensions==4.7.1 +urllib3==2.0.4 +watchdog==3.0.0 +zipp==3.15.0