Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit df077c1

Browse files
committed
added make-example
1 parent 9b61d58 commit df077c1

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

public/_includes/_util-fns.jade

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
// we will almost certainly never go 10 or 11 deep but ...
2424
- var pathToFrags = "../../../../../../../../../../../".substr(0, (currentPath.length-2)*3) + "_fragments/";
2525

26+
mixin makeExample(path, fileName, title)
27+
- var extn = getExtn(fileName);
28+
- var extPath = pathToFrags + path + "/";
29+
if (title)
30+
.example-title #{title}
31+
code-example(language="#{extn}" format="linenums")
32+
!= getFrag(extPath + fileName + ".md")
33+
2634
mixin makeTabs(path, fileNames, tabNames)
2735
- fileNames = fileNames.split(",");
2836
- tabNames = tabNames.split(",")
@@ -32,7 +40,6 @@ mixin makeTabs(path, fileNames, tabNames)
3240
- var tabName = tabNames[index].trim();
3341
- var fileName = fileNames[index].trim();
3442
- var extn = getExtn(fileName);
35-
// - var extPath = pathToFrags + (path.length ? path + "/" : "");
3643
- var extPath = pathToFrags + path + "/";
3744
code-pane(language="#{extn}" name="#{tabName}" format="linenums")
3845
!= getFrag(extPath + fileName + ".md")

public/docs/js/latest/guide/setupAlt.jade

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,5 @@ include ../../../../_includes/_util-fns
116116
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.
117117

118118
+makeTabs('gettingstarted', 'ts/main-import.ts', 'TypeScript')
119-
+makeTabs('gettingstarted', 'ts/main-bootstrap.ts,js/main-bootstrap.js', 'TypeScript, JavaScript')
119+
120+
+makeExample('gettingstarted/js', 'main-bootstrap.js', 'JavaScript')

public/resources/css/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
@import 'module/shadow';
4141
@import 'module/showcase';
4242
@import 'module/statement';
43+
@import 'module/example-title';
4344

4445

4546
/*
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.example-title {
2+
@extend .alert;
3+
4+
color: $snow;
5+
padding: 0 ($unit * 2);
6+
font-size: 14px;
7+
font-weight: 500;
8+
border-color: $blueberry;
9+
background: $blueberry;
10+
// temporary hack to remove space between example title and code-example
11+
margin-bottom: -18px;
12+
}

0 commit comments

Comments
 (0)