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,doc: allow page titles to contain inline code #35003

Closed
wants to merge 4 commits into from

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Aug 31, 2020

Previously the HTML title would be cut to the first text node only. This PR concats the text value of all the node children of the first heading.

This is currently visible on Modules: module API page:

Currently, on nodejs.org:

<title>Modules:  | Node.js v14.9.0 Documentation</title>

With this PR:

<title>Modules: module API | Node.js v15.0.0 Documentation</title>
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Previously the HTML title would be cut to the first text node only.
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory. labels Aug 31, 2020
tools/doc/package.json Outdated Show resolved Hide resolved
tools/doc/html.js Outdated Show resolved Hide resolved
@richardlau
Copy link
Member

@aduh95
Copy link
Contributor Author

aduh95 commented Sep 2, 2020

If possible could you add a test

@richardlau done! I've also make some refactoring to the test code (sample_document.md was parsed twice with the same code, there was an unused async keyword, I've added some more modern syntax to make it more readable, …), I can remove that from the current PR if we feel it doesn't belong here.

@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 2, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 2, 2020
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@richardlau richardlau added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 2, 2020
@github-actions github-actions bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Sep 2, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2020

Commit Queue failed
- Loading data for nodejs/node/pull/35003
✔  Done loading data for nodejs/node/pull/35003
----------------------------------- PR info ------------------------------------
Title      tools,doc: allow page titles to contain inline code (#35003)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     aduh95:fix-module-page-title -> nodejs:master
Labels     doc, tools
Commits    3
 - tools,doc: allow page titles to contain inline code
 - v12 compatible
 - Add tests and support for nested elements
Committers 1
 - Antoine du HAMEL 
PR-URL: https://github.com/nodejs/node/pull/35003
Reviewed-By: Richard Lau 
Reviewed-By: Rich Trott 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/35003
Reviewed-By: Richard Lau 
Reviewed-By: Rich Trott 
--------------------------------------------------------------------------------
   ✔  Last GitHub Actions successful
   ℹ  Last Full PR CI on 2020-09-02T15:08:40Z: https://ci.nodejs.org/job/node-test-pull-request/33014/
- Querying data for job/node-test-pull-request/33014/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
   ℹ  This PR was created on Mon, 31 Aug 2020 23:18:36 GMT
   ✔  Approvals: 2
   ✔  - Richard Lau (@richardlau): https://github.com/nodejs/node/pull/35003#pullrequestreview-480703930
   ✔  - Rich Trott (@Trott) (TSC): https://github.com/nodejs/node/pull/35003#pullrequestreview-480855115
   ✖  This PR needs to wait 6 more hours to land
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu

@richardlau richardlau added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 2, 2020
@github-actions github-actions bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 2, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2020

Commit Queue failed
- Loading data for nodejs/node/pull/35003
✔  Done loading data for nodejs/node/pull/35003
----------------------------------- PR info ------------------------------------
Title      tools,doc: allow page titles to contain inline code (#35003)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     aduh95:fix-module-page-title -> nodejs:master
Labels     commit-queue-failed, doc, tools
Commits    3
 - tools,doc: allow page titles to contain inline code
 - v12 compatible
 - Add tests and support for nested elements
Committers 1
 - Antoine du HAMEL 
PR-URL: https://github.com/nodejs/node/pull/35003
Reviewed-By: Richard Lau 
Reviewed-By: Rich Trott 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/35003
Reviewed-By: Richard Lau 
Reviewed-By: Rich Trott 
--------------------------------------------------------------------------------
   ✔  Last GitHub Actions successful
   ℹ  Last Full PR CI on 2020-09-02T16:48:11Z: https://ci.nodejs.org/job/node-test-pull-request/33014/
- Querying data for job/node-test-pull-request/33014/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
   ℹ  This PR was created on Mon, 31 Aug 2020 23:18:36 GMT
   ✔  Approvals: 2
   ✔  - Richard Lau (@richardlau): https://github.com/nodejs/node/pull/35003#pullrequestreview-480703930
   ✔  - Rich Trott (@Trott) (TSC): https://github.com/nodejs/node/pull/35003#pullrequestreview-480855115
   ✖  This PR needs to wait 9 more minutes to land
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu

@richardlau richardlau added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 2, 2020
@github-actions github-actions bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 2, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2020

Commit Queue failed
- Loading data for nodejs/node/pull/35003
✔  Done loading data for nodejs/node/pull/35003
----------------------------------- PR info ------------------------------------
Title      tools,doc: allow page titles to contain inline code (#35003)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     aduh95:fix-module-page-title -> nodejs:master
Labels     commit-queue-failed, doc, tools
Commits    3
 - tools,doc: allow page titles to contain inline code
 - v12 compatible
 - Add tests and support for nested elements
Committers 1
 - Antoine du HAMEL 
PR-URL: https://github.com/nodejs/node/pull/35003
Reviewed-By: Richard Lau 
Reviewed-By: Rich Trott 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/35003
Reviewed-By: Richard Lau 
Reviewed-By: Rich Trott 
--------------------------------------------------------------------------------
   ✔  Last GitHub Actions successful
   ℹ  Last Full PR CI on 2020-09-02T23:09:17Z: https://ci.nodejs.org/job/node-test-pull-request/33014/
- Querying data for job/node-test-pull-request/33014/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
   ℹ  This PR was created on Mon, 31 Aug 2020 23:18:36 GMT
   ✔  Approvals: 2
   ✔  - Richard Lau (@richardlau): https://github.com/nodejs/node/pull/35003#pullrequestreview-480703930
   ✔  - Rich Trott (@Trott) (TSC): https://github.com/nodejs/node/pull/35003#pullrequestreview-480855115
--------------------------------------------------------------------------------
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/master up to date...
From https://github.com/nodejs/node
 * branch              master     -> FETCH_HEAD
✔  origin/master is now up-to-date
- Downloading patch for 35003
✔  Downloaded patch to /home/runner/work/node/node/.ncu/35003/patch
--------------------------------------------------------------------------------
.git/rebase-apply/patch:87: trailing whitespace.
there to test just that. 
warning: 1 line adds whitespace errors.
Applying: tools,doc: allow page titles to contain inline code
Applying: v12 compatible
Applying: Add tests and support for nested elements
   ✔  Patches applied
There are 3 commits in the PR. Attempting autorebase.
Rebasing (2/6)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
tools,doc: allow page titles to contain inline code

Previously the HTML title would be cut to the first text node only.

PR-URL: #35003
Reviewed-By: Richard Lau riclau@uk.ibm.com
Reviewed-By: Rich Trott rtrott@gmail.com

[detached HEAD 8678760c] tools,doc: allow page titles to contain inline code
Author: Antoine du HAMEL duhamelantoine1995@gmail.com
Date: Tue Sep 1 01:12:54 2020 +0200
2 files changed, 6 insertions(+), 6 deletions(-)
Rebasing (3/6)
Rebasing (4/6)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
v12 compatible

PR-URL: #35003
Reviewed-By: Richard Lau riclau@uk.ibm.com
Reviewed-By: Rich Trott rtrott@gmail.com

[detached HEAD 84fdf8ac] v12 compatible
Author: Antoine du HAMEL duhamelantoine1995@gmail.com
Date: Tue Sep 1 01:52:05 2020 +0200
2 files changed, 2 insertions(+), 2 deletions(-)
Rebasing (5/6)
Rebasing (6/6)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
Add tests and support for nested elements

PR-URL: #35003
Reviewed-By: Richard Lau riclau@uk.ibm.com
Reviewed-By: Rich Trott rtrott@gmail.com

[detached HEAD 1f606767] Add tests and support for nested elements
Author: Antoine du HAMEL duhamelantoine1995@gmail.com
Date: Wed Sep 2 11:43:04 2020 +0200
3 files changed, 24 insertions(+), 20 deletions(-)
create mode 100644 test/fixtures/document_with_special_heading.md

Successfully rebased and updated refs/heads/master.
✔ 8678760c6286cea5d13761512d46bfd9a36f6fea
✔ 0:0 skipping fixes-url fixes-url
✔ 0:0 blank line after title line-after-title
✔ 0:0 line-lengths are valid line-length
✔ 0:0 metadata is at end of message metadata-end
✔ 3:8 PR-URL is valid. pr-url
✔ 0:0 reviewers are valid reviewers
✔ 0:0 valid subsystems subsystem
✔ 0:0 Title is formatted correctly. title-format
⚠ 0:50 Title should be <= 50 columns. title-length
✖ 84fdf8acd201b08727cb19fead617cebcc5379bf
✔ 0:0 skipping fixes-url fixes-url
✔ 0:0 blank line after title line-after-title
✔ 0:0 line-lengths are valid line-length
✔ 0:0 metadata is at end of message metadata-end
✔ 1:8 PR-URL is valid. pr-url
✔ 0:0 reviewers are valid reviewers
✖ 0:0 Missing subsystem. subsystem
✔ 0:0 Title is formatted correctly. title-format
✔ 0:0 Title is <= 50 columns. title-length
✖ 1f60676731214cfa03c68ac2e68dad9d82ea7ddf
✔ 0:0 skipping fixes-url fixes-url
✔ 0:0 blank line after title line-after-title
✔ 0:0 line-lengths are valid line-length
✔ 0:0 metadata is at end of message metadata-end
✔ 1:8 PR-URL is valid. pr-url
✔ 0:0 reviewers are valid reviewers
✖ 0:0 Missing subsystem. subsystem
✔ 0:0 Title is formatted correctly. title-format
✔ 0:0 Title is <= 50 columns. title-length
ℹ Please fix the commit message and try again.

Copy link
Contributor

@DerekNonGeneric DerekNonGeneric left a comment

Choose a reason for hiding this comment

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

It doesn't seem to me like you actually ran the test. From what I gather, the CI doesn't run the doctool tests (not sure why), but please ensure that the test case being added does work, please.

test/doctool/test-doctool-html.js Show resolved Hide resolved
test/doctool/test-doctool-html.js Outdated Show resolved Hide resolved
test/doctool/test-doctool-html.js Show resolved Hide resolved
test/doctool/test-doctool-html.js Outdated Show resolved Hide resolved
test/doctool/test-doctool-html.js Outdated Show resolved Hide resolved
Co-authored-by: Derek Lewis <DerekNonGeneric@inf.is>
@aduh95
Copy link
Contributor Author

aduh95 commented Sep 3, 2020

It doesn't seem to me like you actually ran the test.

Why would you say such a thing using such a phrasing? I'm contributing to Node.js in good faith, I'm sorry if I made you feel otherwise, but I did actually ran the test.

the CI doesn't run the doctool tests (not sure why)

Yes, I'm pretty sure it does (it's part of make test-doc). If you want to convince yourself, you can open a PR that breaks this test, and check if you see a red cross.

@DerekNonGeneric
Copy link
Contributor

DerekNonGeneric commented Sep 3, 2020

Why would you say such a thing using such a phrasing?

Sorry, I wasn't sure how else to phrase that, but I don't see how this could've been run and pass. Am I mistaken? That's possible.

If you want to convince yourself, you can open a PR that breaks this test, and check if you see a red cross.

I mean, this is pretty convincing already, but I may need to analyze this further.

node/tools/test.py

Lines 1512 to 1526 in 79ea22a

# these suites represent special cases that should not be run as part of the
# default JavaScript test-run, e.g., internet/ requires a network connection,
# addons/ requires compilation.
IGNORED_SUITES = [
'addons',
'benchmark',
'doctool',
'embedding',
'internet',
'js-native-api',
'node-api',
'pummel',
'tick-processor',
'v8-updates'
]

It's not really your fault if the test runner is messed up and you weren't able to ensure the test worked properly.

Sorry if I made it seem that way…

@aduh95
Copy link
Contributor Author

aduh95 commented Sep 3, 2020

I think that's the list of ignored suites for make jstest. But I'm just guessing, the discussion would be more productive if someone more familiar with the test tool wanted to chime in.

From what I can see, make test should run the doctool test suite:

node/Makefile

Lines 600 to 609 in 79ea22a

.PHONY: test-doc
test-doc: doc-only lint ## Builds, lints, and verifies the docs.
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping test-doc (no crypto)"; \
else \
$(PYTHON) tools/test.py $(PARALLEL_ARGS) doctool; \
fi
$(NODE) tools/doc/checkLinks.js .

node/Makefile

Lines 316 to 326 in 79ea22a

.PHONY: test
# This does not run tests of third-party libraries inside deps.
test: all ## Runs default tests, linters, and builds docs.
$(MAKE) -s tooltest
$(MAKE) -s test-doc
$(MAKE) -s build-addons
$(MAKE) -s build-js-native-api-tests
$(MAKE) -s build-node-api-tests
$(MAKE) -s cctest
$(MAKE) -s jstest

@DerekNonGeneric DerekNonGeneric added flaky-test Issues and PRs related to the tests with unstable failures on the CI. test Issues and PRs related to the tests. labels Sep 3, 2020
Copy link
Contributor

@DerekNonGeneric DerekNonGeneric left a comment

Choose a reason for hiding this comment

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

Thank you for incorporating my feedback and clarifying why the test does work. 😜

@DerekNonGeneric DerekNonGeneric added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Sep 3, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 3, 2020
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

@Trott Trott removed the flaky-test Issues and PRs related to the tests with unstable failures on the CI. label Sep 3, 2020
@Trott
Copy link
Member

Trott commented Sep 3, 2020

Landed in d2c5e89. Thanks so much!

@Trott Trott closed this Sep 3, 2020
Trott pushed a commit that referenced this pull request Sep 3, 2020
Previously the HTML title would be cut to the first text node only.

PR-URL: #35003
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
richardlau pushed a commit that referenced this pull request Sep 7, 2020
Previously the HTML title would be cut to the first text node only.

PR-URL: #35003
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
@richardlau richardlau mentioned this pull request Sep 7, 2020
4 tasks
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Previously the HTML title would be cut to the first text node only.

PR-URL: #35003
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Previously the HTML title would be cut to the first text node only.

PR-URL: #35003
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
@codebytere codebytere mentioned this pull request Sep 28, 2020
joesepi pushed a commit to joesepi/node that referenced this pull request Jan 8, 2021
Previously the HTML title would be cut to the first text node only.

PR-URL: nodejs#35003
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
@targos targos removed the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Sep 5, 2021
@aduh95 aduh95 deleted the fix-module-page-title branch September 15, 2021 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. test Issues and PRs related to the tests. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants