Skip to content

Commit

Permalink
Add doc build (#2)
Browse files Browse the repository at this point in the history
* add docs deployment

* clean up yml

* fix build command

* add missing makefile

* remove pyvista logo

* remove pyvista from doc conf

* disable gallery

* add myst-parser

* fix token

* revert token

* add .nojekyll

* add tag condition back in
  • Loading branch information
akaszynski authored Sep 9, 2024
1 parent ea488ba commit a519fdc
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 24 deletions.
32 changes: 31 additions & 1 deletion .github/workflows/testing-and-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and upload
name: CI/CD

on:
pull_request:
Expand All @@ -13,6 +13,36 @@ concurrency:
cancel-in-progress: true

jobs:
docs:
name: Build documentation
runs-on: ubuntu-latest

env:
PYANSYS_OFF_SCREEN: true

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip

- name: Install lsdyna-mesh-reader
run: pip install .[docs]

- name: Build Documentation
run: make -C docs html

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
if: startsWith(github.ref, 'refs/tags/')
with:
branch: gh-pages
folder: docs/build/html
clean: true

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down
28 changes: 28 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = lsdyna_mesh_reader
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@if echo "$@" | grep -q "html"; then \
touch "$(BUILDDIR)"/html/.nojekyll; \
fi

clean:
rm -rf $(BUILDDIR)/*
rm -rf examples/
find . -type d -name "_autosummary" -exec rm -rf {} +
Binary file removed docs/source/_static/pyvista_logo_sm.png
Binary file not shown.
26 changes: 3 additions & 23 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import datetime
import os

import pyvista
from sphinx_gallery.sorting import FileNameSortKey
# import pyvista
# from sphinx_gallery.sorting import FileNameSortKey

import lsdyna_mesh_reader

Expand Down Expand Up @@ -65,7 +65,7 @@
}


html_static_path = ["_static"]
# html_static_path = ["_static"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down Expand Up @@ -106,26 +106,6 @@
# a list of builtin themes.
#
html_theme = "pydata_sphinx_theme"
# html_context = {
# # Enable the "Edit in GitHub link within the header of each page.
# "display_github": True,
# # Set the following variables to generate the resulting github URL for each page.
# # Format Template: https://{{ github_host|default("github.com") }}/{{
# # github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path
# # }}{{ pagename }}{{ suffix }}
# "github_user": "akaszynski",
# "github_repo": "pymeshfix",
# "github_version": "master/doc/",
# "menu_links_name": "Getting Connected",
# "menu_links": [
# ('<i class="fa fa-slack fa-fw"></i> Slack Community', "http://slack.pyvista.org"),
# (
# '<i class="fa fa-comment fa-fw"></i> Support',
# "https://github.com/pyvista/pyvista-support",
# ),
# ('<i class="fa fa-github fa-fw"></i> Source Code', "https://github.com/pyvista/pymeshfix"),
# ],
# }

html_theme_options = {
"show_prev_next": False,
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ readme = "README.md"
requires-python = ">=3.9"
version = "0.1.dev0"

[project.optional-dependencies]
docs = ["pydata-sphinx-theme", "numpydoc", "sphinx", "sphinx-copybutton", "myst-parser"]

[project.urls]
Repository = "https://github.com/akaszynski/lsdyna-mesh-reader"

Expand Down

0 comments on commit a519fdc

Please sign in to comment.