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

Documentation review #1088

Closed
jason0x43 opened this issue Feb 3, 2020 · 11 comments
Closed

Documentation review #1088

jason0x43 opened this issue Feb 3, 2020 · 11 comments
Assignees
Labels
discovery Research, no development domain-documentation Related to Intern's documentation priority-high Most important

Comments

@jason0x43
Copy link
Member

The goal here is to review Intern's documentation, both how its organized and how it's implemented, and determine how it could be improved.

Current implementation

Intern's documentation is hosted in this repository as markdown files. The README is the front page, providing introductory and getting started information and linking to more detailed documentation. This documentation is also available at https://theintern.io, which simply renders the markdown files from the repo in a custom format.

The site at https://theintern.io can also display API information for Intern. API docs are rendered from an api.json file contained in the repo which is updated whenever intern is built locally (much like a package-lock.json file is updated whenever a new package is installed). There are no auto-generated API docs available in the repo.

The benefit of the current system is reduced maintenance overhead since the docs don't have to be built. The main downsides are that docs on the pretty site may not be indexed by Google, and all doc rendering must occur on the client, which could be slow mobile devices (although I've never heard of this being an issue).

Current organization

As mentioned previously, there are two types of documentation, general docs and API docs. API docs follow the structure of the code itself.

General docs are divided into the following sections:

  • API (summary API data)
  • Architecture (how Intern is structured)
  • Changes from previous versions
  • Usage with continuous integration systems
  • General Intern concepts and definitions
  • Configuration of Intern
  • Developing Intern
  • Extending Intern with custom plugins and reporters
  • Getting started
  • Where to get help
  • How to (a grab bag of answers to specific usage questions)
  • Running Intern (mostly how to use the CLI)
  • Writing tests (how Interns interfaces work, what assertions are available, ...)

Questions

A few questions to answer...

  • How can the organization be streamlined / simplified to make following the docs easier?
  • Is there a better way to handle more specific questions than the "How to" page?
  • Should we start pre-rendering docs on the pretty site, or is the current system preferable?
  • Should we generate markdown API docs and commit them to the repo, or just keep the summary API docs (or defer all API docs to the pretty site)?
@jason0x43 jason0x43 added domain-documentation Related to Intern's documentation effort-high This will take a while discovery Research, no development priority-medium This should get done, but it's not a high priority labels Feb 3, 2020
@jason0x43 jason0x43 added this to the Intern 5.0 milestone Feb 3, 2020
@jason0x43
Copy link
Member Author

jason0x43 commented Feb 3, 2020

Streamlining the Organization

I think we have a bit more documentation than we need, or at least the things that users might be interested in are spread out over too many docs. A better top-level organization might be:

  • What's New (changes from previous versions)
  • How To... (how to do specific things)
  • Getting Started (installing Intern, creating a basic config, running Intern)
  • Options (how to configure intern, what options are available, command line options)
  • Writing Tests (how to write tests, available interfaces, assertions)
  • Extending (how to write plugins, reporters)
  • Developing (how to contribute to Intern)

Some of the current docs, like Architecture, aren't really applicable to most users. Other sections, like Help, could just be on the front page.

If we decide we want human-written API docs, or if we use typedoc to generate markdown docs that are committed to the repo, we can have the API section, as well.

@jason0x43 jason0x43 added priority-high Most important and removed effort-high This will take a while priority-medium This should get done, but it's not a high priority labels Feb 5, 2020
@jason0x43
Copy link
Member Author

jason0x43 commented Feb 5, 2020

Documentation implementaion

I personally like having documentation in a readable form in GitHub. It's easy to update as the code is developed, it has a familiar look and feel, and it's easy to maintain as there's no separate build step for it to be usable. Regarding pre-rendering docs on theintern.io, it wouldn't be terribly difficult to adapt the rendering system to output files, or to come up with a different file-rendering pipeline, but I'm not sure if there would be a great benefit to doing so (at least, I haven't heard of any issues with the current system).

One minor change that might be worthwhile is switching to Asciidoc. This would provide more built-in high-level formatting constructs, like admonition blocks vs our current use of blockquotes + icons. Asciidocs on GH can also auto-generate tables-of-contents. Doing this would require updating theintern.io to support Asciidoc instead of or in addition to Markdown.

API docs

Regarding API docs, I think we should try out a markdown solution like https://github.com/tom-grey/typedoc-plugin-markdown. If it's worthwhile, we could drop our current api.json solution in favor of that. That would also simplify pretty site's renderer a bit since it would only be concerned with formatting rather than having to actually understand typedoc data structures.

jason0x43 added a commit that referenced this issue Feb 6, 2020
The docs were generated with:

```
npx typedoc \
  --plugin typedoc-plugin-markdown \
  --tsconfig tsconfig-lib.json \
  --out tsdocs \
  --includeDeclarations \
  --excludeExternals \
  --excludeNotExported \
  --excludePrivate \
  --excludeProtected \
  --readme none
```

references #1088

[ci skip]
@jason0x43 jason0x43 removed this from the Intern 5.0 milestone Feb 7, 2020
@jason0x43
Copy link
Member Author

