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

Commit

Permalink
feat(doc-gen): Use new docviewer for generating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
naomiblack authored and mhevery committed Mar 3, 2014
1 parent 99d9f2a commit 67fcaff
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 53 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ dartium
**/*.dart.js.map
**/*.dart.precompiled.js
docs.angulardart.org
dartdoc-viewer
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AngularDart [![Build Status](https://travis-ci.org/angular/angular.dart.png?branch=master)](https://travis-ci.org/angular/angular.dart)

This comment has been minimized.

Copy link
@jbdeboer

jbdeboer Mar 5, 2014

Contributor

Was this change intentional?

This comment has been minimized.

Copy link
@vicb

vicb Mar 6, 2014

Contributor

I think it's because the build status is already shown by GH on the top of the page

This comment has been minimized.

Copy link
@naomiblack

naomiblack Mar 11, 2014

Author Contributor

It was in fact because the docgen process can't handle inline images in the README file during conversion.

AngularDart
============

A port of [Angular][ng] to [Dart][dart].
Expand Down
92 changes: 43 additions & 49 deletions scripts/generate-documentation.sh
Original file line number Diff line number Diff line change
@@ -1,53 +1,47 @@
#!/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="--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 $MODE_OPTION $DOCDIR_OPTION"
"$DOC_CMD" $MODE_OPTION $DOCDIR_OPTION \
--package-root=packages/ \
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
# Dart doc can not be run from the same directory as dartdoc-viewer
# see: https://code.google.com/p/dart/issues/detail?id=17231
cd lib

echo "Generating documentation"
"$DART_DOCGEN" $DOC_OPTION $DOCDIR_OPTION \
--out ../docs \
--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 \
--package-root=../packages/ \
../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

cd ..

DOCVIEWER_DIR="dartdoc-viewer";
if [ ! -d "$DOCVIEWER_DIR" ]; then
git clone https://github.com/angular/dartdoc-viewer.git -b angular-skin $DOCVIEWER_DIR
fi;

head CHANGELOG.md | awk 'NR==2' | sed 's/^# //' > docs/VERSION
rm -rf $DOCVIEWER_DIR/client/web/docs/
mv docs/ $DOCVIEWER_DIR/client/web/docs/
(cd $DOCVIEWER_DIR/client; pub build)
6 changes: 3 additions & 3 deletions scripts/travis/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ if [ "$CHANNEL" = "stable" ]; then
git clone https://github.com/angular/docs.angulardart.org.git

echo "Removing old stable docs..."
rm -rf docs.angulardart.org/stable/*.*
rm -rf docs.angulardart.org/docs

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

#.git folder needs to be in the *project* root
Expand All @@ -28,7 +28,7 @@ if [ "$CHANNEL" = "stable" ]; then
git config user.name "travis@travis-ci.org"

echo "Adding files..."
git add stable/*.*
git add .
git commit -m "Automated push of generated docs from SHA: $SHA"
git push
fi
Expand Down

0 comments on commit 67fcaff

Please sign in to comment.