Skip to content

Commit 9fdfbc5

Browse files
committed
try impl-playwright-pdf-engine branch & test html build with current mkdocs setup
1 parent fb956d6 commit 9fdfbc5

File tree

4 files changed

+157
-20
lines changed

4 files changed

+157
-20
lines changed

.github/workflows/mkdocs_pdf.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ jobs:
8080
- name: convert MDhelp
8181
run: |
8282
cd MDhelp
83-
#mkdocs build
8483
mv mkdocs.yml_pdf mkdocs.yml
85-
ENABLE_PDF_EXPORT=1 mkdocs build
84+
mkdocs build
85+
#ENABLE_PDF_EXPORT=1 mkdocs build
8686
# mv site/GSASII-help.pdf ...
8787
#cp -vr site ../help_test
8888
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
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+
20+
# - name: test installed chrome
21+
# run: |
22+
# which chrome
23+
# chrome --version
24+
25+
- name: install debian chrome
26+
run: |
27+
set -ex
28+
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
29+
sudo apt install ./google-chrome-stable_current_amd64.deb
30+
31+
# - name: test newly-installed chrome
32+
# run: |
33+
# which google-chrome-stable
34+
# google-chrome-stable --version
35+
# /usr/bin/google-chrome-stable --headless --disable-gpu --dump-dom https://google.com
36+
37+
- name: Python setup
38+
uses: actions/setup-python@v3
39+
# - name: Sphinx setup
40+
# run: |
41+
# pip install sphinx sphinx_readable_theme
42+
# - name: pandoc setup
43+
# uses: pandoc/actions/setup@v1
44+
- name: mkdocs setup
45+
run: |
46+
pip install mkdocs mkdocs-material python-markdown-math mkdocs-static-i18n
47+
pip install pymdown-extensions
48+
#pip install mkdocs-to-pdf
49+
pip install git+https://github.com/domWalters/mkdocs-to-pdf.git@impl-playwright-pdf-engine
50+
51+
https://github.com/domWalters/mkdocs-to-pdf.git
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: convert MDhelp
56+
run: |
57+
cd MDhelp
58+
#mkdocs build
59+
mv mkdocs.yml_pdf mkdocs.yml
60+
ENABLE_PDF_EXPORT=1 mkdocs build
61+
# mv site/GSASII-help.pdf ...
62+
#cp -vr site ../help_test
63+
64+
- name: Upload help artifact # creates zip file with website contents
65+
uses: actions/upload-pages-artifact@v3
66+
with:
67+
path: MDhelp/site
68+
name: MDhelp
69+
retention-days: 1
70+
71+
# - name: Get tutorials index from source code
72+
# run: |
73+
# curl -L https://github.com/AdvancedPhotonSource/GSAS-II/raw/master/GSASII/tutorialIndex.py -o scripts/tutorialIndex.py
74+
75+
# - name: convert tutorials
76+
# run: |
77+
# cd MDtutorials
78+
# for path in ./*; do
79+
# [ -d "${path}" ] || continue # skip if not a directory
80+
# dirname="$(basename "${path}")"
81+
# dest="../${dirname}"
82+
# mkdir -pv ${dest}
83+
# [ ! -d "${path}/data" ] || cp -r "${path}/data" ${dest}/
84+
# [ ! -d "${path}/imgs" ] || cp -r "${path}/imgs" ${dest}/
85+
# cp tutorial.css ${dest}
86+
# for fil in $dirname/*.md; do
87+
# outfile="${dest}/$(basename "${fil%.md}.html")"
88+
# echo "creating $outfile from $fil"
89+
# pandoc --standalone ${fil} --css tutorial.css -o ${outfile}
90+
# sed -i "s/<figure>/<BR clear=all><figure>/g" ${outfile}
91+
# done
92+
# git add ${dest}
93+
# done
94+
# cd ..
95+
96+
# - name: build tutorials index
97+
# run: |
98+
# cd scripts
99+
# python makeGitTutorial.py ..
100+
101+
# - name: Note changed files
102+
# run: |
103+
# git add tutorials.html
104+
# git add */data/index.html
105+
# git status
106+
# git commit -m"changes from automated build of tutorials"
107+
# - name: Push changes
108+
# uses: ad-m/github-push-action@master
109+
110+
# - name: Sphinx build
111+
# run: |
112+
# sphinx-build webdocs . # place output into root dir
113+
# cp webdocs/_static/fix.css _static/fix.css # should be done by sphinx
114+
115+
# # get the help pages from the GSAS-II sources into the web site
116+
# - name: Get GSAS-II
117+
# run: |
118+
# git clone --depth 1 https://github.com/AdvancedPhotonSource/GSAS-II.git _gsas2
119+
# - name: move help into site
120+
# run: |
121+
# mv _gsas2/GSASII/help ./help
122+
# - name: Get rid of the rest of the GSAS-II files & other stuff not needed on web
123+
# run: |
124+
# rm -rf _gsas2 webdocs scripts MDtutorials MDhelp
125+
126+
# - name: Upload artifact # creates zip file with website contents
127+
# uses: actions/upload-pages-artifact@v3
128+
# with:
129+
# path: .
130+
# name: github-pages
131+
# retention-days: 1
132+
133+
# deploy: # Deployment of web pages to GitHub pages
134+
# needs: build
135+
# permissions:
136+
# pages: write
137+
# id-token: write
138+
# environment:
139+
# name: github-pages
140+
# url: ${{ steps.deployment.outputs.page_url }}
141+
# runs-on: ubuntu-latest
142+
143+
# steps:
144+
# - name: Deploy to GitHub Pages
145+
# id: deployment
146+
# uses: actions/deploy-pages@v4
147+
# with:
148+
# token: ${{ secrets.GITHUB_TOKEN }}
149+
# artifact_name: github-pages

