Add sphinx for documentation building

This commit is contained in:
Alejandro Gallo 2022-03-10 14:46:55 +01:00
parent 5b3321348a
commit 9cceaac1c1
9 changed files with 73 additions and 27 deletions

View File

@ -50,28 +50,25 @@ jobs:
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- name: Create index - name: Install dependencies
run: |
echo hello world > index.html
- name: Create atrip.html
run: |
nix-shell --run 'make html'
mv atrip.html docs/
- name: Doxygen
run: | run: |
cd docs cd docs
nix-shell --run 'make all' nix-shell --run 'emacs --version'
nix-shell --run 'python --version'
nix-shell --run 'sphinx-build --version'
- name: Make all
run: |
cd docs
make all
- name: Make sphinx as the main
run: |
cd docs
mv sphinx/* .
- name: Deploy - name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.0 uses: JamesIves/github-pages-deploy-action@4.1.0
with: with:
branch: gh-pages branch: gh-pages
folder: ./docs folder: ./docs
#- name: Upload dist
#uses: actions/upload-artifacts@v1
#with:
#name: lib
#path: ./lib

3
.gitignore vendored
View File

@ -1,4 +1,7 @@
.emacs .emacs
*.rst
doxygen
sphinx
include/dbg.h include/dbg.h
doc/doxygen/ doc/doxygen/

View File

@ -48,7 +48,7 @@ $(ATRIP_STATIC_LIBRARY): $(OBJ_FILES)
$(SOURCES_FILE): config.el $(SOURCES_FILE): config.el
echo -n "ATRIP_SOURCES = " > $@ echo -n "ATRIP_SOURCES = " > $@
$(EMACS) --eval '(atrip-print-sources)' >> $@ $(EMACS) -f atrip-print-sources >> $@
print: print:
$(info $(filter-out %.hpp,$(ATRIP_SOURCES))) $(info $(filter-out %.hpp,$(ATRIP_SOURCES)))
@ -102,7 +102,10 @@ EMACS_HTML = $(EMACS) --load ./etc/emacs/html.el
HTML_MAIN = $(patsubst %.org,%.html,$(ORG_MAIN)) HTML_MAIN = $(patsubst %.org,%.html,$(ORG_MAIN))
html: $(HTML_MAIN) html: $(HTML_MAIN)
%.html: %.org %.html: %.org
$(EMACS_HTML) $< --eval "(org-html-export-to-html)" $(EMACS_HTML) $< -f org-html-export-to-html
%.rst: %.org
$(EMACS_HTML) $< -f org-rst-export-to-rst
.PHONY: dbg .PHONY: dbg
dbg: include/dbg.h dbg: include/dbg.h

View File

@ -1,8 +1,16 @@
#+title: ATRIP: An MPI-asynchronous implementation of CCSD(T) #+title: ATRIP: An MPI-asynchronous implementation of CCSD(T)
#+PROPERTY: header-args+ :noweb yes :comments noweb :mkdirp t #+PROPERTY: header-args+ :noweb yes :comments noweb :mkdirp t
#+begin_export rst
.. toctree::
:maxdepth: 2
atrip
#+end_export
* About this document * About this document
- [[./atrip.org][Literate program]]
- [[https://alejandrogallo.github.io/atrip/doxygen/html/index.html][Doxygen]] - [[https://alejandrogallo.github.io/atrip/doxygen/html/index.html][Doxygen]]
- [[https://alejandrogallo.github.io/atrip/atrip.html][Literate program]] - [[https://alejandrogallo.github.io/atrip/atrip.html][Literate program]]

View File

@ -2038,7 +2038,7 @@ MAN_LINKS = NO
# captures the structure of the code including all documentation. # captures the structure of the code including all documentation.
# The default value is: NO. # The default value is: NO.
GENERATE_XML = NO GENERATE_XML = YES
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of

View File

@ -1,7 +1,24 @@
DOXYGEN_INDEX = doxygen/html/index.html DOXYGEN_INDEX = doxygen/html/index.html
all: $(DOXYGEN_INDEX) all: $(DOXYGEN_INDEX) sphinx
$(DOXYGEN_INDEX): $(DOXYGEN_INDEX):
doxygen Doxyfile doxygen Doxyfile
.PHONY: sphinx
SPHINX_BUILD_DIR = sphinx
$(SPHINX_BUILD_DIR)/index.html: index.rst atrip.rst conf.py
sphinx-build . $(SPHINX_BUILD_DIR)
sphinx: $(SPHINX_BUILD_DIR)/index.html
index.rst: ../README.rst
mv $< $@
atrip.rst: ../atrip.rst
mv $< $@
../%.rst:
make -C $(dir $@) $(notdir $@)
clean:
rm -rfv sphinx doxygen/ index.rst atrip.rst

12
docs/conf.py Normal file
View File

@ -0,0 +1,12 @@
project = 'Atrip'
copyright = '2022, Alejandro Gallo'
author = 'Alejandro Gallo'
extensions = [ 'breathe' ]
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'nature'
html_static_path = ['_static']
breathe_projects = { "atrip": "doxygen/xml/" }
breathe_default_project = "atrip"

View File

@ -2,8 +2,16 @@
pkgs.mkShell rec { pkgs.mkShell rec {
imports = [ ../shell.nix ];
buildInputs = with pkgs; [ buildInputs = with pkgs; [
emacs
emacsPackages.ox-rst
emacsPackages.htmlize
python3
python3Packages.breathe
doxygen doxygen
sphinx
]; ];
} }

View File

@ -17,17 +17,15 @@
(use-package htmlize (use-package htmlize
:ensure t) :ensure t)
(use-package ox-rst
:ensure t)
(require 'org) (require 'org)
;(use-package org-plus-contrib
; :ensure
;(use-package org-src
;:ensure t)
(setq org-src-fontify-natively t (setq org-src-fontify-natively t
org-src-preserve-indentation t org-src-preserve-indentation t
org-src-tab-acts-natively t) org-src-tab-acts-natively t)
(load-theme 'tsdh-light) (load-theme 'tsdh-light)
(require 'ox-html) (require 'ox-html)
(require 'ox-rst)