Skip to content

Commit 3d83a95

Browse files
committed
Build HTML from src/oas.md
1 parent 77c76f8 commit 3d83a95

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ atlassian-ide-plugin.xml
77
node_modules/
88
deploy/
99
coverage/
10+
src-preview/
1011
history
1112
Gemfile.lock

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"license": "Apache-2.0",
1515
"scripts": {
1616
"build": "bash ./scripts/md2html/build.sh",
17+
"build-src": "bash ./scripts/md2html/build-src.sh",
1718
"test": "c8 --100 vitest --watch=false && bash scripts/schema-test-coverage.sh",
1819
"validate-markdown": "npx mdv src/oas.md && npx markdownlint-cli src/oas.md"
1920
},

scripts/md2html/build-src.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
# Author: @ralfhandl
4+
5+
# run this script from the root of the repo
6+
7+
mkdir -p deploy/oas
8+
mkdir -p deploy/js
9+
mkdir -p src-preview
10+
11+
cd scripts/md2html
12+
13+
cp -p ../../node_modules/respec/builds/respec-w3c.* ../../deploy/js/
14+
15+
filename=src/oas.md
16+
tempfile=../../deploy/oas/oas.html
17+
echo "=== ${filename} ==="
18+
19+
node md2html.js --maintainers ../../EDITORS.md ../../${filename} > $tempfile
20+
npx respec --use-local --src $tempfile --out ../../src-preview/oas.html
21+
rm $tempfile
22+
23+
echo Built src-preview/oas.html
24+
echo
25+
26+
rm ../../deploy/js/respec-w3c.*

0 commit comments

Comments
 (0)