Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: update marked dependency #6396

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't really fit the style of this file. I guess we shoul to es6ify the doctool later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two lines below this, template strings are used :P

Copy link
Contributor Author

@firedfox firedfox May 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's a problem. I think I'd better change the template string to string replace (edit: or just string add) in order to keep the style consistent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, I also used template strings in #6495, I don’t really think that’s a problem. And sorry for the merge conflict, btw, but that should be limited to the package.json.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't matter. I rebased upstream and resolved the conflict.
I just changed the template to string add before I saw your latest comment :D
I think either is OK. At least the style is consistent now. We can es6ify it later.

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