Skip to content

Commit ec9c139

Browse files
committed
start developing mkdocs to pdf
1 parent ea24aa8 commit ec9c139

File tree

2 files changed

+123
-2
lines changed

2 files changed

+123
-2
lines changed

.github/workflows/mkdocs_pdf.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# work on building PDFs from the .md help files
2+
3+
4+
name: test MD help to .pdf
5+
6+
#on: [workflow_dispatch]
7+
on: [push, workflow_dispatch]
8+
9+
permissions:
10+
contents: write
11+
id-token: write
12+
pages: write
13+
14+
jobs:
15+
build: # Build web pages
16+
runs-on: ubuntu-latest
17+
steps:
18+
19+
- name: Python setup
20+
uses: actions/setup-python@v3
21+
# - name: Sphinx setup
22+
# run: |
23+
# pip install sphinx sphinx_readable_theme
24+
- name: pandoc setup
25+
uses: pandoc/actions/setup@v1
26+
- name: mkdocs setup
27+
run: |
28+
pip install mkdocs mkdocs-material python-markdown-math mkdocs-static-i18n
29+
pip install weasyprint
30+
pip install mkdocs-with-pdf
31+
pip install mkdocs-to-pdf
32+
weasyprint --info
33+
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: convert MDhelp
38+
run: |
39+
cd MDhelp
40+
mkdocs build
41+
cp -vr site ../help_test
42+
43+
# - name: Get tutorials index from source code
44+
# run: |
45+
# curl -L https://github.com/AdvancedPhotonSource/GSAS-II/raw/master/GSASII/tutorialIndex.py -o scripts/tutorialIndex.py
46+
47+
# - name: convert tutorials
48+
# run: |
49+
# cd MDtutorials
50+
# for path in ./*; do
51+
# [ -d "${path}" ] || continue # skip if not a directory
52+
# dirname="$(basename "${path}")"
53+
# dest="../${dirname}"
54+
# mkdir -pv ${dest}
55+
# [ ! -d "${path}/data" ] || cp -r "${path}/data" ${dest}/
56+
# [ ! -d "${path}/imgs" ] || cp -r "${path}/imgs" ${dest}/
57+
# cp tutorial.css ${dest}
58+
# for fil in $dirname/*.md; do
59+
# outfile="${dest}/$(basename "${fil%.md}.html")"
60+
# echo "creating $outfile from $fil"
61+
# pandoc --standalone ${fil} --css tutorial.css -o ${outfile}
62+
# sed -i "s/<figure>/<BR clear=all><figure>/g" ${outfile}
63+
# done
64+
# git add ${dest}
65+
# done
66+
# cd ..
67+
68+
# - name: build tutorials index
69+
# run: |
70+
# cd scripts
71+
# python makeGitTutorial.py ..
72+
73+
# - name: Note changed files
74+
# run: |
75+
# git add tutorials.html
76+
# git add */data/index.html
77+
# git status
78+
# git commit -m"changes from automated build of tutorials"
79+
# - name: Push changes
80+
# uses: ad-m/github-push-action@master
81+
82+
# - name: Sphinx build
83+
# run: |
84+
# sphinx-build webdocs . # place output into root dir
85+
# cp webdocs/_static/fix.css _static/fix.css # should be done by sphinx
86+
87+
# # get the help pages from the GSAS-II sources into the web site
88+
# - name: Get GSAS-II
89+
# run: |
90+
# git clone --depth 1 https://github.com/AdvancedPhotonSource/GSAS-II.git _gsas2
91+
# - name: move help into site
92+
# run: |
93+
# mv _gsas2/GSASII/help ./help
94+
# - name: Get rid of the rest of the GSAS-II files & other stuff not needed on web
95+
# run: |
96+
# rm -rf _gsas2 webdocs scripts MDtutorials MDhelp
97+
98+
# - name: Upload artifact # creates zip file with website contents
99+
# uses: actions/upload-pages-artifact@v3
100+
# with:
101+
# path: .
102+
# name: github-pages
103+
# retention-days: 1
104+
105+
# deploy: # Deployment of web pages to GitHub pages
106+
# needs: build
107+
# permissions:
108+
# pages: write
109+
# id-token: write
110+
# environment:
111+
# name: github-pages
112+
# url: ${{ steps.deployment.outputs.page_url }}
113+
# runs-on: ubuntu-latest
114+
115+
# steps:
116+
# - name: Deploy to GitHub Pages
117+
# id: deployment
118+
# uses: actions/deploy-pages@v4
119+
# with:
120+
# token: ${{ secrets.GITHUB_TOKEN }}
121+
# artifact_name: github-pages

.github/workflows/test_builddocsite.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
name: test MD help w/build GSAS-II web site
1313

14-
#on: [workflow_dispatch]
15-
on: [push, workflow_dispatch]
14+
on: [workflow_dispatch]
15+
#on: [push, workflow_dispatch]
1616

1717
permissions:
1818
contents: write

0 commit comments

Comments
 (0)