Skip to content

Commit 9119472

Browse files
committed
Add config files for environment, mkdocs, and gh actions.
1 parent ce2ec1f commit 9119472

File tree

3 files changed

+153
-0
lines changed

3 files changed

+153
-0
lines changed

.github/workflows/docs.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Publish documentation
2+
name: documentation
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
# https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell
17+
defaults:
18+
run:
19+
shell: bash -l {0}
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v2
24+
25+
# See: https://github.com/marketplace/actions/setup-miniconda
26+
- name: Setup miniconda
27+
uses: conda-incubator/setup-miniconda@v2
28+
with:
29+
auto-update-conda: true
30+
miniforge-variant: Mambaforge
31+
environment-file: environment.yml
32+
use-mamba: true
33+
34+
- name: Install pyjviz
35+
# use editable mode to avoid _pytest.pathlib.ImportPathMismatchError
36+
run: pip install -e .
37+
38+
- name: Build docs
39+
run: mkdocs build
40+
41+
- uses: actions/upload-artifact@v3
42+
with:
43+
name: website
44+
path: site/
45+
46+
- name: Test docs
47+
run: pytest -m "documentation"
48+
49+
- name: Docs preview
50+
if: ${{ github.event_name == 'pull_request' }}
51+
uses: nwtgck/[email protected]
52+
with:
53+
publish-dir: "./site"
54+
production-deploy: false
55+
github-token: ${{ secrets.GHPAGES_TOKEN }}
56+
deploy-message: "Deploy from GitHub Actions"
57+
enable-pull-request-comment: true
58+
enable-commit-comment: false
59+
overwrites-pull-request-comment: true
60+
alias: deploy-preview-${{ github.event.number }}
61+
env:
62+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
63+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
64+
timeout-minutes: 1
65+
66+
- name: Deploy website
67+
if: ${{ github.event_name == 'push' }}
68+
uses: peaceiris/actions-gh-pages@v3
69+
with:
70+
# https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-personal-access-token-personal_token
71+
personal_token: ${{ secrets.GHPAGES_TOKEN }}
72+
publish_dir: ./site/
73+
publish_branch: gh-pages
74+
# destination_dir: manuscript
75+
allow_empty_commit: false
76+
keep_files: false
77+
force_orphan: true
78+
enable_jekyll: false
79+
disable_nojekyll: false

environment.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: pyjviz
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.9
6+
- rdflib
7+
- graphviz
8+
- python-graphviz
9+
- pandas
10+
- pandas-flavor
11+
- black
12+
- mypy
13+
- flake8
14+
- mkdocs
15+
- pre-commit

mkdocs.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Project information
2+
site_name: pyjviz documentation
3+
site_url: https://pyjanitor-devs.github.io/pyjviz
4+
site_description: >-
5+
Python implementation of the R package janitor
6+
7+
# Repository
8+
repo_name: "pyjanitor-devs/pyjviz"
9+
repo_url: "https://github.com/pyjanitor-devs/pyjviz"
10+
11+
# Configuration
12+
docs_dir: docs/
13+
watch:
14+
- pyjviz/
15+
16+
theme:
17+
name: "material"
18+
palette:
19+
- media: "(prefers-color-scheme: light)"
20+
scheme: default
21+
primary: "blue grey"
22+
accent: "light blue"
23+
icon:
24+
logo: "fontawesome/solid/book"
25+
features:
26+
- navigation.instant
27+
# - navigation.tabs
28+
- navigation.top
29+
- toc.follow
30+
- content.code.copy
31+
language: en
32+
33+
# Page tree
34+
# We customize the navigation by hand to control the order
35+
# in which pages show up.
36+
nav:
37+
- Home: index.md
38+
39+
plugins:
40+
- search
41+
- autorefs
42+
- mkdocstrings:
43+
default_handler: python
44+
handlers:
45+
python:
46+
options:
47+
docstring_style: "google"
48+
docstring_options:
49+
trim_doctest_flags: true
50+
show_root_toc_entry: false
51+
show_submodules: true
52+
show_source: true
53+
54+
markdown_extensions:
55+
- admonition
56+
- pymdownx.highlight:
57+
use_pygments: true
58+
- pymdownx.inlinehilite
59+
- pymdownx.superfences

0 commit comments

Comments
 (0)