MDhelp/docs/index.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,16 @@ window and in other locations of the program.
1313
An index on the topics covered in these help pages is given below.
1414

1515
<a name="Index"></a>
16-
1716
1. [Tutorials](./preface.md)
18-
1917
2. [GSAS-II GUI Organization](./applicationwindow.md)
20-
1. [Data Tree](./applicationwindow.md#Data_tree)
21-
1. [Data Window](./applicationwindow.md#Data_frame)
22-
1. [Graphics Window](./applicationwindow.md#Plots)
23-
1. [Console Window](./applicationwindow.md#Console)
24-
18+
1. [Data Tree](./applicationwindow.md#Data_tree)
19+
1. [Data Window](./applicationwindow.md#Data_frame)
20+
1. [Graphics Window](./applicationwindow.md#Plots)
21+
1. [Console Window](./applicationwindow.md#Console)
2522
3. [Main menu contents](./mainmenu.md)
26-
2723
4. Data tree entries and their use ([overview](./datatree.md))
2824
1. [Universal data tree](./commontreeitems.md) items
29-
3025
2. [Phase Data Tree items (overview)](./phaseoverview.md)
31-
3226
* [General Phase tab](./phasegeneral.md)
3327
* [Data Phase tab](./phasedata.md)
3428
* [Atoms Phase tab](./phaseatoms.md)
@@ -44,10 +38,8 @@ An index on the topics covered in these help pages is given below.
4438
* [RMC tab](./phaseRMC.md)
4539
* [ISODISTORT tab](./phaseisodistort.md)
4640
* [Dysnomia tab](./phasedysnomia.md)
47-
4841
3. [Image (IMG)](./image.md) Data Tree entries
49-
4. Powder histogram (PWDR) [overview](./powder.md) and [parent
50-
PWDR data tree entry](./powderparent.md)
42+
4. Powder histogram (PWDR) [overview](./powder.md) and [parent PWDR data tree entry](./powderparent.md)
5143
* [Comments](./powdercomments.md)
5244
* [Limits](./powderlimits.md)
5345
* [Background](./powderbkg.md)

MDhelp/mkdocs.yml_pdf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ plugins:
7171
# - index.md
7272
render_js: true
7373
headless_chrome_path: /usr/bin/google-chrome-stable
74-
# headless_chrome_path: /Users/toby/bin/chromedriver
75-
# relaxedjs_path: /usr/local/bin/relaxed
76-
74+
pdf_engine: chromium
7775
- i18n:
7876
docs_structure: suffix
7977
languages:
@@ -91,8 +89,6 @@ markdown_extensions:
9189
# - mdx_math
9290
- pymdownx.arithmatex:
9391
generic: true
94-
# tex_inline_wrap: ["\\(", "\\)"]
95-
# tex_block_wrap: ["$$", "$$"]
9692

9793
extra_javascript:
9894
- javascripts/mathjax.js

0 commit comments

Comments
 (0)