GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: fix JSON generation for aliased methods by TimothyGu · Pull Request #4871 · nodejs/node

Conversation

@TimothyGu

@TimothyGu TimothyGu commented Jan 26, 2016

Copy link
Copy Markdown
Member

For example assert/assert.ok currently has the following signature:

    "signatures": [
      {
        "params": [
          {
            "name": "value"
          },
          {
            "name": "message])"
          },
          {
            "name": "assert.ok(value"
          },
          {
            "name": "message",
            "optional": true
          }
        ]
      }
    ]

While the heading reads

assert(value[, message]), assert.ok(value[, message])

Split them into two sections to make it working.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mscdex mscdex added doc Issues and PRs related to Node.js documentation. assert Issues and PRs related to the assert subsystem. labels Jan 26, 2016
@evanlucas

evanlucas commented Jan 26, 2016

Copy link
Copy Markdown
Contributor

/cc @nodejs/documentation

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eljefedelrodeodeljefe

eljefedelrodeodeljefe commented Jan 26, 2016

Copy link
Copy Markdown
Contributor

Wouldn't it be better to fix it during JSON generation? Because the markdown renders fine and a change there doesn't seem to be something we should wish for, imo. What's your use case?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tflanagan

tflanagan commented Jan 26, 2016

Copy link
Copy Markdown
Contributor

There is precedence for this type of change:

https://nodejs.org/api/https.html#https_server_listen_handle_callback

Just a friendly reminder that the whole doc generating process is pretty fragile, so I would +1 this change, as it already exists in the HTTPS docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eljefedelrodeodeljefe

eljefedelrodeodeljefe commented Jan 26, 2016

Copy link
Copy Markdown
Contributor

Okay. Could we have a See assert.ok() for details. then? Because the difference is the that srv.listen() is one heading level deeper.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimothyGu

TimothyGu commented Jan 26, 2016

Copy link
Copy Markdown
Member Author

Hi,

https://nodejs.org/api/buffer.html#buffer_buf_readdoublebe_offset_noassert

is not deeper and it uses the same style.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimothyGu

TimothyGu commented Jan 26, 2016

Copy link
Copy Markdown
Member Author

Or actually it is. But I still don't see how that affects the argument.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eljefedelrodeodeljefe

eljefedelrodeodeljefe commented Jan 26, 2016

Copy link
Copy Markdown
Contributor

It's bout consistency and readability. Also prettiness and semantics, since a heading without content looks like a bug to me. Even if there were precedence.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tflanagan

tflanagan commented Jan 26, 2016

Copy link
Copy Markdown
Contributor

@eljefedelrodeodeljefe, you will find this style all over the docs. It is not a bug. It is by design.

The only argument against this is resorting the documentation which would cause duplicate documentation because we will have to move assert.ok down in the list.

As I have done this before, I am sure it is fine now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eljefedelrodeodeljefe

eljefedelrodeodeljefe commented Jan 26, 2016

Copy link
Copy Markdown
Contributor

Then make the case. -0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tflanagan

tflanagan commented Jan 26, 2016

Copy link
Copy Markdown
Contributor

@eljefedelrodeodeljefe I would argue the case is FOR consistency and readability.

tbh, this was a mistake on my part in missing this when I reordered all the docs alphabetically, this should've already happened.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimothyGu

TimothyGu commented Jan 26, 2016

Copy link
Copy Markdown
Member Author

@tflanagan that's a good point. How about I move ok to where it should be and link assert() to assert.ok()? This way it reduces redundancy and keeps the alphabetical order.

On the doc toolchain being fragile, I totally agree.

@eljefedelrodeodeljefe there are code in the toolchain to specifically handle this sort of headings: https://github.com/nodejs/node/blob/master/tools/doc/json.js#L38-L39. So I'd argue that the headings are like this by design.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimothyGu
doc: fix JSON generation for aliased methods
9a8f085
Currently assert/assert.ok currently has the following signature:

    "signatures": [
      {
        "params": [
          {
            "name": "value"
          },
          {
            "name": "message])"
          },
          {
            "name": "assert.ok(value"
          },
          {
            "name": "message",
            "optional": true
          }
        ]
      }
    ]

