Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools/build pdfs only when needed #84

Merged
merged 34 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4223d37
build-pdf: optionally build one pdf
ralfhandl Aug 3, 2023
3f3afd3
nodejs.yml: only rebuild PDFs whose input has changed
ralfhandl Aug 3, 2023
8f35adf
Update 0 frontmatter.md
ralfhandl Aug 3, 2023
5c4d908
auto-refreshed
ralfhandl Aug 3, 2023
e168412
Update 0 frontmatter.md
ralfhandl Aug 3, 2023
a41a318
Merge branch 'tools/build-pdfs-only-when-needed' of https://github.co…
ralfhandl Aug 3, 2023
5a7e8cb
auto-refreshed
ralfhandl Aug 3, 2023
72716fb
Merge branch 'main' into tools/build-pdfs-only-when-needed
ralfhandl Aug 3, 2023
d2fa3e3
Update 0 frontmatter.md
ralfhandl Aug 3, 2023
1a8b3ad
auto-refreshed
ralfhandl Aug 3, 2023
45bdf42
Update 0 frontmatter.md
ralfhandl Aug 3, 2023
ccb0bf1
Merge branch 'tools/build-pdfs-only-when-needed' of https://github.co…
ralfhandl Aug 3, 2023
2eb5517
auto-refreshed
ralfhandl Aug 3, 2023
27a1301
Update nodejs.yml
ralfhandl Aug 3, 2023
d874e60
Simplified
ralfhandl Aug 3, 2023
eafe0ba
Update 0 frontmatter.md
ralfhandl Aug 3, 2023
eef45a4
auto-refreshed
ralfhandl Aug 3, 2023
79529c7
Update 0 frontmatter.md
ralfhandl Aug 3, 2023
431faf9
Merge branch 'tools/build-pdfs-only-when-needed' of https://github.co…
ralfhandl Aug 3, 2023
745cac9
auto-refreshed
ralfhandl Aug 3, 2023
5d54b59
Update build-pdf.js
ralfhandl Aug 3, 2023
f8a0a74
Merge branch 'tools/build-pdfs-only-when-needed' of https://github.co…
ralfhandl Aug 3, 2023
3386c51
Update 0 frontmatter.md
ralfhandl Aug 3, 2023
82f68ff
auto-refreshed
ralfhandl Aug 3, 2023
dd4c3f1
Update nodejs.yml
ralfhandl Aug 3, 2023
5cbdde0
Merge branch 'tools/build-pdfs-only-when-needed' of https://github.co…
ralfhandl Aug 3, 2023
8e60545
Update meta.yaml
ralfhandl Aug 3, 2023
8c719fb
auto-refreshed
ralfhandl Aug 3, 2023
1137754
Update 0 frontmatter.md
ralfhandl Aug 3, 2023
f4978c9
Update 0 frontmatter.md
ralfhandl Aug 3, 2023
cfe0e35
auto-refreshed
ralfhandl Aug 3, 2023
6055a52
Update nodejs.yml
ralfhandl Aug 3, 2023
aa72f44
Merge branch 'tools/build-pdfs-only-when-needed' of https://github.co…
ralfhandl Aug 3, 2023
855006d
Update nodejs.yml
ralfhandl Aug 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Node CI

on: push
on:
push:

