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

build: allow proper generation of html docs #14932

Closed
wants to merge 1 commit into from

Conversation

maclover7
Copy link
Contributor

@maclover7 maclover7 commented Aug 18, 2017

gen-doc always calls gen-json, which means it's impossible to generate
html docs. Changed this to pass in the command the user wants to run.
I'm a Makefile novice, so please let me know if there's a better way to
do this :)

Fixes: #14930

Checklist
Affected core subsystem(s)

build

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Aug 18, 2017
@mscdex mscdex added the doc Issues and PRs related to the documentations. label Aug 18, 2017
@Trott
Copy link
Member

Trott commented Aug 19, 2017

Hi, @maclover7! We use build as the subsystem for Makefile rather than doc. If you could update the commit message and the PR title, that would be great!

@Trott
Copy link
Member

Trott commented Aug 19, 2017

gen-doc always calls gen-json, which means it's impossible to generate
html docs.

This perhaps explains #14930. /cc @vsemozhetbyt

Assuming these bug reports are correct, I wonder if it was introduced in #13482 which landed 3 days ago.

@Trott Trott mentioned this pull request Aug 19, 2017
2 tasks
Makefile Outdated
@@ -503,14 +503,14 @@ gen-doc = \
else \
cd tools/doc && node ../../$(NPM) install; \
fi;\
[ -x $(NODE) ] && $(NODE) $(gen-json) || node
[ -x $(NODE) ] && $(NODE) $(1) || node
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if you simply remove $(gen-json)/$(1) you won't need the change in the other too lines
(this will simply resolve to the path of the node exe)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bearing in mind I'm a Makefile novice, when I have this diff:

diff --git a/Makefile b/Makefile
index 91466e1003..384164e24d 100644
--- a/Makefile
+++ b/Makefile
@@ -503,14 +503,14 @@ gen-doc = \
                else \
                        cd tools/doc && node ../../$(NPM) install; \
                fi;\
-       [ -x $(NODE) ] && $(NODE) $(1) || node
+       [ -x $(NODE) ] && $(NODE) || node
 
 out/doc/api/%.json: doc/api/%.md
-       $(call gen-doc, $(gen-json))
+       $(gen-doc) $(gen-json)
 
 # check if ./node is actually set, else use user pre-installed binary
 out/doc/api/%.html: doc/api/%.md
-       $(call gen-doc, $(gen-html))
+       $(gen-doc) $(gen-html)
 
 docopen: $(apidocs_html)
        @$(PYTHON) -mwebbrowser file://$(PWD)/out/doc/api/all.html

It causes this to be executed (this is a long makefile command, I omitted non-relevant sections):

[ -x ./node ] && ./node || node tools/doc/generate.js --node-version=v9.0.0 --format=html --template=doc/template.html --analytics= doc/api/_toc.md > out/doc/api/_toc.html

It looks like the $(gen-json/html) arg isn't being passed to $(NODE), but is being passed to node. Would appreciate any suggestions for how to fix this (I've already tried some SO and Google searches) 😞

@refack
Copy link
Contributor

refack commented Aug 19, 2017

Hello @maclover7 thanks for the fix 🥇

@krydos
Copy link
Contributor

krydos commented Aug 19, 2017

Oh my god. It's definitely me broke the html doc generation. I'm so sorry 😢

Thank you @maclover7 for the fix!

`gen-doc` always calls `gen-json`, which means it's impossible to generate
html docs. Changed this to pass in the command the user wants to run.
I'm a Makefile novice, so please let me know if there's a better way to
do this :)
@addaleax
Copy link
Member

Marking both this and #13482 as dont-land for now

Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

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

This works for me on Ubuntu. Would be great if someone else can verify this.

@krydos
Copy link
Contributor

krydos commented Aug 21, 2017

Works for me on MacOS. Can't understand why I didn't run make doc in #13482 :(


out/doc/api/%.json: doc/api/%.md
$(gen-doc) $(gen-json)
$(call gen-doc, $(gen-json))

# check if ./node is actually set, else use user pre-installed binary
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this comment is misused here. We have copy of this comment above which is probably should be placed right above gen-doc definition.

Copy link
Contributor

@krydos krydos Aug 21, 2017

Choose a reason for hiding this comment

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

Just to clarify, in our Makefile we have two comments:

 # check if ./node is actually set, else use user pre-installed binary

Both of them are not in the correct place. Line 511 is definitely strange comment I don't see any check for ./node there. Line 493 seems not correct as well since there are no checks too. But I see some checks in gen-doc. So one comment should be removed and another one placed to the gen-doc definition.

@refack
Copy link
Contributor

refack commented Aug 21, 2017

@tniessen tniessen changed the title doc: allow proper generation of html docs build: allow proper generation of html docs Aug 21, 2017
@tniessen
Copy link
Member

Landed in 8850fd4, thank you!

@tniessen tniessen closed this Aug 21, 2017
tniessen pushed a commit that referenced this pull request Aug 21, 2017
`gen-doc` always calls `gen-json`, which means it's impossible to
generate html docs. Changed this to pass in the command the user wants
to run.

PR-URL: #14932
Fixes: #14930
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@tniessen tniessen mentioned this pull request Aug 21, 2017
@refack
Copy link
Contributor

refack commented Aug 25, 2017

Confirmed fix - https://nodejs.org/download/nightly/v9.0.0-nightly20170824abced13e29/docs/api/
Should only land on v8.x with #13482 a.k.a. 2710616

@maclover7 maclover7 deleted the jm-gen-doc branch August 26, 2017 17:16
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
`gen-doc` always calls `gen-json`, which means it's impossible to
generate html docs. Changed this to pass in the command the user wants
to run.

PR-URL: #14932
Fixes: #14930
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@MylesBorins MylesBorins mentioned this pull request Sep 10, 2017
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
`gen-doc` always calls `gen-json`, which means it's impossible to
generate html docs. Changed this to pass in the command the user wants
to run.

PR-URL: #14932
Fixes: #14930
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@MylesBorins
Copy link
Contributor

This does not land cleanly in LTS. Please feel free to manually backport by following the guide. Please also feel free to replace do-not-land if it is being backported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants