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

Doc normalize markdown reference links #29558

Closed

Conversation

nschonni
Copy link
Member

@nschonni nschonni commented Sep 14, 2019

Use explicit trailing [] for reference markdown links.
Escape brackets in titles that get flagged by remark-lint.
Convert old changlogs SHA links to match newer format.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Sep 14, 2019
@@ -744,7 +744,7 @@ See https://github.com/nodejs/node/labels/confirmed-bug for complete and current
* [[`5c29c0c519`](https://github.com/nodejs/node/commit/5c29c0c519)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389)
* [[`2cd7f73d9f`](https://github.com/nodejs/node/commit/2cd7f73d9f)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389)
* [[`c65484a74d`](https://github.com/nodejs/node/commit/c65484a74d)] - **tls**: make server not use DHE in less than 1024bits (Shigeki Ohtsu) [#1739](https://github.com/nodejs/node/pull/1739)
* [[`77f518403f`](https://github.com/nodejs/node/commit/77f518403f)] - **win,node-gyp**: make delay-load hook C89 compliant (Sharat M R) [TooTallNate/node-gyp#616](https://github.com/TooTallNa
* [[`77f518403f`](https://github.com/nodejs/node/commit/77f518403f)] - **win,node-gyp**: make delay-load hook C89 compliant (Sharat M R) [TooTallNate/node-gyp#616](https://github.com/TooTallNate/node-gyp/pull/616)
Copy link
Member Author

Choose a reason for hiding this comment

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

These urls where incomplete

@@ -1128,7 +1128,7 @@ See https://github.com/nodejs/node/labels/confirmed-bug for complete and current

* **crypto**: significantly reduced memory usage for TLS (Fedor Indutny & Сковорода Никита Андреевич) [#1529](https://github.com/nodejs/node/pull/1529)
* **npm**: Upgrade npm to 2.9.0. See the [v2.8.4](https://github.com/npm/npm/releases/tag/v2.8.4) and [v2.9.0](https://github.com/npm/npm/releases/tag/v2.9.0) release notes for details. Summary:
- Add support for default author field to make `npm init -y` work without user-input (@othiym23) [npm/npm/d8eee6cf9d](https://github.com/npm/npm/commit/d8eee6cf9d2ff7aca68dfaed2de76824a3e0d9
- Add support for default author field to make `npm init -y` work without user-input (@othiym23) [npm/npm/d8eee6cf9d](https://github.com/npm/npm/commit/d8eee6cf9d2ff7aca68dfaed2de76824a3e0d9)
Copy link
Member Author

Choose a reason for hiding this comment

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

Malformed url

<!-- YAML
added: v0.9.1
-->

* `callback` {Function} The function to call at the end of this turn of
[the Node.js Event Loop]
the Node.js [Event Loop][]
Copy link
Member Author

Choose a reason for hiding this comment

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

This wasn't matching the reference link because of the extra text

| Writing only | [`Writable`] | <code>[_write()][stream-_write]</code>, <code>[_writev()][stream-_writev]</code>, <code>[_final()][stream-_final]</code> |
| Reading and writing | [`Duplex`] | <code>[_read()][stream-_read]</code>, <code>[_write()][stream-_write]</code>, <code>[_writev()][stream-_writev]</code>, <code>[_final()][stream-_final]</code> |
| Operate on written data, then read the result | [`Transform`] | <code>[_transform()][stream-_transform]</code>, <code>[_flush()][stream-_flush]</code>, <code>[_final()][stream-_final]</code> |
| Reading only | [`Readable`][] | [`_read()`][stream-_read] |
Copy link
Member Author

Choose a reason for hiding this comment

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

Only the changes for the "Class" column were flagged by remark-lint. Replaced the <code> for consistency

@@ -622,7 +622,7 @@ provided, `otherPublicKey` is expected to be a [`Buffer`][],
If `outputEncoding` is given a string is returned; otherwise, a
[`Buffer`][] is returned.

### diffieHellman.generateKeys([encoding])
### diffieHellman.generateKeys(\[encoding\])
Copy link
Member Author

Choose a reason for hiding this comment

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

These were rendering as links in the heading because of the reference link [encoding]

@nschonni
Copy link
Member Author

@Trott I used the web to resolve the conflicts. Is there a better way to split this to make it easier for reviewers?

@Trott
Copy link
Member

Trott commented Sep 25, 2019

@Trott I used the web to resolve the conflicts. Is there a better way to split this to make it easier for reviewers?

I suppose if you want smaller change sets for easier review, you can either do one file per branch/PR or one type of change per branch/PR.

@nodejs/documentation Anyone want to review this as-is? It seems OK to me. I understand why we should escape [ and ] when they're not links. It has the minor disadvantage of making the raw markdown harder to understand. And it's a pretty big change-set (876 lines). But I definitely don't oppose it.

@sam-github
Copy link
Contributor

sam-github commented Sep 25, 2019

I don't have a problem with the changes being across multiple files, but I am having trouble figuring out what the specific changes are, and why. I edited the description to add the commit message description in, not sure why github didn't do that itself.

For example, the unescaped [] API docs seems to be processed by our tools into HTML fine, for example, https://nodejs.org/api/tls.html#tls_tls_connect_options_callback doesn't have the raw square brackets escaped in source. So, why would we use more unreadable markup, if it doesn't change the HTML output?

Some of the changes seem to be literally malformed URLs, those could maybe be their own commit, and are obviously a good idea.

The adding of empty [] to make refs be ['some thing()'][] is in same category, if the output HTML is valid, why change the markup?

In general, we know the markup is right when the output is right, so making things "right" with no tool support to maintain that "rightness" is fragile. If we really do require these markup changes, then tool support is needed to enforce them.

It sounds like @nschonni you are relying on some kind of tools opinion about what correct markdown should be, and making the changes it suggests?

@nschonni
Copy link
Member Author

nschonni commented Oct 1, 2019

These are flagged by remark-lint when using the "recommended" preset in addition to the current remark-node-preset, which has an upstream PR

@nschonni nschonni force-pushed the doc--normalize-markdown-reference-links branch from 899413e to eb0feda Compare October 1, 2019 05:20
@nschonni
Copy link
Member Author

nschonni commented Oct 1, 2019

I've broken up the commits a little further to make it easier to review the individual types of changes

@nschonni nschonni force-pushed the doc--normalize-markdown-reference-links branch 2 times, most recently from bfff527 to 0622d20 Compare October 1, 2019 05:30
@Trott
Copy link
Member

Trott commented Oct 1, 2019

@nodejs/collaborators This could use some reviews.

@BridgeAR
Copy link
Member

BridgeAR commented Oct 1, 2019

@vsemozhetbyt do you know how much our tooling has to fix currently to get our links to work as expected and would this improve our situation?

@nschonni I think it would be great if this PR could be split into multiple ones. That way they would probably be signed-off much faster. Especially since some parts might be more controversial to some than others. I definitely see the value in most of the change but there are a few which we might not want to change right now.

I think splitting out 3899b8c and f4f7384 would be enough, since those two seem most controversial at the moment and make up a big part of this PR.

@nschonni
Copy link
Member Author

nschonni commented Oct 1, 2019

I'm fine with splitting it up, but I'm wondering how that's done here. Close this PR and open new PRs for each commit, or leave the first commit and submit new ones for the others?

@BridgeAR
Copy link
Member

BridgeAR commented Oct 1, 2019

@nschonni I would roughly do the following:

# Get the latest upstream code in your fork
git checkout master
git fetch upstream
git pull upstream/master
git push origin

git checkout -b add-explicit-brackets-to-docs
git cherry-pick 3899b8c
git push -u origin add-explicit-brackets-to-docs

git checkout master
git checkout -b escape-brackets-in-docs
git cherry-pick f4f7384
git push -u origin escape-brackets-in-docs

git checkout doc--normalize-markdown-reference-links 
git rebase -i origin/master
# Here you just remove the two commits that you cherry picked earlier
git push --force-with-lease

@vsemozhetbyt
Copy link
Contributor

@BridgeAR Unfortunately, I've lost the track of our doc tooling system since we transfer it to the unified and remark world and I cannot be of any help here( I am afraid we may have too few collaborators that grasp all the doc tooling system now.

@nschonni nschonni force-pushed the doc--normalize-markdown-reference-links branch from 0622d20 to 1720122 Compare October 2, 2019 04:36
@nschonni
Copy link
Member Author

nschonni commented Oct 2, 2019

OK @BridgeAR I've split this out as recommended

@BridgeAR
Copy link
Member

BridgeAR commented Oct 2, 2019

@nschonni thanks a lot!

@BridgeAR
Copy link
Member

BridgeAR commented Oct 2, 2019

@nschonni are you planning on including the here used rules to our doc linter as well? Without that it will be hard to prevent any of these to be reintroduced.

@nschonni
Copy link
Member Author

nschonni commented Oct 2, 2019

They're currently re-ignored in nodejs/remark-preset-lint-node#21, but can be enabled once these land

@Trott
Copy link
Member

Trott commented Oct 2, 2019

@Trott
Copy link
Member

Trott commented Oct 2, 2019

Landed in 344c5c4...420d4e4

@Trott Trott closed this Oct 2, 2019
Trott pushed a commit that referenced this pull request Oct 2, 2019
Trott pushed a commit that referenced this pull request Oct 2, 2019
Trott pushed a commit that referenced this pull request Oct 2, 2019
Reference links were used in the document, but not define at the end.

PR-URL: #29558
Reviewed-By: Ruben Bridgewater <[email protected]>
Trott pushed a commit that referenced this pull request Oct 2, 2019
It gets confused as a reference link otherwis

PR-URL: #29558
Reviewed-By: Ruben Bridgewater <[email protected]>
@nschonni nschonni deleted the doc--normalize-markdown-reference-links branch October 2, 2019 19:24
BridgeAR pushed a commit that referenced this pull request Oct 9, 2019
BridgeAR pushed a commit that referenced this pull request Oct 9, 2019
BridgeAR pushed a commit that referenced this pull request Oct 9, 2019
Reference links were used in the document, but not define at the end.

PR-URL: #29558
Reviewed-By: Ruben Bridgewater <[email protected]>
BridgeAR pushed a commit that referenced this pull request Oct 9, 2019
It gets confused as a reference link otherwis

PR-URL: #29558
Reviewed-By: Ruben Bridgewater <[email protected]>
@BridgeAR BridgeAR mentioned this pull request Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants