Skip to content

Commit e67ffc9

Browse files
committed
chore(docs): Add docs snippet extraction script
1 parent 3c6f5ab commit e67ffc9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

build-doc-snippets.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
DIST_DIR="bin/dist"
5+
TARGET_DIR="$DIST_DIR/snippets"
6+
PACKAGE_VERSION="${PACKAGE_VERSION:-0.0.0}"
7+
8+
extractSnippets() {
9+
BIN="./node_modules/markdown-snippet-injector/extract.js"
10+
node "$BIN" --root="." --target="$TARGET_DIR" \
11+
--sourceext=".js|.ts|.xml|.html|.css"
12+
}
13+
14+
npm install markdown-snippet-injector
15+
rm -rf "$TARGET_DIR"
16+
mkdir -p "$TARGET_DIR"
17+
18+
extractSnippets
19+
20+
(cd "$DIST_DIR" && tar zcvf "nativescript-angular-snippets-$PACKAGE_VERSION.tar.gz" snippets)

0 commit comments

Comments
 (0)