From 6b8ed42670039f53d2b20dc1079f742840f62ae9 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 10 Nov 2010 12:02:49 -0800 Subject: Added Directives --- docs/collect.js | 14 ++++++++++++-- docs/directive.template | 37 +++++++++++++++++++++++++++++++++++++ docs/doc_widgets.js | 4 ++-- docs/index.html | 30 ++++++++++++++++-------------- docs/spec/collectSpec.js | 4 ++-- 5 files changed, 69 insertions(+), 20 deletions(-) create mode 100644 docs/directive.template (limited to 'docs') diff --git a/docs/collect.js b/docs/collect.js index 2d43669a..08bb6be3 100644 --- a/docs/collect.js +++ b/docs/collect.js @@ -127,7 +127,8 @@ function escapedHtmlTag(doc, name, value) { } function markdownTag(doc, name, value) { - doc[name] = markdown(value.replace(/^#/gm, '##')); + doc[name] = markdown(value.replace(/^#/gm, '##')). + replace(/\
/gmi, '');
}
function markdown(text) {
@@ -135,6 +136,14 @@ function markdown(text) {
return new Showdown.converter().makeHtml(text);
}
+function markdownNoP(text) {
+ var lines = markdown(text).split(NEW_LINE);
+ var last = lines.length - 1;
+ lines[0] = lines[0].replace(/^/, '');
+ lines[last] = lines[last].replace(/<\/p>$/, '');
+ return lines.join('\n');
+}
+
var TAG = {
ngdoc: valueTag,
example: escapedHtmlTag,
@@ -149,6 +158,7 @@ var TAG = {
returns: markdownTag,
paramDescription: markdownTag,
exampleDescription: markdownTag,
+ element: valueTag,
name: function(doc, name, value) {
doc.name = value;
var match = value.match(/^angular[\.\#](([^\.]+)\.(.*)|(.*))/);
@@ -163,7 +173,7 @@ var TAG = {
type: match[2],
name: match[6] || match[5],
'default':match[7],
- description:value.replace(match[0], match[8])
+ description:markdownNoP(value.replace(match[0], match[8]))
};
doc.param.push(param);
if (!doc.paramFirst) {
diff --git a/docs/directive.template b/docs/directive.template
new file mode 100644
index 00000000..84b87ca7
--- /dev/null
+++ b/docs/directive.template
@@ -0,0 +1,37 @@
+
{{name}}
+Description
+{{{description}}}
+
+Usage
+In HTML Template Binding
+
+
+<{{element}} {{shortName}}="{{paramFirst.name}}">
+ ...
+</{{element}}>
+
+
+
+Parameters
+