Skip to content

Commit

Permalink
use sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
jinluchang committed Nov 5, 2024
1 parent 09f6970 commit 3df8380
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 4 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and Test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Show info
run: |
whoami
pwd
type python3
type pip3
- name: Install Ubuntu packages
run: |
sudo apt-get update
sudo apt-get install -y git bzip2 autoconf unzip
sudo apt-get install -y python3-full python3-dev
- name: Show python venv
run: |
pip3 install Sphinx myst-parser linkify-it-py
python3 -c "import sys; print(sys.version)"
python3 -c "import sys; print(sys.path)"
- name: Build qlat-docs
run: |
make html
[ -f $PWD/build/html/index.html ]
- uses: actions/upload-artifact@v4
with:
name: html
path: build/html
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: build/html

deploy_docs:
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
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)
35 changes: 35 additions & 0 deletions make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
1 change: 0 additions & 1 deletion 00-notation.md → source/00-notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ $$
\newcommand{\Bra}{\Big\rangle}
\newcommand{\Bla}{\Big\langle}
\newcommand{\ud}{\mathrm{d}}
\newcommand{\a}{a}
\nn
$$

Expand Down
5 changes: 2 additions & 3 deletions 01-pi0-tff.md → source/01-pi0-tff.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ $$
\newcommand{\Bra}{\Big\rangle}
\newcommand{\Bla}{\Big\langle}
\newcommand{\ud}{\mathrm{d}}
\newcommand{\a}{a}
\nn
$$

# Notation related to $\pi^0\to \gamma\gamma$
# Related to $\pi^0\to \gamma\gamma$

**Based on Euclidean notation (not the same as the $\gamma_5$ notation used in the code).**

Expand Down Expand Up @@ -88,7 +87,7 @@ i
\end{align}
$$

### OPE relation
## OPE relation

At small $x$:

Expand Down
File renamed without changes.
50 changes: 50 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'notations'
copyright = 'Luchang Jin'
author = 'Luchang Jin'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx.ext.duration",
"sphinx.ext.doctest",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"myst_parser",
]

myst_enable_extensions = [
"amsmath",
"attrs_inline",
"colon_fence",
"deflist",
"dollarmath",
"fieldlist",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"strikethrough",
"substitution",
"tasklist",
]

# templates_path = ['_templates']
exclude_patterns = []

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'
# html_static_path = ['_static']
25 changes: 25 additions & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.. notations documentation master file, created by
sphinx-quickstart on Mon Nov 4 15:35:02 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
notations
=========

.. math::
.. toctree::
:maxdepth: 2
:caption: Contents:

00-notation.md

01-pi0-tff.md


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

0 comments on commit 3df8380

Please sign in to comment.