The heading reads

    assert(value[, message]), assert.ok(value[, message])

Split them into two sections to make it working.
@TimothyGu

TimothyGu commented Jan 30, 2016

Copy link
Copy Markdown
Member Author

I have just splitted the section into two, so that the alphabetical order is preserved.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chrisdickinson

chrisdickinson commented Jan 30, 2016

Copy link
Copy Markdown
Contributor

This LGTM. Making the headings more regular is great (even if it is to fix the JSON generator, which is pretty neglected!)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thefourtheye
thefourtheye reviewed Jan 30, 2016
View reviewed changes
Comment thread doc/api/assert.markdown

@thefourtheye thefourtheye Jan 30, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

All the other references in this document use the format assert.ok.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TimothyGu TimothyGu Jan 30, 2016

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This isn't true. See e.g. https://github.com/nodejs/node/blob/master/doc/api/assert.markdown#assertdoesnotthrowblock-error-message

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@thefourtheye thefourtheye Jan 30, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

All I am saying is that, it should be consistent.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@eljefedelrodeodeljefe

eljefedelrodeodeljefe commented Jan 30, 2016

Copy link
Copy Markdown
Contributor

LGTM now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Trott pushed a commit to Trott/io.js that referenced this pull request Jan 30, 2016
@TimothyGu @Trott
doc: fix JSON generation for aliased methods
27c8b73
Currently assert/assert.ok currently has the following signature:

    "signatures": [
      {
        "params": [
          {
            "name": "value"
          },
          {
            "name": "message])"
          },
          {
            "name": "assert.ok(value"
          },
          {
            "name": "message",
            "optional": true
          }
        ]
      }
    ]

The heading reads

    assert(value[, message]), assert.ok(value[, message])

Split them into two sections to make it working.

PR-URL: nodejs#4871
Reviewed-By: Chris Dickinson <[email protected]>
@Trott

Trott commented Jan 30, 2016

Copy link
Copy Markdown
Member

Landed in 27c8b73

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott closed this Jan 30, 2016
@TimothyGu
TimothyGu deleted the json-doc branch January 30, 2016 19:17
@jasnell jasnell added the lts-watch-v4.x label Feb 1, 2016
@jasnell

jasnell commented Feb 1, 2016

Copy link
Copy Markdown
Member

lts-watch label applied

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rvagg pushed a commit that referenced this pull request Feb 8, 2016
@TimothyGu @rvagg
doc: fix JSON generation for aliased methods
17888b1
Currently assert/assert.ok currently has the following signature:

    "signatures": [
      {
        "params": [
          {
            "name": "value"
          },
          {
            "name": "message])"
          },
          {
            "name": "assert.ok(value"
          },
          {
            "name": "message",
            "optional": true
          }
        ]
      }
    ]

The heading reads

    assert(value[, message]), assert.ok(value[, message])

Split them into two sections to make it working.

PR-URL: #4871
Reviewed-By: Chris Dickinson <[email protected]>
@rvagg rvagg mentioned this pull request Feb 8, 2016
Release proposal: v5.5.1 (Stable) #5141
Closed
@MylesBorins

MylesBorins commented Feb 17, 2016

Copy link
Copy Markdown
Contributor

This PR will have to wait for a backlog of doc fixes to land before we can land it in LTS

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Knighton910

Knighton910 commented Feb 17, 2016

Copy link
Copy Markdown

👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MylesBorins pushed a commit that referenced this pull request Feb 22, 2016
@TimothyGu Myles Borins
doc: fix JSON generation for aliased methods
7967f51
Currently assert/assert.ok currently has the following signature:

    "signatures": [
      {
        "params": [
          {
            "name": "value"
          },
          {
            "name": "message])"
          },
          {
            "name": "assert.ok(value"
          },
          {
            "name": "message",
            "optional": true
          }
        ]
      }
    ]