Hmmm...no, the generated markdown API docs probably aren't going to work. API docs need more formatting or less boilerplate/metadata to be easily readable.

@jason0x43 jason0x43 self-assigned this Feb 14, 2020
@aciccarello
Copy link
Contributor

Here my idea the ideal workflow

  • Keep docs .md files in intern repo
  • Drop api.json file from intern repo
  • Docs site build takes intern repo and generates api.json and all pages as HTML
  • (optional) generate partials that can be dynamically loaded into the page
  • Trigger site build whenever intern master is updated

This achieves a few things

  • Docs are still in the repo
  • Don't need to update api.json with PRs
  • Docs are crawlable by search engines
  • Docs render faster

@aciccarello
Copy link
Contributor

Some other notes from reading through the documentation

  • "How to..." section could be renamed "Guides"
  • ES Modules section may be due for an update considering there is more browser support
  • "Developing" could be renamed "Contributing"
  • The "Architecture" section could be combined with "Extending"
  • The two header layout seems redundant (e.g. The two "Docs" and GH links)

@jason0x43
Copy link
Member Author

Trigger site build whenever intern master is updated

This is something that has gotten easier with GitHub Actions since the last major site redesign. It certainly makes the static site building idea more tempting.

We'd need to support doc builds for multiple projects -- the site currently renders docs for multiple Intern projects, so updates to any of them would need to trigger a build, and the build would need to update the doc sets for all of them. That shouldn't be too terrible, though.

The in-doc search system would probably need to change, but with a static set of docs we could use something like Algolia's DocSearch, which would have the benefit of looking familiar.

@jason0x43
Copy link
Member Author

The two header layout seems redundant (e.g. The two "Docs" and GH links)

They actually represent different things -- the links on the top are more global than the links below them. However, I agree that the top links probably aren't very useful (the links themselves, not the idea of having links at the top of the page).

@indolering
Copy link

The way that the documentation is organized is very confusing. I have a background in technical documentation (and a degree in a related field even!) so I hope this is helpful:

What's New (changes from previous versions)

This belongs in release notes, blog posts, or at most just highlighting a feature is new inline with it's documentation.

Getting Started (installing Intern, creating a basic config, running Intern)
How To... (how to do specific things)
Options (how to configure intern, what options are available, command line options)
Writing Tests (how to write tests, available interfaces, assertions)

This is just obfuscating the content, a quickstart guide at the beginning is helpful, but organize things according to functionality and expose second-level headings in the navigation bar. Try asking some users or friends to do a card sort. I tried doing one, but ran out of time.

Extending (how to write plugins, reporters)
Developing (how to contribute to Intern)

Split this (and architecture) off into developer documentation. That can just be .md files stored in the main project.

ES Modules section may be due for an update considering there is more browser support

I'm unable to get this working ATM. Maybe you should have specific information for ES5, ES6 and ESM environments?

Finally, cloaking documentation from search results is very bad. I had a hard time finding Intern when doing comparisons on JS testing frameworks. I'm assuming this is part of the reason.

@jason0x43
Copy link
Member Author

This belongs in release notes, blog posts, or at most just highlighting a feature is new inline with it's documentation.

When v4 came out, we had questions about what new features were available and how to handle updating for quite some time after the initial release. Maybe we should have a "Migration" section that both mentions what's new and provides ways to update?

but organize things according to functionality and expose second-level headings in the navigation bar

Showing more second level headings would definitely be good. What level of functionality would be reasonable to break things down at? Intern's current docs organize concepts by functional area (writing tests, configuration, running the testing system). Most of Jest's docs, on the other hand, are in its "Guides" section (like Intern's "How To" section, but with more detail), with many relatively specific subsections. Ava's docs, for another example, also give the "How to" section ("Recipes") more priority.

Maybe something more like:

  • Getting Started
    • Installing
    • Unit testing (the basics of writing unit tests for Node and browsers)
    • WebDriver testing (the basics of Intern's WebDriver API)
    • Running Intern (cli and browser client, environments, watch mode)
  • Guides
    • Command line options
    • Configuration
    • Code coverage
    • Using with Babel
    • Using with TypeScript
    • Using with ES modules
    • Mocking
    • ...
  • API

Finally, cloaking documentation from search results is very bad.

That has been an unfortunate side effect of the current doc system, and we definitely need to fix it.

@indolering
Copy link

When v4 came out, we had questions about what new features were available and how to handle updating for quite some time after the initial release. Maybe we should have a "Migration" section that both mentions what's new and provides ways to update?

I mean, if that's what your users need maybe it is best to put it in the user docs as opposed to a MIGRATION.md in the main repo. But I would put it at the bottom of the list, as it will be irrelevant to most users.

Showing more second level headings would definitely be good. What level of functionality would be reasonable to break things down at?

That example looks much better! When people refer to documentation, they don't want a high-level overview of the software, they are just trying to solve their immediate problem. So they look for keywords related to their problem and jump to that section to see if that solves it (ergo the insane popularity of Stack Overflow).

@jason0x43
Copy link
Member Author

Closing this since we seem to have discovered the major pain points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discovery Research, no development domain-documentation Related to Intern's documentation priority-high Most important
Projects
None yet
Development

No branches or pull requests

3 participants