diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 34d30ca..10ad8b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,28 +50,25 @@ jobs: with: nix_path: nixpkgs=channel:nixos-unstable - - name: Create index - run: | - echo hello world > index.html - - - name: Create atrip.html - run: | - nix-shell --run 'make html' - mv atrip.html docs/ - - - name: Doxygen + - name: Install dependencies run: | 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 uses: JamesIves/github-pages-deploy-action@4.1.0 with: branch: gh-pages folder: ./docs - - #- name: Upload dist - #uses: actions/upload-artifacts@v1 - #with: - #name: lib - #path: ./lib diff --git a/.gitignore b/.gitignore index 4818c3a..1228ff3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ .emacs +*.rst +doxygen +sphinx include/dbg.h doc/doxygen/ diff --git a/Makefile b/Makefile index 81cf136..d8e2bd6 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ $(ATRIP_STATIC_LIBRARY): $(OBJ_FILES) $(SOURCES_FILE): config.el echo -n "ATRIP_SOURCES = " > $@ - $(EMACS) --eval '(atrip-print-sources)' >> $@ + $(EMACS) -f atrip-print-sources >> $@ print: $(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: $(HTML_MAIN) %.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 dbg: include/dbg.h diff --git a/README.org b/README.org index 06b6f4a..a40c83d 100644 --- a/README.org +++ b/README.org @@ -1,8 +1,16 @@ #+title: ATRIP: An MPI-asynchronous implementation of CCSD(T) #+PROPERTY: header-args+ :noweb yes :comments noweb :mkdirp t +#+begin_export rst +.. toctree:: + :maxdepth: 2 + + atrip +#+end_export + * About this document +- [[./atrip.org][Literate program]] - [[https://alejandrogallo.github.io/atrip/doxygen/html/index.html][Doxygen]] - [[https://alejandrogallo.github.io/atrip/atrip.html][Literate program]] diff --git a/docs/Doxyfile b/docs/Doxyfile index 8b74392..3bcf171 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -2038,7 +2038,7 @@ MAN_LINKS = NO # captures the structure of the code including all documentation. # 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 # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of diff --git a/docs/Makefile b/docs/Makefile index 58422d8..2f40e3f 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,7 +1,24 @@ DOXYGEN_INDEX = doxygen/html/index.html -all: $(DOXYGEN_INDEX) +all: $(DOXYGEN_INDEX) sphinx $(DOXYGEN_INDEX): 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 diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..d037402 --- /dev/null +++ b/docs/conf.py @@ -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" + diff --git a/docs/shell.nix b/docs/shell.nix index 3713566..18a736c 100644 --- a/docs/shell.nix +++ b/docs/shell.nix @@ -2,8 +2,16 @@ pkgs.mkShell rec { + imports = [ ../shell.nix ]; + buildInputs = with pkgs; [ + emacs + emacsPackages.ox-rst + emacsPackages.htmlize + python3 + python3Packages.breathe doxygen + sphinx ]; } diff --git a/etc/emacs/html.el b/etc/emacs/html.el index dd45103..d1fdd38 100644 --- a/etc/emacs/html.el +++ b/etc/emacs/html.el @@ -17,17 +17,15 @@ (use-package htmlize :ensure t) +(use-package ox-rst + :ensure t) + (require 'org) -;(use-package org-plus-contrib -; :ensure - -;(use-package org-src - ;:ensure t) - (setq org-src-fontify-natively t org-src-preserve-indentation t org-src-tab-acts-natively t) (load-theme 'tsdh-light) (require 'ox-html) +(require 'ox-rst)