Skip to content

Commit 5606f0b

Browse files
rubystargos
authored andcommitted
tools: create HTML docs with unified/remark/rehype
PR-URL: #21490 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent bd352f0 commit 5606f0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+21501
-658
lines changed

LICENSE

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,57 @@ The externally maintained libraries used by Node.js are:
11971197
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11981198
"""
11991199

1200+
- unified, located at deps/unified, is licensed as follows:
1201+
"""
1202+
(The MIT License)
1203+
1204+
Copyright (c) 2015 Titus Wormer <[email protected]>
1205+
1206+
Permission is hereby granted, free of charge, to any person obtaining a copy
1207+
of this software and associated documentation files (the "Software"), to deal
1208+
in the Software without restriction, including without limitation the rights
1209+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1210+
copies of the Software, and to permit persons to whom the Software is
1211+
furnished to do so, subject to the following conditions:
1212+
1213+
The above copyright notice and this permission notice shall be included in
1214+
all copies or substantial portions of the Software.
1215+
1216+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1217+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1218+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1219+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1220+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1221+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1222+
THE SOFTWARE.
1223+
"""
1224+
1225+
- remark-rehype, located at deps/remark-rehype, is licensed as follows:
1226+
"""
1227+
(The MIT License)
1228+
1229+
Copyright (c) 2016 Titus Wormer <[email protected]>
1230+
1231+
Permission is hereby granted, free of charge, to any person obtaining
1232+
a copy of this software and associated documentation files (the
1233+
'Software'), to deal in the Software without restriction, including
1234+
without limitation the rights to use, copy, modify, merge, publish,
1235+
distribute, sublicense, and/or sell copies of the Software, and to
1236+
permit persons to whom the Software is furnished to do so, subject to
1237+
the following conditions:
1238+
1239+
The above copyright notice and this permission notice shall be
1240+
included in all copies or substantial portions of the Software.
1241+
1242+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
1243+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1244+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1245+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1246+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1247+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1248+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1249+
"""
1250+
12001251
- remark-cli, located at tools/remark-cli, is licensed as follows:
12011252
"""
12021253
(The MIT License)

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ test: all ## Runs default tests, linters, and builds docs.
266266
# can be displayed together
267267
$(MAKE) -s build-addons
268268
$(MAKE) -s build-addons-napi
269-
$(MAKE) -s test-doc
270269
$(MAKE) -s cctest
271270
$(MAKE) -s jstest
272271

@@ -618,7 +617,8 @@ apidocs_json = $(addprefix out/,$(apidoc_sources:.md=.json))
618617
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
619618

620619
.PHONY: doc-only
621-
doc-only: $(apidoc_dirs) $(apiassets) ## Builds the docs with the local or the global Node.js binary.
620+
doc-only: tools/doc/node_modules \
621+
$(apidoc_dirs) $(apiassets) ## Builds the docs with the local or the global Node.js binary.
622622
# If it's a source tarball, assets are already in doc/api/assets,
623623
# no need to install anything, we have already copied the docs over
624624
if [ ! -d doc/api/assets ]; then \
@@ -1089,8 +1089,13 @@ tools/remark-preset-lint-node/node_modules: \
10891089

10901090
.PHONY: lint-md-build
10911091
lint-md-build: tools/remark-cli/node_modules \
1092+
tools/doc/node_modules \
10921093
tools/remark-preset-lint-node/node_modules
10931094

1095+
.PHONY: tools/doc/node_modules
1096+
tools/doc/node_modules:
1097+
@cd tools/doc && $(call available-node,$(run-npm-install))
1098+
10941099
.PHONY: lint-md
10951100
ifneq ("","$(wildcard tools/remark-cli/node_modules/)")
10961101

test/doctool/test-doctool-html.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const toHTML = require('../../tools/doc/html.js');
2121
const testData = [
2222
{
2323
file: fixtures.path('sample_document.md'),
24-
html: '<ol><li>fish</li><li><p>fish</p></li><li><p>Redfish</p></li>' +
25-
'<li>Bluefish</li></ol>'
24+
html: '<ol><li>fish</li><li>fish</li></ol>' +
25+
'<ul><li>Redfish</li><li>Bluefish</li></ul>'
2626
},
2727
{
2828
file: fixtures.path('order_of_end_tags_5873.md'),
@@ -31,7 +31,7 @@ const testData = [
3131
'id="foo_class_method_buffer_from_array">#</a> </span> </h3>' +
3232
'<ul><li><code>array</code><a ' +
3333
'href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/' +
34-
'Reference/Global_Objects/Array" class="type">&lt;Array&gt;</a></li></ul>'
34+
'Reference/Global_Objects/Array" class="type">&#x3C;Array></a></li></ul>'
3535
},
3636
{
3737
file: fixtures.path('doc_with_yaml.md'),
@@ -45,11 +45,11 @@ const testData = [
4545
'<h2>Foobar II<span><a class="mark" href="#foo_foobar_ii" ' +
4646
'id="foo_foobar_ii">#</a></span></h2><div class="api_metadata">' +
4747
'<details class="changelog"><summary>History</summary>' +
48-
'<table><tr><th>Version</th><th>Changes</th></tr>' +
48+
'<table><tbody><tr><th>Version</th><th>Changes</th></tr>' +
4949
'<tr><td>v5.3.0, v4.2.0</td>' +
5050
'<td><p><span>Added in: v5.3.0, v4.2.0</span></p></td></tr>' +
5151
'<tr><td>v4.2.0</td><td><p>The <code>error</code> parameter can now be' +
52-
'an arrow function.</p></td></tr></table></details></div> ' +
52+
'an arrow function.</p></td></tr></tbody></table></details></div> ' +
5353
'<p>Describe <code>Foobar II</code> in more detail here.' +
5454
'<a href="http://man7.org/linux/man-pages/man1/fg.1.html"><code>fg(1)' +
5555
'</code></a></p><h2>Deprecated thingy<span><a class="mark" ' +
@@ -65,8 +65,8 @@ const testData = [
6565
},
6666
{
6767
file: fixtures.path('sample_document.md'),
68-
html: '<ol><li>fish</li><li><p>fish</p></li><li><p>Redfish</p></li>' +
69-
'<li>Bluefish</li></ol>',
68+
html: '<ol><li>fish</li><li>fish</li></ol>' +
69+
'<ul><li>Red fish</li><li>Blue fish</li></ul>',
7070
analyticsId: 'UA-67020396-1'
7171
},
7272
];

0 commit comments

Comments
 (0)