Commit Graph

18 Commits

Author SHA1 Message Date
Aviv Keller
71785889c8
lib: prefer logical assignment
PR-URL: https://github.com/nodejs/node/pull/55044
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2024-10-09 06:42:16 +00:00
Jungku Lee
78dbda1bd3
url,tools,benchmark: replace deprecated substr()
PR-URL: https://github.com/nodejs/node/pull/51546
Refs: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/String/substr
Reviewed-By: Jithil P Ponnan <jithil@outlook.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-05-12 22:35:31 +02:00
Akash Yeole
27493a1dd7
doc: fix arrow vertical alignment in HTML version
This commit fixes the alignment of the bullet points (green arrow) under
'Node.js <version> documentation' by drawing a triangle in CSS instead
of using an ASCII char.

PR-URL: https://github.com/nodejs/node/pull/52193
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-03-28 00:35:22 +01:00
Rich Trott
7f06c270c6 tools: add navigation ARIA landmark to generated API ToC
As an accessibility improvement, specify the navigation landmark for
the element of our docs that contains the table of contents generated
for the specific API page.

Ref: https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/
Ref: https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA20.html
PR-URL: https://github.com/nodejs/node/pull/49882
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2023-09-28 14:08:53 -07:00
Antoine du Hamel
8103a6418e
doc: rename possibly confusing variable and CSS class
A "selector" usually refers to a CSS selector, when here it refers to a
checkbox.

PR-URL: https://github.com/nodejs/node/pull/49536
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2023-09-08 17:03:57 +02:00
jakecastelli
94ec71d385
tools: add button to copy code example to clipboard
PR-URL: https://github.com/nodejs/node/pull/46928
Refs: https://github.com/nodejs/node/issues/46894
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
2023-03-25 08:41:43 +00:00
Jordan Harband
757c104147
tools: add prefer-proto rule
fixup: add support for `Object.create(null)`

fixup: extend to any 1-argument Object.create call

fixup: add tests
PR-URL: https://github.com/nodejs/node/pull/46083
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-01-10 05:38:36 +00:00
Antoine du Hamel
3ce4cef4e6
tools: enforce use of trailing commas in tools/
PR-URL: https://github.com/nodejs/node/pull/45889
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-12-18 16:39:39 +00:00
Fabien Michel
bfb5ba7776
tools: fix incorrect version history order
This fixes an error in parseYAML(text), the version sorting
coudn't be right as we compared an arrify string
(ie. a = ["v18.11, v16.7.0"]) with an array of strings
(ie. b = ["v18.07", "v16.7.0"]) in versionSort(a, b).

minVersion(a) couldn't find the minimum version with an arrify string
like a = ["v18.11, v16.7.0"].
That's why incorrect version history orders sometimes appeared.

Furthermore, no need to sort the added version as it always comes first.
So, it can be the last one to be pushed in the meta.changes array.

Fixes: https://github.com/nodejs/node/issues/45670

Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45728
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2022-12-14 09:38:36 +00:00
Antoine du Hamel
7cbcc4fc43
tools: fix CJS/ESM toggle on small screens
PR-URL: https://github.com/nodejs/node/pull/43506
Co-authored-by: Moshe Atlow <moshe@atlow.co.il>
Fixes: https://github.com/nodejs/node/issues/43468
Reviewed-By: LiviaMedeiros <livia@cirno.name>
2022-06-27 18:31:44 +02:00
Feng Yu
b6c6cc7000
tools: update main branch name
PR-URL: https://github.com/nodejs/node/pull/43440
Refs: https://github.com/nodejs/node/issues/33864
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-06-17 08:48:18 +01:00
Paolo Insogna
9be1dcff34
doc,tools: improve navigability of API docs
PR-URL: https://github.com/nodejs/node/pull/41404
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-02-24 12:00:42 +01:00
Rich Trott
e4aa575b05
tools: improve section tag additions in HTML doc generator
There is an edge case involving GFM footnotes where our current code
adds an empty section which results in a warning (but not an error) in
HTML validators. This change causes the HTML generator to skip the
unnecessary addition of a section tag in that one edge case.

PR-URL: https://github.com/nodejs/node/pull/41318
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2021-12-27 20:13:22 +00:00
Rich Trott
b0d5eecdd9 tools,doc: fix misrendering of consecutive JS blocks
Our markdown-to-html tool was assuming that any consecutive JS blocks
were ESM vs CJS alternatives, but that is not always the case, resulting
in both a confusing interface and invalid HTML.

PR-URL: https://github.com/nodejs/node/pull/40146
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-19 07:58:17 +00:00
Michaël Zasso
2b080cb23f
tools: update doc generator dependencies
PR-URL: https://github.com/nodejs/node/pull/40042
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-09-18 16:32:44 +02:00
foxxyz
6fdd5827f0 doc: anchor link parity between markdown and html-generated docs
Main changes:

- Replace current HTML anchor generation to match
  header anchor generation in Github markdown.
- Remove unnecessary double namespacing on generated anchors/links (E.G.
  `esm.md#loaders` instead of `esm.md#esm_loaders`).
- Anchors/links are automatically prefixed with their respective modules
  when concatenated for usage in `all.html`.

Benefits:

- All anchor links within and between markdown API docs actually work.
- Adding new anchor links no longer requires contributors to generate
  the HTML docs first to look up the correct anchors.
- Anchors are much shorter.
- All previous anchor links are preserved by generating hidden legacy
  anchors.

PR-URL: https://github.com/nodejs/node/pull/39304
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-08-30 00:40:20 +02:00
Rich Trott
21cda8ef92 doc: remove GitHub mark
Judging from https://github.com/logos, we are misusing the GitHub mark.
That page indicates to not change the color (we change it from black to
green). Less clear, it says  "Use the Mark in social buttons to link to
your GitHub profile or project" which isn't exactly what we're doing but
also isn't not what we're doing?

This might be an indication of my eyesight getting worse as I get older,
but I think the size that we display the mark at by default makes it not
entirely recognizable as the GitHub mark. Lastly, there's the
philosophical issue of whether we should display a commercial entity's
mark on our web pages in this particular instance. (For me, the answer
is "maybe".)

All told, I think we can remove it without damaging usability on the
website, so let's do it.

PR-URL: https://github.com/nodejs/node/pull/39251
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-07-07 20:42:23 -07:00
Michaël Zasso
de01f475d5
tools: update doctool dependencies, migrate to ESM
- Migrated to ESM because some dependencies now require it.
- Did not update `highlight.js` to v11 because it has many breaking
  changes.
- Used non-deprecated `highlight.js` API.

Refs: https://github.com/highlightjs/highlight.js/issues/2277
Fixes: https://github.com/nodejs/node/issues/38938
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/38966
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-06-14 08:22:00 -07:00