Skip to content

Commit

Permalink
doc: convert hardcoded modules anchors to anchor alias + correct mark…
Browse files Browse the repository at this point in the history
…down ref
  • Loading branch information
foxxyz committed Jul 9, 2021
1 parent 103635a commit 778c162
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions doc/api/modules.md
Expand Up @@ -989,34 +989,50 @@ This section was moved to
[Modules: `module` core module](module.md#the-module-object).

<!-- Anchors to make sure old links find a target -->
* <a id="modules_module_builtinmodules" href="module.html#module_module_builtinmodules">`module.builtinModules`</a>
* <a id="modules_module_createrequire_filename" href="module.html#module_module_createrequire_filename">`module.createRequire(filename)`</a>
* <a id="modules_module_syncbuiltinesmexports" href="module.html#module_module_syncbuiltinesmexports">`module.syncBuiltinESMExports()`</a>
<a id="modules_module_builtinmodules"></a>
<a id="modules_module_createrequire_filename"></a>
<a id="modules_module_syncbuiltinesmexports"></a>
* [`module.builtinModules`][]
* [`module.createRequire(filename)`][]
* [`module.syncBuiltinESMExports()`][]

## Source map v3 support

This section was moved to
[Modules: `module` core module](module.md#source-map-v3-support).

<!-- Anchors to make sure old links find a target -->
* <a id="modules_module_findsourcemap_path_error" href="module.html#module_module_findsourcemap_path">`module.findSourceMap(path)`</a>
* <a id="modules_class_module_sourcemap" href="module.html#module_class_module_sourcemap">Class: `module.SourceMap`</a>
* <a id="modules_new_sourcemap_payload" href="module.html#module_new_sourcemap_payload">`new SourceMap(payload)`</a>
* <a id="modules_sourcemap_payload" href="module.html#module_sourcemap_payload">`sourceMap.payload`</a>
* <a id="modules_sourcemap_findentry_linenumber_columnnumber" href="module.html#module_sourcemap_findentry_linenumber_columnnumber">`sourceMap.findEntry(lineNumber, columnNumber)`</a>

<a id="modules_module_findsourcemap_path_error"></a>
<a id="modules_class_module_sourcemap"></a>
<a id="modules_new_sourcemap_payload"></a>
<a id="modules_sourcemap_payload"></a>
<a id="modules_sourcemap_findentry_linenumber_columnnumber"></a>
* [`module.findSourceMap(path)`][]
* [Class: `module.SourceMap`][]
* [`new SourceMap(payload)`][]
* [`sourceMap.payload`][]
* [`sourceMap.findEntry(lineNumber, columnNumber)`][]

[Class: `module.SourceMap`]: module.md#class-modulesourcemap
[ECMAScript Modules]: esm.md
[GLOBAL_FOLDERS]: #loading-from-the-global-folders
[`"main"`]: packages.md#main
[`Error`]: errors.md#class-error
[`__dirname`]: #__dirname
[`__filename`]: #__filename
[`module.builtinModules`]: module.md#modulebuiltinmodules
[`module.children`]: #modulechildren
[`module.createRequire(filename)`]: module.md#modulecreaterequirefilename
[`module.findSourceMap(path)`]: module.md#modulefindsourcemappath
[`module.id`]: #moduleid
[`module.syncBuiltinESMExports()`]:module.md#modulesyncbuiltinesmexports
[`module` object]: #the-module-object
[`new SourceMap(payload)`]: module.md#new-sourcemappayload
[`package.json`]: packages.md#nodejs-packagejson-field-definitions
[`path.dirname()`]: path.md#pathdirnamepath
[`require.main`]: #requiremain
[`sourceMap.findEntry(lineNumber, columnNumber)`]: module.md#sourcemapfindentrylinenumber-columnnumber
[`sourceMap.payload`]: module.md#sourcemappayload
[an error]: errors.md#err-require-esm
[exports shortcut]: #exports-shortcut
[module resolution]: #all-together
Expand Down

2 comments on commit 778c162

@aduh95
Copy link
Contributor

@aduh95 aduh95 commented on 778c162 Jul 9, 2021

Choose a reason for hiding this comment

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

I don't think this is the correct way to go, I find the current way of presenting things more explicit. Also, I find it concerning that using plain HTML in the docs would produce confusing results. I'd much prefer have the md2html tool handle those correctly.

@foxxyz
Copy link
Contributor Author

@foxxyz foxxyz commented on 778c162 Jul 10, 2021

Choose a reason for hiding this comment

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

Fair enough! I've reverted this and just fixed the links to point to the correct anchors in 9cdc522. Just keep in mind this will still produce a 404 when you click on the links in the markdown version (as is the case on the correct docs). I was explicitly trying to fix that in the above commit.

I've removed the automatic processing of all plain anchors (I.E. <a id="..."></a>) in 6260f08 so hopefully that removes your concern regarding using plain HTML.

Please sign in to comment.