Navigation Menu

Skip to content

Commit

Permalink
Partially reverts 58c78f
Browse files Browse the repository at this point in the history
The change of convers.js on the commit was about debug printing.
  • Loading branch information
darashi committed Aug 15, 2012
1 parent 58c78f9 commit c2dcbaa
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions tools/convert.js
Expand Up @@ -24,13 +24,6 @@ function htmlToText(html, callback) {
});
}

function titleToId(title) {
return title
.toLowerCase()
.replace(/[^a-z0-9]+/g, '_')
.replace(/^_|_$/g, '');
}

function parse(doc, context) {
var item = {};

Expand All @@ -46,8 +39,6 @@ function parse(doc, context) {
if (doc.desc) {
item.desc = doc.desc;
item.title = context.title;
item.id = titleToId(context.title);
console.log([item.id, item.title]);
item.path = context.path.map(function(item) {
return item.title;
}).filter(function(title) {
Expand All @@ -58,7 +49,6 @@ function parse(doc, context) {

context.path.push(item);
for (var type in doc) {
console.log("TYPE", type);
if (doc[type] instanceof Array) {
doc[type].forEach(function(subdoc) {
parse(subdoc, context);
Expand All @@ -74,7 +64,7 @@ function toSdf(records) {
var version = (new Date()).getTime();

return records.map(function(record, index) {
//console.log(index, record.path, record.title);
console.log(index, record.path, record.title);
return {
type: 'add',
id: 'doc_' + index,
Expand Down

0 comments on commit c2dcbaa

Please sign in to comment.