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

Produce HTML documentation using unified/remark/rehype #21490

Closed
wants to merge 9 commits 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
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ test: all ## Runs default tests, linters, and builds docs.
# can be displayed together
$(MAKE) -s build-addons
$(MAKE) -s build-addons-napi
$(MAKE) -s test-doc
$(MAKE) -s cctest
$(MAKE) -s jstest

Expand Down Expand Up @@ -610,7 +609,8 @@ apidocs_json = $(addprefix out/,$(apidoc_sources:.md=.json))
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))

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

.PHONY: lint-md-build
lint-md-build: tools/remark-cli/node_modules \
tools/doc/node_modules \
tools/remark-preset-lint-node/node_modules

.PHONY: tools/doc/node_modules
tools/doc/node_modules:
@cd tools/doc && $(call available-node,$(run-npm-install))

.PHONY: lint-md
ifneq ("","$(wildcard tools/remark-cli/node_modules/)")

Expand Down
14 changes: 7 additions & 7 deletions test/doctool/test-doctool-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const toHTML = require('../../tools/doc/html.js');
const testData = [
{
file: fixtures.path('sample_document.md'),
html: '<ol><li>fish</li><li><p>fish</p></li><li><p>Redfish</p></li>' +
'<li>Bluefish</li></ol>'
html: '<ol><li>fish</li><li>fish</li></ol>' +
'<ul><li>Redfish</li><li>Bluefish</li></ul>'
},
{
file: fixtures.path('order_of_end_tags_5873.md'),
Expand All @@ -31,7 +31,7 @@ const testData = [
'id="foo_class_method_buffer_from_array">#</a> </span> </h3>' +
'<ul><li><code>array</code><a ' +
'href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/' +
'Reference/Global_Objects/Array" class="type">&lt;Array&gt;</a></li></ul>'
'Reference/Global_Objects/Array" class="type">&#x3C;Array></a></li></ul>'
},
{
file: fixtures.path('doc_with_yaml.md'),
Expand All @@ -45,11 +45,11 @@ const testData = [
'<h2>Foobar II<span><a class="mark" href="#foo_foobar_ii" ' +
'id="foo_foobar_ii">#</a></span></h2><div class="api_metadata">' +
'<details class="changelog"><summary>History</summary>' +
'<table><tr><th>Version</th><th>Changes</th></tr>' +
'<table><tbody><tr><th>Version</th><th>Changes</th></tr>' +
'<tr><td>v5.3.0, v4.2.0</td>' +
'<td><p><span>Added in: v5.3.0, v4.2.0</span></p></td></tr>' +
'<tr><td>v4.2.0</td><td><p>The <code>error</code> parameter can now be' +
'an arrow function.</p></td></tr></table></details></div> ' +
'an arrow function.</p></td></tr></tbody></table></details></div> ' +
'<p>Describe <code>Foobar II</code> in more detail here.' +
'<a href="http://man7.org/linux/man-pages/man1/fg.1.html"><code>fg(1)' +
'</code></a></p><h2>Deprecated thingy<span><a class="mark" ' +
Expand All @@ -65,8 +65,8 @@ const testData = [
},
{
file: fixtures.path('sample_document.md'),
html: '<ol><li>fish</li><li><p>fish</p></li><li><p>Redfish</p></li>' +
'<li>Bluefish</li></ol>',
html: '<ol><li>fish</li><li>fish</li></ol>' +
'<ul><li>Red fish</li><li>Blue fish</li></ul>',
analyticsId: 'UA-67020396-1'
},
];
Expand Down
Loading