Browse Source

Update

pull/2092/head
jlukic 10 years ago
parent
commit
081e7c8cc5
1 changed files with 16 additions and 12 deletions
  1. 28
      tasks/docs/metadata.js

28
tasks/docs/metadata.js

@ -54,8 +54,7 @@ function parser(file, callback) {
lines = text.split('\n') lines = text.split('\n')
filename = file.path.substring(0, file.path.length - 4), filename = file.path.substring(0, file.path.length - 4),
key = 'server/documents', key = 'server/documents',
position = filename.indexOf(key), position = filename.indexOf(key)
categories
; ;
// exit conditions // exit conditions
@ -72,6 +71,14 @@ function parser(file, callback) {
lineCount = lines.length, lineCount = lines.length,
active = false, active = false,
yaml = [], yaml = [],
categories = [
'UI Element',
'UI Global',
'UI Collection',
'UI View',
'UI Module',
'UI Behavior'
],
index, index,
meta, meta,
line line
@ -95,24 +102,21 @@ function parser(file, callback) {
yaml.push(line); yaml.push(line);
} }
categories = [
'UI Element',
'UI Collection',
'UI View',
'UI Module',
'UI Behavior'
];
// Parse yaml. // Parse yaml.
meta = YAML.parse(yaml.join('\n')); meta = YAML.parse(yaml.join('\n'));
if(meta && inArray(meta.category, categories) && meta.title !== undefined) { if(meta && meta.type && meta.title && inArray(meta.type, categories) ) {
meta.category = meta.type; meta.category = meta.type;
meta.filename = filename; meta.filename = filename;
meta.title = meta.title; meta.title = meta.title;
// Primary key will by filepath
data[filename] = meta;
}
else {
// skip
// console.log(meta);
} }
// Primary key will by filepath
data[filename] = meta;
} }

|||||||
100:0
Loading…
Cancel
Save