jobs:
build:
Expand All @@ -24,11 +25,17 @@ jobs:
- name: Build docs
run: |
npm ci
npm run build --if-present
npm run build
git config user.name ${GITHUB_ACTOR}
git config user.email ${PUSHER_EMAIL}
git add docs/*/*.html docs/*/*.md docs/*/styles/*
git diff-index --quiet HEAD docs/*/*.html docs/*/*.md docs/*/styles/* || (npm run pdf --if-present && git add docs/*/*.pdf && git commit -m "auto-refreshed")
test `git branch --show-current` && git push
for dir in docs/*/ # list directories in the form "docs/dirname/"
do
doc=${dir%/} # remove the trailing "/"
doc=${doc##*/} # retain everything after the final "/"
git diff-index --quiet HEAD $dir/*.html $dir/styles/* || npm run pdf $doc
done
git add docs/*/*.pdf
git diff-index --quiet HEAD docs/* || ( git commit -m "auto-refreshed" && git push )
env:
PUSHER_EMAIL: ${{ github.event.pusher.email }}
Binary file modified docs/odata-protocol/odata-protocol.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/odata-url-conventions/odata-url-conventions.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>OData Version 4.01. Part 2: URL Conventions</title>
<title>OData Version 4.02. Part 2: URL Conventions</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
Expand Down Expand Up @@ -32,7 +32,7 @@
<h1 id="odata-version-402-part-2-url-conventions">OData Version 4.02. Part 2: URL Conventions</h1>
<h2 id="committee-specification-draft-01">Committee Specification Draft 01</h2>
<h2 id="14-july-2023">14 July 2023</h2>
<p> </p>
<p><span class="math inline">\(\hbox{}\)</span></p>
<h4 id="this-stage">This stage:</h4>
<p><a href="https://docs.oasis-open.org/odata/odata/v4.02/csd01/odata-v4.02-csd01-part2-url-conventions.md">https://docs.oasis-open.org/odata/odata/v4.02/csd01/odata-v4.02-csd01-part2-url-conventions.md</a> (Authoritative)<br />
<a href="https://docs.oasis-open.org/odata/odata/v4.02/csd01/odata-v4.02-csd01-part2-url-conventions.html">https://docs.oasis-open.org/odata/odata/v4.02/csd01/odata-v4.02-csd01-part2-url-conventions.html</a><br />
Expand Down Expand Up @@ -143,7 +143,7 @@ <h3 id="123-document-conventions"><a name="Documentconventions" href="#Documentc
--mathjax
--eol=lf
--wrap=none
--metadata pagetitle=&quot;OData Version 4.01. Part 2: URL Conventions&quot;
--metadata pagetitle=&quot;OData Version 4.02. Part 2: URL Conventions&quot;
odata-v4.02-csd01-part2-url-conventions.md</code></pre>
<p>This uses pandoc 3.1.2 from <a href="https://github.com/jgm/pandoc/releases/tag/3.1.2">https://github.com/jgm/pandoc/releases/tag/3.1.2</a>.</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/odata-url-conventions/odata-url-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## 14 July 2023

&nbsp;
$\hbox{}$

#### This stage:
https://docs.oasis-open.org/odata/odata/v4.02/csd01/odata-v4.02-csd01-part2-url-conventions.md (Authoritative) \
Expand Down Expand Up @@ -154,7 +154,7 @@ pandoc -f gfm+tex_math_dollars+fenced_divs
--mathjax
--eol=lf
--wrap=none
--metadata pagetitle="OData Version 4.01. Part 2: URL Conventions"
--metadata pagetitle="OData Version 4.02. Part 2: URL Conventions"
odata-v4.02-csd01-part2-url-conventions.md
```

Expand Down
Binary file modified docs/odata-url-conventions/odata-url-conventions.pdf
Binary file not shown.
13 changes: 10 additions & 3 deletions lib/build-pdf.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
const iterator = require("./iterator");
const pdf = require("./pdf.js");

const doc = process.argv[2];

iterator(function (srcname, name, variant, meta) {
pdf(name, variant, meta)
if (doc && doc !== name) return;
pdf(name, variant, meta, doc === name)
.then((refreshed) => {
console.log(refreshed ? "✓" : "=", srcname, variant);
console.log(
refreshed ? "✓" : "=",
srcname,
variant === "meta" ? "" : variant
);
})
.catch((error) => {
console.log("❌", srcname, variant);
console.log("❌", srcname, variant === "meta" ? "" : variant);
console.error(error);
process.exitCode = 1;
});
Expand Down
6 changes: 3 additions & 3 deletions odata-url-conventions/0 frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

-------

# OData Version 4.02. Part 2: URL Conventions
# $$$pagetitle$$$

## Committee Specification Draft 01
## $$$subtitle$$$

## 14 July 2023

&nbsp;
$\hbox{}$

#### This stage:
https://docs.oasis-open.org/odata/odata/v4.02/$$$stage$$$/$$$filename$$$.md (Authoritative) \
Expand Down
2 changes: 1 addition & 1 deletion odata-url-conventions/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pagetitle: 'OData Version 4.01. Part 2: URL Conventions'
pagetitle: 'OData Version 4.02. Part 2: URL Conventions'
subtitle: Committee Specification Draft 01
filename: odata-v4.02-csd01-part2-url-conventions
stage: csd01
Expand Down