Skip to content

Commit

Permalink
tools: update marked dependency
Browse files Browse the repository at this point in the history
Update module marked. Customize renderer to remove id from heading.

PR-URL: #6396
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
firedfox authored and addaleax committed May 7, 2016
1 parent 4d4cfb2 commit 3f69ea5
Show file tree
Hide file tree
Showing 18 changed files with 2,052 additions and 438 deletions.
10 changes: 5 additions & 5 deletions test/doctool/test-doctool-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var testData = [
'added': ['v1.0.0']
},
'desc': '<p>Describe <code>Foobar</code> in more detail ' +
'here.\n\n</p>\n',
'here.</p>\n',
'type': 'module',
'displayName': 'Foobar'
},
Expand All @@ -92,7 +92,7 @@ var testData = [
'added': ['v5.3.0', 'v4.2.0']
},
'desc': '<p>Describe <code>Foobar II</code> in more detail ' +
'here.\n\n</p>\n',
'here.</p>\n',
'type': 'module',
'displayName': 'Foobar II'
},
Expand All @@ -104,15 +104,15 @@ var testData = [
'deprecated': ['v2.0.0']
},
'desc': '<p>Describe <code>Deprecated thingy</code> in more ' +
'detail here.\n\n</p>\n',
'detail here.</p>\n',
'type': 'module',
'displayName': 'Deprecated thingy'
},
{
'textRaw': 'Something',
'name': 'something',
'desc': '<!-- This is not a metadata comment -->\n\n<p>' +
'Describe <code>Something</code> in more detail here.\n</p>\n',
'desc': '<!-- This is not a metadata comment -->\n<p>' +
'Describe <code>Something</code> in more detail here.</p>\n',
'type': 'module',
'displayName': 'Something'
}
Expand Down
9 changes: 9 additions & 0 deletions tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ const typeParser = require('./type-parser.js');

module.exports = toHTML;

// customized heading without id attribute
var renderer = new marked.Renderer();
renderer.heading = function(text, level) {
return '<h' + level + '>' + text + '</h' + level + '>\n';
};
marked.setOptions({
renderer: renderer
});

// TODO(chrisdickinson): never stop vomitting / fix this.
var gtocPath = path.resolve(path.join(
__dirname,
Expand Down
9 changes: 9 additions & 0 deletions tools/doc/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ module.exports = doJSON;
const common = require('./common.js');
const marked = require('marked');

// customized heading without id attribute
var renderer = new marked.Renderer();
renderer.heading = function(text, level) {
return '<h' + level + '>' + text + '</h' + level + '>\n';
};
marked.setOptions({
renderer: renderer
});

function doJSON(input, filename, cb) {
var root = {source: filename};
var stack = [root];
Expand Down
5 changes: 5 additions & 0 deletions tools/doc/node_modules/marked/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions tools/doc/node_modules/marked/Gulpfile.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/doc/node_modules/marked/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion tools/doc/node_modules/marked/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3f69ea5

Please sign in to comment.