Skip to content

Commit

Permalink
Whitespace only change
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRalphson committed Sep 28, 2017
1 parent fa63c85 commit ee076a6
Show file tree
Hide file tree
Showing 7 changed files with 1,268 additions and 1,258 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

52 changes: 26 additions & 26 deletions apiblueprint.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
function convert(api, options, callback) {
api = api.split('\r').join('');
var lines = api.split('\n');
var title = '';
var metadata = [];
var index = 0;
while ((lines[index].indexOf(':')>=0) && (index<lines.length)) {
metadata.push('> '+lines[index]+'\n');
lines[index] = '';
index++;
}
while (!lines[index].startsWith('# ') && !lines[index].startsWith('==') && (index<lines.length)) {
index++;
}
if (lines[index].startsWith('# ')) {
title = lines[index];
}
else {
title = lines[index-1];
}
lines.splice(index+1, 0, ...metadata);
api = lines.join('\n');
lines = [];
api = '\n'+api+'\n';
api = '---\ntitle: '+(title.replace('# ',''))+'\n'+`language_tabs:
api = api.split('\r').join('');
var lines = api.split('\n');
var title = '';
var metadata = [];
var index = 0;
while ((lines[index].indexOf(':')>=0) && (index<lines.length)) {
metadata.push('> '+lines[index]+'\n');
lines[index] = '';
index++;
}
while (!lines[index].startsWith('# ') && !lines[index].startsWith('==') && (index<lines.length)) {
index++;
}
if (lines[index].startsWith('# ')) {
title = lines[index];
}
else {
title = lines[index-1];
}
lines.splice(index+1, 0, ...metadata);
api = lines.join('\n');
lines = [];
api = '\n'+api+'\n';
api = '---\ntitle: '+(title.replace('# ',''))+'\n'+`language_tabs:
toc_footers: []
includes: []
search: true
highlight_theme: darkula
---
` + api;
callback(null, api);
callback(null, api);
}

module.exports = {
convert : convert
convert : convert
};
Loading

0 comments on commit ee076a6

Please sign in to comment.