Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
fix(doc-gen): add docviewer flags for generating the new angulardart …
Browse files Browse the repository at this point in the history
…docs

Conflicts:
	scripts/generate-documentation.sh
  • Loading branch information
naomiblack authored and mhevery committed Mar 2, 2014
1 parent a6fdb4c commit 99d9f2a
Showing 1 changed file with 39 additions and 6 deletions.
45 changes: 39 additions & 6 deletions scripts/generate-documentation.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,53 @@
#!/bin/bash
. $(dirname $0)/env.sh

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

case $opt in
d)
DOCVIEWER_DIR=$OPTARG
DOCDIR_OPTION="--out "$DOCVIEWER_DIR"/web/docs"
echo "Generated docs will be output to: $DOCVIEWER_DIR/web/docs" >&2
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Use -d to specify the directory where the dartdoc viewer pubspec.yaml is located." >&2
exit 1
;;
esac
done

# Temporary change to delete the Build Status image markdown from the README (image md not supported by dartdoc-viewer)
cp README.md README-orig.md
cat README-orig.md | sed "1s/^AngularDart.*/AngularDart/" > README.md

# Temporary during transition period from use of dartdoc to docgen.
if [ -x "$DART_DOCGEN" ]; then
DOC_CMD="$DART_DOCGEN"
MODE_OPTION=
MODE_OPTION="--start-page=angular \
--exclude-lib=js,metadata,meta,mirrors,intl,number_symbols,number_symbol_data,intl_helpers,date_format_internal,date_symbols,angular.util \
--no-include-sdk"

elif [ -x "$DARTDOC" ]; then
DOC_CMD="$DARTDOC"
MODE_OPTION="--mode=static"
fi

echo "Generating documentation using $DOC_CMD"
"$DOC_CMD" $MODE_OPTION \
echo "Generating documentation using $DOC_CMD $MODE_OPTION $DOCDIR_OPTION"
"$DOC_CMD" $MODE_OPTION $DOCDIR_OPTION \
--package-root=packages/ \
--out doc \
--exclude-lib=js,metadata,meta,mirrors,intl,number_symbols,number_symbol_data,intl_helpers,date_format_internal,date_symbols,angular.util \
packages/angular/angular.dart lib/mock/module.dart
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

if [ -x "$DART_DOCGEN" ]; then
# Set the Version for dartdoc-viewer
head CHANGELOG.md | awk 'NR==2' | sed 's/^# //' > VERSION
mv VERSION $DOCVIEWER_DIR/web/docs
(cd $DOCVIEWER_DIR; pub build)

# Revert the temp copy of the README.md file
mv README-orig.md README.md
fi

0 comments on commit 99d9f2a

Please sign in to comment.