Skip to content

Commit cf07938

Browse files
committed
Set current versions as title for API docs
1 parent 2826921 commit cf07938

File tree

5 files changed

+37
-21
lines changed

5 files changed

+37
-21
lines changed

api-docs-gen/app-title.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'json'
4+
5+
bundles = %w(stompjs rx-stomp)
6+
7+
parts = bundles.map do |l|
8+
version = JSON.parse(File.read("#{ENV['BASE']}/#{l}/package.json"))['version']
9+
"#{l}@#{version}"
10+
end
11+
12+
puts parts.join(', ')

api-docs-gen/config.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,2 @@
11
export BASE=`dirname $0`/consolidated
22
export BUNDLES="stompjs rx-stomp ng2-stompjs"
3-
4-
if [[ "$BRANCH" == "develop" ]]
5-
then
6-
export DESTINATION=../api-docs/develop/
7-
export THEME=postmark
8-
export MESSAGE="These docs correspond to development versions. Please see [api-docs](../latest/) for NPM released versions."
9-
else
10-
export DESTINATION=../api-docs/latest/
11-
export THEME=vagrant
12-
export MESSAGE="These docs correspond to NPM released main line versions. Please see [dev docs](../develop/) for development versions."
13-
fi

api-docs-gen/doc-gen.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,21 @@ export BRANCH=${BRANCH:-develop}
66

77
source `dirname $0`/config.sh
88

9+
if [[ "$BRANCH" == "develop" ]]
10+
then
11+
export DESTINATION=../api-docs/develop/
12+
export THEME=postmark
13+
export MESSAGE="These docs correspond to development versions. Please see [api-docs](../latest/) for NPM released versions."
14+
else
15+
export DESTINATION=../api-docs/latest/
16+
export THEME=vagrant
17+
export MESSAGE="These docs correspond to NPM released main line versions. Please see [dev docs](../develop/) for development versions."
18+
fi
19+
20+
APP_TITLE=`./app-title.rb`
21+
922
# Change to the Node application with Compodoc installed
10-
cd $BASE/..
23+
cd "$BASE"/..
1124

1225
# It will be used by Jekyll pages to show current versions
1326
`dirname $0`/pkg-versions.rb > ../_data/versions/$BRANCH.json
@@ -16,10 +29,11 @@ cd $BASE/..
1629
sed -e "3i$MESSAGE\n" README-src.md > README.md
1730

1831
# Clear the previously generated doc and regenerate
19-
rm -rf $DESTINATION
32+
rm -rf "$DESTINATION"
2033
./node_modules/.bin/compodoc \
2134
-p tsconfig.json \
22-
-d $DESTINATION \
35+
-d "$DESTINATION" \
2336
--disablePrivate --disableProtected --disableInternal --disableGraph \
24-
--theme $THEME --hideGenerator \
37+
--theme "$THEME" --hideGenerator \
38+
-n "$APP_TITLE" \
2539
"$@"

api-docs-gen/docs-refresh.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ export BRANCH=${1:-master}
55

66
source `dirname $0`/config.sh
77

8-
rm -rf $BASE
9-
mkdir -p $BASE
10-
cd $BASE
8+
rm -rf "$BASE"
9+
mkdir -p "$BASE"
10+
cd "$BASE"
1111

1212

1313
for bundle in $BUNDLES
@@ -17,4 +17,5 @@ do
1717
mv $bundle-$BRANCH $bundle
1818
done
1919

20+
cd -
2021
`dirname $0`/doc-gen.sh

api-docs-gen/local-refresh.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env bash
22

3-
# Generatinf locally, by default assume devlop
3+
# Generating locally, by default assume develop
44
export BRANCH=${1:-develop}
55

66
source `dirname $0`/config.sh
77

8-
mkdir -p $BASE
9-
cd $BASE
8+
mkdir -p "$BASE"
9+
cd "$BASE"
1010

1111
for bundle in $BUNDLES
1212
do

0 commit comments

Comments
 (0)