Skip to content

Commit 67fcaff

Browse files
naomiblackmhevery
authored andcommitted
feat(doc-gen): Use new docviewer for generating docs
1 parent 99d9f2a commit 67fcaff

File tree

4 files changed

+48
-53
lines changed

4 files changed

+48
-53
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ dartium
1616
**/*.dart.js.map
1717
**/*.dart.precompiled.js
1818
docs.angulardart.org
19+
dartdoc-viewer

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AngularDart [![Build Status](https://travis-ci.org/angular/angular.dart.png?branch=master)](https://travis-ci.org/angular/angular.dart)
1+
AngularDart
22
============
33

44
A port of [Angular][ng] to [Dart][dart].

scripts/generate-documentation.sh

Lines changed: 43 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,47 @@
11
#!/bin/bash
22
. $(dirname $0)/env.sh
33

4-
# Use the -d flag to set the directory for the dartdoc viewer build files
5-
while getopts ":d:" opt ; do
64

7-
case $opt in
8-
d)
9-
DOCVIEWER_DIR=$OPTARG
10-
DOCDIR_OPTION="--out "$DOCVIEWER_DIR"/web/docs"
11-
echo "Generated docs will be output to: $DOCVIEWER_DIR/web/docs" >&2
12-
;;
13-
\?)
14-
echo "Invalid option: -$OPTARG" >&2
15-
exit 1
16-
;;
17-
:)
18-
echo "Use -d to specify the directory where the dartdoc viewer pubspec.yaml is located." >&2
19-
exit 1
20-
;;
21-
esac
22-
done
23-
24-
# Temporary change to delete the Build Status image markdown from the README (image md not supported by dartdoc-viewer)
25-
cp README.md README-orig.md
26-
cat README-orig.md | sed "1s/^AngularDart.*/AngularDart/" > README.md
27-
28-
# Temporary during transition period from use of dartdoc to docgen.
29-
if [ -x "$DART_DOCGEN" ]; then
30-
DOC_CMD="$DART_DOCGEN"
31-
MODE_OPTION="--start-page=angular \
32-
--exclude-lib=js,metadata,meta,mirrors,intl,number_symbols,number_symbol_data,intl_helpers,date_format_internal,date_symbols,angular.util \
33-
--no-include-sdk"
34-
35-
elif [ -x "$DARTDOC" ]; then
36-
DOC_CMD="$DARTDOC"
37-
MODE_OPTION="--mode=static"
38-
fi
39-
40-
echo "Generating documentation using $DOC_CMD $MODE_OPTION $DOCDIR_OPTION"
41-
"$DOC_CMD" $MODE_OPTION $DOCDIR_OPTION \
42-
--package-root=packages/ \
43-
lib/angular.dart lib/utils.dart lib/change_detection/watch_group.dart lib/core/module.dart lib/core_dom/module.dart lib/filter/module.dart lib/directive/module.dart lib/mock/module.dart lib/perf/module.dart lib/playback/playback_data.dart lib/playback/playback_http.dart lib/routing/module.dart lib/tools/common.dart lib/tools/expression_extractor.dart lib/tools/io.dart lib/tools/io_impl.dart lib/tools/source_crawler_impl.dart lib/tools/source_metadata_extractor.dart lib/tools/template_cache_annotation.dart lib/tools/template_cache_generator.dart
44-
45-
if [ -x "$DART_DOCGEN" ]; then
46-
# Set the Version for dartdoc-viewer
47-
head CHANGELOG.md | awk 'NR==2' | sed 's/^# //' > VERSION
48-
mv VERSION $DOCVIEWER_DIR/web/docs
49-
(cd $DOCVIEWER_DIR; pub build)
50-
51-
# Revert the temp copy of the README.md file
52-
mv README-orig.md README.md
53-
fi
5+
# Dart doc can not be run from the same directory as dartdoc-viewer
6+
# see: https://code.google.com/p/dart/issues/detail?id=17231
7+
cd lib
8+
9+
echo "Generating documentation"
10+
"$DART_DOCGEN" $DOC_OPTION $DOCDIR_OPTION \
11+
--out ../docs \
12+
--start-page=angular \
13+
--exclude-lib=js,metadata,meta,mirrors,intl,number_symbols,number_symbol_data,intl_helpers,date_format_internal,date_symbols,angular.util \
14+
--no-include-sdk \
15+
--package-root=../packages/ \
16+
../lib/angular.dart \
17+
../lib/utils.dart \
18+
../lib/change_detection/watch_group.dart \
19+
../lib/core/module.dart \
20+
../lib/core_dom/module.dart \
21+
../lib/filter/module.dart \
22+
../lib/directive/module.dart \
23+
../lib/mock/module.dart \
24+
../lib/perf/module.dart \
25+
../lib/playback/playback_data.dart \
26+
../lib/playback/playback_http.dart \
27+
../lib/routing/module.dart \
28+
../lib/tools/common.dart \
29+
../lib/tools/expression_extractor.dart \
30+
../lib/tools/io.dart \
31+
../lib/tools/io_impl.dart \
32+
../lib/tools/source_crawler_impl.dart \
33+
../lib/tools/source_metadata_extractor.dart \
34+
../lib/tools/template_cache_annotation.dart \
35+
../lib/tools/template_cache_generator.dart
36+
37+
cd ..
38+
39+
DOCVIEWER_DIR="dartdoc-viewer";
40+
if [ ! -d "$DOCVIEWER_DIR" ]; then
41+
git clone https://github.com/angular/dartdoc-viewer.git -b angular-skin $DOCVIEWER_DIR
42+
fi;
43+
44+
head CHANGELOG.md | awk 'NR==2' | sed 's/^# //' > docs/VERSION
45+
rm -rf $DOCVIEWER_DIR/client/web/docs/
46+
mv docs/ $DOCVIEWER_DIR/client/web/docs/
47+
(cd $DOCVIEWER_DIR/client; pub build)

scripts/travis/publish-docs.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ if [ "$CHANNEL" = "stable" ]; then
1616
git clone https://github.com/angular/docs.angulardart.org.git
1717

1818
echo "Removing old stable docs..."
19-
rm -rf docs.angulardart.org/stable/*.*
19+
rm -rf docs.angulardart.org/docs
2020

2121
echo "Copying new docs into stable folder..."
22-
rsync -av doc/*.* docs.angulardart.org/stable/
22+
rsync -a dartdoc-viewer/client/build/web/* docs.angulardart.org/
2323
cd docs.angulardart.org/
2424

2525
#.git folder needs to be in the *project* root
@@ -28,7 +28,7 @@ if [ "$CHANNEL" = "stable" ]; then
2828
git config user.name "[email protected]"
2929

3030
echo "Adding files..."
31-
git add stable/*.*
31+
git add .
3232
git commit -m "Automated push of generated docs from SHA: $SHA"
3333
git push
3434
fi

0 commit comments

Comments
 (0)