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: improve docopen target in Makefile #9436

Closed
Closed
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
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,14 @@ test-v8 test-v8-intl test-v8-benchmarks test-v8-all:
endif

apidoc_sources = $(wildcard doc/api/*.md)
apidocs = $(addprefix out/,$(apidoc_sources:.md=.html)) \
$(addprefix out/,$(apidoc_sources:.md=.json))
apidocs_html = $(apidoc_dirs) $(apiassets) $(addprefix out/,$(apidoc_sources:.md=.html))
apidocs_json = $(apidoc_dirs) $(apiassets) $(addprefix out/,$(apidoc_sources:.md=.json))

apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets

apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))

doc-only: $(apidoc_dirs) $(apiassets) $(apidocs) tools/doc/

doc-only: $(apidocs_html) $(apidocs_json)
doc: $(NODE_EXE) doc-only

$(apidoc_dirs):
Expand Down Expand Up @@ -336,8 +335,8 @@ out/doc/api/%.html: doc/api/%.md
fi
[ -x $(NODE) ] && $(NODE) $(gen-html) || node $(gen-html)

docopen: out/doc/api/all.html
-google-chrome out/doc/api/all.html
docopen: $(apidocs_html)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename these to doc-open so it's consistent with doc-only above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@silverwind Actually doc-only is the odd man here I guess. Because we have docclean as well :D

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can sidestep this issue by makeing doc do what doc-only does now. The fact that doc does a full build seems unexpected. Can be done in another PR I assume.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@silverwind I agree.

@$(PYTHON) -mwebbrowser file://$(PWD)/out/doc/api/all.html

docclean:
-rm -rf out/doc
Expand Down