The heading reads

    assert(value[, message]), assert.ok(value[, message])

Split them into two sections to make it working.

PR-URL: #4871
Reviewed-By: Chris Dickinson <[email protected]>
@MylesBorins MylesBorins added the land-on-v4.x label Feb 22, 2016
This was referenced Jul 7, 2023
[Snyk] Security upgrade mocha from 8.4.0 to 10.1.0 leonardoadame/node#46
Open
[Snyk] Security upgrade mocha from 9.2.2 to 10.1.0 leonardoadame/node#47
Open
[Snyk] Security upgrade mocha from 3.5.3 to 10.1.0 leonardoadame/node#55
Open
[Snyk] Fix for 4 vulnerabilities leonardoadame/node#56
Open
[Snyk] Fix for 8 vulnerabilities leonardoadame/node#59
Open
[Snyk] Security upgrade mocha from 9.2.0 to 10.1.0 leonardoadame/node#61
Open
[Snyk] Fix for 4 vulnerabilities leonardoadame/node#63
Open
[Snyk] Fix for 21 vulnerabilities leonardoadame/node#65
Open
[Snyk] Fix for 11 vulnerabilities leonardoadame/node#68
Open
[Snyk] Fix for 13 vulnerabilities leonardoadame/node#69
Open
[Snyk] Fix for 8 vulnerabilities leonardoadame/node#70
Open
[Snyk] Security upgrade mocha from 7.2.0 to 10.1.0 leonardoadame/node#72
Open
[Snyk] Fix for 22 vulnerabilities leonardoadame/node#75
Open
[Snyk] Security upgrade mocha from 7.2.0 to 10.1.0 leonardoadame/node#85
Merged
[Snyk] Fix for 4 vulnerabilities leonardoadame/node#86
Open
[Snyk] Fix for 22 vulnerabilities leonardoadame/node#89
Open
[Snyk] Security upgrade mocha from 8.4.0 to 10.1.0 leonardoadame/node#91
Open
[Snyk] Security upgrade mocha from 9.2.2 to 10.1.0 leonardoadame/node#98
Open
[Snyk] Security upgrade mocha from 6.2.3 to 10.1.0 leonardoadame/node#105
Open
[Snyk] Security upgrade mocha from 8.4.0 to 10.1.0 leonardoadame/node#110
Open
[Snyk] Fix for 25 vulnerabilities leonardoadame/node#114
Open
[Snyk] Security upgrade mocha from 9.2.2 to 10.1.0 leonardoadame/node#116
Open
[Snyk] Security upgrade mocha from 9.2.2 to 10.1.0 leonardoadame/node#123
Open
[Snyk] Fix for 9 vulnerabilities leonardoadame/node#126
Open
[Snyk] Security upgrade mocha from 5.0.0 to 10.1.0 leonardoadame/node#127
Open
[Snyk] Fix for 9 vulnerabilities leonardoadame/node#128
Open
[Snyk] Security upgrade mocha from 8.4.0 to 10.1.0 leonardoadame/node#131
Open
[Snyk] Fix for 3 vulnerabilities leonardoadame/node#139
Open
[Snyk] Security upgrade mocha from 9.2.0 to 10.1.0 leonardoadame/node#142
Open
@snyk-io snyk-io Bot mentioned this pull request Oct 21, 2024
[Snyk] Fix for 26 vulnerabilities Graybar-codespace/node#49
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

assert Issues and PRs related to the assert subsystem. doc Issues and PRs related to Node.js documentation.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@TimothyGu @evanlucas @eljefedelrodeodeljefe @tflanagan @chrisdickinson @Trott @jasnell @MylesBorins @Knighton910 @thefourtheye @mscdex
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.