diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7fe7cee..ee4f6b0 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -49,6 +49,23 @@ jobs: with: path: flake8_report.txt name: flake8_report + - name: Doc + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }} + run: | + pip install --upgrade pdoc3 jupyter nbconvert + pdoc3 -f --html -o doc/ MDRefine + ( cd Examples && ./render.sh ) + mkdir doc/examples + cp Examples/*html doc/examples/ + ( sudo apt-get install tree && cd doc/examples && tree -H '.' -L 1 --noreport --charset utf-8 > index.html ) + ( sudo apt-get install pandoc texlive-xetex && pdoc3 -f --pdf MDRefine > MDRefine.md && pandoc --metadata=title:"MDRefine Documentation" --from=markdown+abbreviations+tex_math_single_backslash --pdf-engine=xelatex --toc --toc-depth=4 --output=doc/MDRefine.pdf MDRefine.md ) + tar czf doc.tgz doc/ + - name: Upload doc to artifact + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }} + uses: actions/upload-artifact@v3 + with: + path: doc.tgz + name: doc - name: Deploy PyPI if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' && startsWith(github.ref, 'refs/tags/') }} diff --git a/Examples/render.sh b/Examples/render.sh new file mode 100644 index 0000000..9a7e445 --- /dev/null +++ b/Examples/render.sh @@ -0,0 +1,8 @@ + +for file in *.ipynb +do + +jupyter nbconvert --to html $file + +done +