Skip to content

Commit

Permalink
Move docs to a separate branch
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Jul 22, 2022
1 parent 011f7bb commit a90e9bd
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 3 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/on_push_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Generate docs
concurrency:
group: generate_docs
cancel-in-progress: true

on:
# push:
# branches:
# - main
workflow_dispatch: {}

jobs:
build-docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python for Poetry
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install poetry
run: |
python -m pip install poetry pip
poetry config virtualenvs.create false
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- name: Install dependencies
run: |
poetry install -n
python -m pip install -U handsdown
python -m pip install -r requirements.mkdocs.txt
- name: Build docs
run: |
python -m handsdown --external `git config --get remote.origin.url` -o docsmd --cleanup --theme material --branch main $@
rm -rf docs/*
python -m mkdocs build
- name: Checkout gh-pages branch
uses: actions/checkout@v3
with:
ref: gh-pages
path: ./gh-pages
- name: Commit changes
run: |
cd ./gh-pages
git config --global user.email "github-actions"
git config --global user.name "github-actions@github.com"
rm -rf docs docsmd
mv ../docs .
mv ../docsmd .
git commit -am "Update docs"
git push
4 changes: 4 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ mkdocs:

# Build all formats
formats: all

python:
install:
- requirements: requirements.mkdocs.txt
38 changes: 35 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
site_name: "Mypy Boto3 Builder"
repo_url: "https://github.com/youtype/mypy_boto3_builder/"
site_dir: "site"
docs_dir: "docs"
site_dir: "docs"
docs_dir: "docsmd"

theme:
name: readthedocs
name: material
icon:
logo: material/file-check-outline
include_sidebar: true
palette:
- scheme: default
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
- scheme: slate
primary: blue
accent: blue
toggle:
icon: material/toggle-switch
name: Switch to light mode
features:
- navigation.expand
- navigation.instant
- navigation.tracking
- content.code.annotate
markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.tabbed:
alternate_style: true
- pymdownx.highlight:
use_pygments: true
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
2 changes: 2 additions & 0 deletions requirements.mkdocs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkdocs
mkdocs-material

0 comments on commit a90e9bd

Please sign in to comment.