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 — tools: build doc/api/all.html by combining generated HTML by rubys · Pull Request #21544 · nodejs/node

Conversation

@rubys

@rubys rubys commented Jun 26, 2018

Copy link
Copy Markdown
Member

Combine the toc and api contents from the generated doc/api/*.html
files. This ensures that the single page version of the documentation
exactly matches the individual pages.

Fixes #20100

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

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

Trott and jasnell reacted with hooray emoji
All reactions
  • 🎉 2 reactions
@rubys
tools: build doc/api/all.html by combining generated HTML
51aed5d
Combine the toc and api contents from the generated doc/api/*.html
files.  This ensures that the single page version of the documentation
exactly matches the individual pages.

Fixes nodejs#20100
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to Node.js builds or CI infrastructure. doc Issues and PRs related to Node.js documentation. tools Issues and PRs related to the tools directory. labels Jun 26, 2018
@Trott

Trott commented Jun 26, 2018

Copy link
Copy Markdown
Member

/ping @nodejs/documentation especially @vsemozhetbyt

All reactions

Sorry, something went wrong.

Uh oh!

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

@Trott

Trott commented Jun 26, 2018

Copy link
Copy Markdown
Member

I added two commits, one to update package-lock.json (and add a missing dependency or two apparently) and another to update the LICENSE file. Those commits can be squashed out upon landing (or sooner).

All reactions

Sorry, something went wrong.

Uh oh!

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

@Trott
Trott force-pushed the build_api_all_from_generated_html branch from b95d56a to 800713b Compare June 26, 2018 20:44
@vsemozhetbyt

vsemozhetbyt commented Jun 26, 2018

Copy link
Copy Markdown
Contributor

I'll try to review this PR and #21490 this week, but I am not sure how thoroughly I will be able to do this: I have much less time recently and this is a whole new module set I am not experienced with. So if anybody knows this toolchain well, please, chime in)

All reactions

Sorry, something went wrong.

Uh oh!

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

@Trott

Trott commented Jun 26, 2018

Copy link
Copy Markdown
Member

The title of the all.html doc ends up being different. On master:

  <title>About this Documentation | Node.js v11.0.0 Documentation</title>

On this branch:

  <title>Node.js v11.0.0 Documentation</title>

For some reason, the links in the doc-version-picker are different (all.html vs. _toc.html).

All reactions

Sorry, something went wrong.

Uh oh!

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

@rubys
fix version picker links
5e9cf65
also update Makefile to make apidocs depend on the tools
@rubys
rubys force-pushed the build_api_all_from_generated_html branch from 800713b to 5e9cf65 Compare June 27, 2018 00:20
@rubys

rubys commented Jun 27, 2018

Copy link
Copy Markdown
Member Author

A brief overview of JSDOM: it is a faithful implementation of the browser DOM. So if anybody here has experience writing JavaScript in the browser, this should look very familiar. I said the overview would brief. :-)

As to doc-version-picker lnks: good catch! I've pushed a fix. Take a look at that fix to get an idea of what I mean by this code should look very familiar to anybody who has experience writing javascript in the browser.

As to the title: that change is intentional, though perhaps it could be improved. Previously, all.html was produced by concatenating the markdown input and running it through the publishing pipeline. For the table of contents and api content, this produced mostly the desirable results (with a few bugs as noted in this issue). In the case of the title, instead of concatenating the titles of each of the 50 documents, it picked the title of the first document.

Instead I went with the part of the title that is common to all documents. A good case could be made that this should be prefixed by something indicating 'single page'. Suggestions welcome. In any case, this would be a one line change - search for title.textContent =.

Trott reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@jasnell

jasnell commented Jun 27, 2018

Copy link
Copy Markdown
Member

First off. Hi @rubys! Great to see you here! It's been quite a while, my friend!

Second, great to see work here. I won't be able to do a review until later this week.

All reactions

Sorry, something went wrong.

Uh oh!

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

@rubys

rubys commented Jun 27, 2018

Copy link
Copy Markdown
Member Author

Hi @jasnell! It hasn't really been that long. Looking forward to working with you again.

jasnell reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@TimothyGu

TimothyGu commented Jun 27, 2018

Copy link
Copy Markdown
Member

Hi, this PR is great. However, as one of the maintainers of jsdom I'm reluctant to recommend the inclusion of the entire package in Node.js tree, just because of its sheer size. I'd like to explore any possible alternatives that would allow us to accomplish the same goal in a more efficient way.

Moreover, as I noted in #21490 (comment), it seems like we would be duplicating a lot of npm modules we already include in the code base, like acorn. I know this is already somewhat an issue with npm and ESLint in tree, but it would be awesome if we could dedupe a bit (especially with ESLint, which is also in the tools directory).

All reactions

Sorry, something went wrong.

Uh oh!

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

@rubys

rubys commented Jun 27, 2018

Copy link
Copy Markdown
Member Author

@TimothyGu Perhaps you would prefer a version based on RegExps? Something like https://gist.github.com/rubys/26fb5b75d624098b021575c4b58874b0 perhaps? Much faster, zero dependencies, but perhaps a little less robust in that it depends on a number of HTML serialization choices; but overall that's probably acceptable for a tool that is only used at build time.

All reactions

Sorry, something went wrong.

Uh oh!

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

@TimothyGu

TimothyGu commented Jun 27, 2018

Copy link
Copy Markdown
Member

@rubys Yeah, I think that’s a better choice.

All reactions

Sorry, something went wrong.

Uh oh!

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

@rubys rubys mentioned this pull request Jun 27, 2018
tools: build doc/api/all.html by combining generated HTML #21568
Closed
3 tasks done
@vsemozhetbyt vsemozhetbyt mentioned this pull request Jun 28, 2018
Produce HTML documentation using unified/remark/rehype #21490
Closed
3 tasks done
@jasnell

jasnell commented Jun 29, 2018

Copy link
Copy Markdown
Member

Zero dependencies is much better, even if a bit less robust.

All reactions

Sorry, something went wrong.

Uh oh!

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

@rubys

rubys commented Jun 29, 2018

Copy link
Copy Markdown
Member Author

Alternate version of this pull request, with zero dependencies can be found here: #21568

jasnell reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

rubys added a commit to rubys/node that referenced this pull request Jun 30, 2018
@rubys
tools: build doc/api/all.html by combining generated HTML nodejs#21544
6dac7db
Combine the toc and api contents from the generated doc/api/*.html
files. This ensures that the single page version of the documentation
exactly matches the individual pages.

Fixes nodejs#20100
@rubys

rubys commented Jul 3, 2018

Copy link
Copy Markdown
Member Author

Closing as #21568 was merged.

All reactions

Sorry, something went wrong.

Uh oh!

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

@rubys rubys closed this Jul 3, 2018
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

build Issues and PRs related to Node.js builds or CI infrastructure. doc Issues and PRs related to Node.js documentation. tools Issues and PRs related to the tools directory.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

doc: all.html is seriously broken link-wise

Uh oh!

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

6 participants

@rubys @Trott @vsemozhetbyt @jasnell @TimothyGu @nodejs-github-bot
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.