Skip to content

Commit

Permalink
build: publish material-examples package to docs content (#4064)
Browse files Browse the repository at this point in the history
  • Loading branch information
devversion authored and jelbourn committed Apr 13, 2017
1 parent 60ea218 commit 205690f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions scripts/release/publish-docs-content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
cd "$(dirname $0)/../../"

docsPath="./dist/docs"
packagePath="./dist/releases/material-examples"
repoPath="/tmp/material2-docs-content"
repoUrl="https://github.com/angular/material2-docs-content"
examplesSource="./dist/docs/examples"

# If the docs directory is not present, generate docs
if [ ! -d $docsPath ]; then
$(npm bin)/gulp docs
fi
$(npm bin)/gulp examples:release
$(npm bin)/gulp docs

# Get git meta info for commit
commitSha="$(git rev-parse --short HEAD)"
Expand All @@ -28,15 +27,16 @@ git clone $repoUrl $repoPath

# Clean out repo directory and copy contents of dist/docs into it
rm -rf $repoPath/*
mkdir $repoPath/overview
mkdir $repoPath/guides
mkdir $repoPath/api
mkdir $repoPath/examples
mkdir $repoPath/plunker

# Create folders that will contain docs content files.
mkdir $repoPath/{overview,guides,api,examples,plunker,examples-package}

# Copy api files over to $repoPath/api
cp -r $docsPath/api/* $repoPath/api

# Copy the material-examples package to the docs content repository.
cp -r $packagePath/* $repoPath/examples-package

# Flatten the markdown docs structure and move it into $repoPath/overview
overviewFiles=$docsPath/markdown/
for filename in $overviewFiles*
Expand Down Expand Up @@ -65,7 +65,7 @@ done
cp -r $examplesSource/* $repoPath/examples

# Copy example plunker assets
rsync -a $docsPath/plunker $repoPath/plunker
cp -r $docsPath/plunker/* $repoPath/plunker

# Copies assets over to the docs-content repository.
cp LICENSE $repoPath/
Expand Down
4 changes: 2 additions & 2 deletions tools/gulp/tasks/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ task('highlight-examples', () => {
path.basename = `${path.basename}-${extension}`;
};

return src('src/examples/**/*.+(html|css|ts)')
return src('src/material-examples/**/*.+(html|css|ts)')
.pipe(flatten())
.pipe(rename(renameFile))
.pipe(highlight())
Expand All @@ -111,7 +111,7 @@ task('minified-api-docs', ['api-docs'], () => {

/** Copies example sources to be used as plunker assets for the docs site. */
task('plunker-example-assets', () => {
src(path.join(SOURCE_ROOT, 'examples', '**/*'))
src(path.join(SOURCE_ROOT, 'material-examples', '**/*'))
.pipe(dest(path.join(DIST_DOCS, 'plunker', 'examples')));
});

Expand Down

0 comments on commit 205690f

Please sign in to comment.