-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ericpre/doc_build
Add doc workflow
- Loading branch information
Showing
19 changed files
with
334 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Docs | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_docs: | ||
# This build is to make PR comments for the sphinx warning and check if | ||
# web links are not broken | ||
name: Check links and make PR comments | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCS_PATH: ./doc/_build/html/ | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v4 | ||
name: Install Python | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install build docs | ||
shell: bash -l {0} | ||
run: | | ||
pip install .'[doc]' | ||
# Add sphinx warnings as PR comments | ||
- uses: sphinx-doc/sphinx-problem-matcher@master | ||
|
||
- name: Build docs | ||
shell: bash -l {0} | ||
run: | | ||
cd doc | ||
make SPHINXOPTS="-W --keep-going" html | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ${{ env.DOCS_PATH }} | ||
name: docs_html | ||
|
||
- name: Check links | ||
shell: bash -l {0} | ||
run: | | ||
cd doc | ||
make linkcheck | ||
push_docs: | ||
# This build is to push changes to gh-pages branch (https://hyperspy.org/exspy) | ||
needs: build_docs | ||
name: Push to gh-pages | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name != 'pull_request' && github.repository == 'hyperspy/exspy' }} | ||
permissions: | ||
# needs write permission to push the docs to gh-pages | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: gh-pages | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: docs_html | ||
path: . | ||
|
||
- name: list files | ||
run: | | ||
ls | ||
- name: Git status | ||
run: | | ||
git status | ||
git status -s | ||
if [[ $(git status -s) ]]; then | ||
HAS_CHANGES='true' | ||
else | ||
HAS_CHANGES='false' | ||
fi | ||
echo "HAS_CHANGES=${HAS_CHANGES}" >> $GITHUB_ENV | ||
- name: Commit files | ||
# Skip when there is nothing to commit | ||
if: ${{ env.HAS_CHANGES == 'true' }} | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add -A | ||
git commit -m "Update docs build" -a | ||
- name: Push changes | ||
if: ${{ env.HAS_CHANGES == 'true' }} | ||
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
doc/_build/* | ||
doc/auto_examples/* | ||
build/* | ||
dist/* | ||
*egg-info* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the version of Python and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.11" | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: doc/conf.py | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
formats: | ||
- htmlzip | ||
|
||
python: | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
**exSpy** is a Python package extending the functionality for multi-dimensional | ||
data analysis provided by the [HyperSpy](https://hyperspy.org) library. It is | ||
aimed at helping with the analysis of X-rays Energy Dispersive Spectroscopy (EDS) | ||
and Electron Energy Loss Spectroscopy (EELS). | ||
|
||
Go to the documentation for instructions on how to install exSpy and start an | ||
analysis: [Read the docs](https://exspy.readthedocs.io). | ||
|
||
Everyone is welcome to contribute. Please read our | ||
[contributing guidelines](https://github.com/hyperspy/exspy/blob/main/CONTRIBUTING.rst) and get started! | ||
|
||
Development of exSpy is documented in the | ||
[changelog](https://github.com/hyperspy/exspy/blob/main/CHANGES.rst). |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,12 @@ | ||
Welcome to exSpy's documentation! | ||
*********************************** | ||
**exSpy** is a Python package extending the functionality for multi-dimensional | ||
data analysis provided by the `HyperSpy <https://hyperspy.org/>`_ library. It is | ||
aimed at helping with the analysis of X-rays Energy Dispersive Spectroscopy (EDS) | ||
and Electron Energy Loss Spectroscopy (EELS). | ||
|
||
Check out the :ref:`installation <install-label>` section for further information, including | ||
how to start using this project. | ||
|
||
.. note:: | ||
|
||
This is an open-source community project: everyone is welcome to contribute. | ||
Please read our (see :ref:`contributing_label`) guidelines and get started! | ||
|
||
Contents | ||
======== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
user_guide/index.rst | ||
reference/index.rst | ||
changes.rst | ||
Citing <citing.rst> | ||
contributing.rst | ||
license.rst | ||
:maxdepth: 1 | ||
:hidden: | ||
|
||
User Guide <user_guide/index> | ||
Examples <auto_examples/index> | ||
Reference <reference/index> | ||
Release Notes <changes> | ||
Citing <citing> | ||
Contribute <contributing> | ||
|
||
.. include:: intro.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ User Guide | |
########## | ||
|
||
.. toctree:: | ||
:caption: User Guide | ||
:maxdepth: 2 | ||
|
||
install | ||
|
Oops, something went wrong.