-
Notifications
You must be signed in to change notification settings - Fork 5
161 lines (138 loc) · 5.1 KB
/
Copy pathmkdocs_pdf.yml
File metadata and controls
161 lines (138 loc) · 5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# work on building PDFs from the .md help files
name: test MD help to .pdf
#on: [workflow_dispatch]
on: [push, workflow_dispatch]
permissions:
contents: write
id-token: write
pages: write
jobs:
build: # Build web pages
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Install RelaxedJS globally
run: npm install -g relaxedjs
#- name: Install RelaxedJS locally
# run: npm install relaxedjs
- name: find relaxedjs
run: |
which relaxedjs
exit
# - name: Setup chromium
# uses: browser-actions/setup-chrome@v1
# id: setup-chrome
# with:
# install-dependencies: true
# install-chromedriver: true
# - run: |
# echo ${{ steps.setup-chrome.outputs.chrome-path }} --version
# ${{ steps.setup-chrome.outputs.chrome-path }} --version
# - name: test installed chrome
# run: |
# ${{ steps.setup-chrome.outputs.chrome-path }} --no-sandbox --headless --disable-gpu --dump-dom https://google.com
# - name: test system chromium
# run: |
# /usr/bin/chromium-browser --no-sandbox --headless --disable-gpu --dump-dom https://google.com
- name: Python setup
uses: actions/setup-python@v3
# - name: Sphinx setup
# run: |
# pip install sphinx sphinx_readable_theme
# - name: pandoc setup
# uses: pandoc/actions/setup@v1
- name: mkdocs setup
run: |
pip install mkdocs mkdocs-material python-markdown-math mkdocs-static-i18n
#pip install weasyprint
#pip install mkdocs-with-pdf
pip install mkdocs-to-pdf
#weasyprint --info
- name: Checkout
uses: actions/checkout@v4
- name: convert MDhelp
run: |
cd MDhelp
mkdocs build
#mv mkdocs.yml_pdf mkdocs.yml
# ENABLE_PDF_EXPORT=1 mkdocs build
# mv site/GSASII-help.pdf ...
#cp -vr site ../help_test
- name: Upload help artifact # creates zip file with website contents
uses: actions/upload-pages-artifact@v3
with:
path: MDhelp/site
name: MDhelp
retention-days: 1
# - name: Get tutorials index from source code
# run: |
# curl -L https://github.com/AdvancedPhotonSource/GSAS-II/raw/master/GSASII/tutorialIndex.py -o scripts/tutorialIndex.py
# - name: convert tutorials
# run: |
# cd MDtutorials
# for path in ./*; do
# [ -d "${path}" ] || continue # skip if not a directory
# dirname="$(basename "${path}")"
# dest="../${dirname}"
# mkdir -pv ${dest}
# [ ! -d "${path}/data" ] || cp -r "${path}/data" ${dest}/
# [ ! -d "${path}/imgs" ] || cp -r "${path}/imgs" ${dest}/
# cp tutorial.css ${dest}
# for fil in $dirname/*.md; do
# outfile="${dest}/$(basename "${fil%.md}.html")"
# echo "creating $outfile from $fil"
# pandoc --standalone ${fil} --css tutorial.css -o ${outfile}
# sed -i "s/<figure>/<BR clear=all><figure>/g" ${outfile}
# done
# git add ${dest}
# done
# cd ..
# - name: build tutorials index
# run: |
# cd scripts
# python makeGitTutorial.py ..
# - name: Note changed files
# run: |
# git add tutorials.html
# git add */data/index.html
# git status
# git commit -m"changes from automated build of tutorials"
# - name: Push changes
# uses: ad-m/github-push-action@master
# - name: Sphinx build
# run: |
# sphinx-build webdocs . # place output into root dir
# cp webdocs/_static/fix.css _static/fix.css # should be done by sphinx
# # get the help pages from the GSAS-II sources into the web site
# - name: Get GSAS-II
# run: |
# git clone --depth 1 https://github.com/AdvancedPhotonSource/GSAS-II.git _gsas2
# - name: move help into site
# run: |
# mv _gsas2/GSASII/help ./help
# - name: Get rid of the rest of the GSAS-II files & other stuff not needed on web
# run: |
# rm -rf _gsas2 webdocs scripts MDtutorials MDhelp
# - name: Upload artifact # creates zip file with website contents
# uses: actions/upload-pages-artifact@v3
# with:
# path: .
# name: github-pages
# retention-days: 1
# deploy: # Deployment of web pages to GitHub pages
# needs: build
# permissions:
# pages: write
# id-token: write
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# runs-on: ubuntu-latest
# steps:
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v4
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# artifact_name: github-pages