added make-example

This commit is contained in:
Jay Traband 2015-08-08 18:08:07 -07:00
parent 9b61d586bf
commit df077c1dc2
4 changed files with 23 additions and 2 deletions

View File

@ -23,6 +23,14 @@
// we will almost certainly never go 10 or 11 deep but ... // we will almost certainly never go 10 or 11 deep but ...
- var pathToFrags = "../../../../../../../../../../../".substr(0, (currentPath.length-2)*3) + "_fragments/"; - var pathToFrags = "../../../../../../../../../../../".substr(0, (currentPath.length-2)*3) + "_fragments/";
mixin makeExample(path, fileName, title)
- var extn = getExtn(fileName);
- var extPath = pathToFrags + path + "/";
if (title)
.example-title #{title}
code-example(language="#{extn}" format="linenums")
!= getFrag(extPath + fileName + ".md")
mixin makeTabs(path, fileNames, tabNames) mixin makeTabs(path, fileNames, tabNames)
- fileNames = fileNames.split(","); - fileNames = fileNames.split(",");
- tabNames = tabNames.split(",") - tabNames = tabNames.split(",")
@ -32,7 +40,6 @@ mixin makeTabs(path, fileNames, tabNames)
- var tabName = tabNames[index].trim(); - var tabName = tabNames[index].trim();
- var fileName = fileNames[index].trim(); - var fileName = fileNames[index].trim();
- var extn = getExtn(fileName); - var extn = getExtn(fileName);
// - var extPath = pathToFrags + (path.length ? path + "/" : "");
- var extPath = pathToFrags + path + "/"; - var extPath = pathToFrags + path + "/";
code-pane(language="#{extn}" name="#{tabName}" format="linenums") code-pane(language="#{extn}" name="#{tabName}" format="linenums")
!= getFrag(extPath + fileName + ".md") != getFrag(extPath + fileName + ".md")

View File

@ -116,4 +116,5 @@ include ../../../../_includes/_util-fns
In ES5 the script file creates an angular property on the window of the browser. This property contains every piece of Angular core, whether you need it or not. In ES5 the script file creates an angular property on the window of the browser. This property contains every piece of Angular core, whether you need it or not.
+makeTabs('gettingstarted', 'ts/main-import.ts', 'TypeScript') +makeTabs('gettingstarted', 'ts/main-import.ts', 'TypeScript')
+makeTabs('gettingstarted', 'ts/main-bootstrap.ts,js/main-bootstrap.js', 'TypeScript, JavaScript')
+makeExample('gettingstarted/js', 'main-bootstrap.js', 'JavaScript')

View File

@ -40,6 +40,7 @@
@import 'module/shadow'; @import 'module/shadow';
@import 'module/showcase'; @import 'module/showcase';
@import 'module/statement'; @import 'module/statement';
@import 'module/example-title';
/* /*

View File

@ -0,0 +1,12 @@
.example-title {
@extend .alert;
color: $snow;
padding: 0 ($unit * 2);
font-size: 14px;
font-weight: 500;
border-color: $blueberry;
background: $blueberry;
// temporary hack to remove space between example title and code-example
margin-bottom: -18px;
}