From 7e808fd3186a07616ffe075aa46cc0c53a6caa89 Mon Sep 17 00:00:00 2001 From: Mac Date: Sun, 26 Mar 2017 23:20:05 -0700 Subject: [PATCH 1/7] listed theme names and updated future work --- guides/theming.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/guides/theming.md b/guides/theming.md index 7e3c86e48543..6715d589fc0a 100644 --- a/guides/theming.md +++ b/guides/theming.md @@ -26,6 +26,12 @@ single css file for Angular Material in your app. You can include a theme file directly into your application from `@angular/material/core/theming/prebuilt` +Avalible pre-built themes: +* `deeppurple-amber.css` +* `indigo-pink.css` +* `pink-bluegrey.css` +* `purple-green.css` + If you're using Angular CLI, this is as simple as including one line in your `styles.css` file: ```css @@ -133,3 +139,4 @@ For more details about theming your own components, see [theming-your-components ### Future work * Once CSS variables (custom properties) are available in all the browsers we support, we will explore how to take advantage of them to make theming even simpler. +* More prebuilt themes will be added as development continues. From 2cc307c7556d5607c373d6eac103cd0feaccd91f Mon Sep 17 00:00:00 2001 From: Mac Date: Mon, 27 Mar 2017 00:49:54 -0700 Subject: [PATCH 2/7] typo fix --- guides/theming.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/theming.md b/guides/theming.md index 6715d589fc0a..5217a17eb110 100644 --- a/guides/theming.md +++ b/guides/theming.md @@ -26,7 +26,7 @@ single css file for Angular Material in your app. You can include a theme file directly into your application from `@angular/material/core/theming/prebuilt` -Avalible pre-built themes: +Available pre-built themes: * `deeppurple-amber.css` * `indigo-pink.css` * `pink-bluegrey.css` From 692fc2fd79c4f2f071f83621fda02a830930b74d Mon Sep 17 00:00:00 2001 From: Mac Date: Mon, 27 Mar 2017 10:27:40 -0700 Subject: [PATCH 3/7] List directory DIRECTORY_PATTERN added. Allows documents to specify a path to list all files from. --- tools/gulp/tasks/docs.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/gulp/tasks/docs.ts b/tools/gulp/tasks/docs.ts index 9007f9df2334..431d235a160c 100644 --- a/tools/gulp/tasks/docs.ts +++ b/tools/gulp/tasks/docs.ts @@ -21,6 +21,11 @@ const EXAMPLE_PATTERN = //g; // documentation page. Using a RegExp to rewrite links in HTML files to work in the docs. const LINK_PATTERN = /(]*) href="([^"]*)"/g; +// Some docs require maintaining a list of files. +// Supplying a directory as a argument will list the files at that directory. +// Supplying no arguments will list the files at the root of that folder. +const DIRECTORY_PATTERN = //g; + task('docs', ['markdown-docs', 'highlight-docs', 'api-docs']); task('markdown-docs', () => { @@ -77,10 +82,29 @@ function transformMarkdownFiles(buffer: Buffer, file: any): string { // If the head is not prepended to the replaced value, then the first match will be lost. `${head} href="${fixMarkdownDocLinks(link, file.path)}"` ); + + /* Replace comments with HTML elements. */ + content = content.replace(DIRECTORY_PATTERN, (match: string, directory: string) => + `
${listFiles(directory,file.path)}
` ) return content; } +/** Returns a list of files from a given directory */ +function listFiles(directory: string, filePath: string): string { + // If no directory is supplied, take the directory from the filePath. + if(directory === '') { + directory = .dirname(filePath.base); + } + + // Get all the files in the directory, just store their names in a list. + let files = gulp.src(directory).map((path) => { + return '
  • ' + path.basename() + '
  • '; + }).join(); + + return '
      ' + files + '
    '; +} + /** Fixes paths in the markdown files to work in the material-docs-io. */ function fixMarkdownDocLinks(link: string, filePath: string): string { // As for now, only markdown links that are relative and inside of the guides/ directory From 8fd0e2ea1a525dbf83171e5ba8eca84a1dae7492 Mon Sep 17 00:00:00 2001 From: Mac Date: Mon, 27 Mar 2017 10:37:33 -0700 Subject: [PATCH 4/7] added directory comment call for gulp --- guides/theming.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/guides/theming.md b/guides/theming.md index d0dfeffc19fa..59d51029fd57 100644 --- a/guides/theming.md +++ b/guides/theming.md @@ -27,10 +27,7 @@ You can include a theme file directly into your application from `@angular/material/core/theming/prebuilt` Available pre-built themes: -* `deeppurple-amber.css` -* `indigo-pink.css` -* `pink-bluegrey.css` -* `purple-green.css` + If you're using Angular CLI, this is as simple as including one line in your `styles.css` file: From e5df00047f23b9cb59dcff59aad15e3de4dae93b Mon Sep 17 00:00:00 2001 From: Mac Date: Mon, 27 Mar 2017 10:41:24 -0700 Subject: [PATCH 5/7] missing ); --- tools/gulp/tasks/docs.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/gulp/tasks/docs.ts b/tools/gulp/tasks/docs.ts index 354f7657252d..6a113f0adb3d 100644 --- a/tools/gulp/tasks/docs.ts +++ b/tools/gulp/tasks/docs.ts @@ -116,7 +116,8 @@ function transformMarkdownFiles(buffer: Buffer, file: any): string { /* Replace comments with HTML elements. */ content = content.replace(DIRECTORY_PATTERN, (match: string, directory: string) => `
    ${listFiles(directory,file.path)}
    ` ) - + ); + return content; } From 6846dee13f1bfcdd954c92f57a6b551a5f4f3df3 Mon Sep 17 00:00:00 2001 From: Mac Date: Mon, 27 Mar 2017 10:42:18 -0700 Subject: [PATCH 6/7] strings in gulp functions don't require quotes --- guides/theming.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/theming.md b/guides/theming.md index 59d51029fd57..cf6b9c05f4fc 100644 --- a/guides/theming.md +++ b/guides/theming.md @@ -27,7 +27,7 @@ You can include a theme file directly into your application from `@angular/material/core/theming/prebuilt` Available pre-built themes: - + If you're using Angular CLI, this is as simple as including one line in your `styles.css` file: From 1d98597d7572d9c52f4b29d0e90de00e2028072e Mon Sep 17 00:00:00 2001 From: Mac Date: Mon, 27 Mar 2017 13:06:48 -0700 Subject: [PATCH 7/7] Update docs.ts --- tools/gulp/tasks/docs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gulp/tasks/docs.ts b/tools/gulp/tasks/docs.ts index 6a113f0adb3d..3bb1c07f1b48 100644 --- a/tools/gulp/tasks/docs.ts +++ b/tools/gulp/tasks/docs.ts @@ -115,7 +115,7 @@ function transformMarkdownFiles(buffer: Buffer, file: any): string { /* Replace comments with HTML elements. */ content = content.replace(DIRECTORY_PATTERN, (match: string, directory: string) => - `
    ${listFiles(directory,file.path)}
    ` ) + `
    ${listFiles(directory,file.path)}
    ` ); return content;