docker / docker/docs

reference: find a better way to present flag descriptions and example sections

Open
#16,470 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement lifecycle/frozen
Dominant language
Markdown
Stars
4.7k
Forks
8.5k
Avg merge
2d 18h
Merged PRs (30d)
108

Description

Our reference docs currently use "descriptive" titles for flag descriptions. The idea behind that was to make these sections more discoverable, so that users that search for a specific "task" / "feature" would discover the flag they need to use for that.

For example;

Set the pull policy (--pull)

Using "Set the pull policy" allows the user to find the --pull flag, either from the right-hand TOC, or using search (within the docs, or through Google), and we also link to that section from the "options" table at the top of the page;

Screenshot 2023-01-09 at 12 28 59

So, the current approach allows for two separate navigation entries into the content. However this approach also makes the right-hand navigation a bit unwieldy; the titles are long, and trying to find the right section for a specific flag from the right-hand TOC (not the table) is "messy".

Screenshot 2023-01-09 at 12 29 29

We can probably improve some of that, but we need to brainstorm a bit on the right approach, and make sure that all projects that have pages in the reference section use the same approach.

A. Keep as-is, but add additional entries to the right-hand TOC

This could be a short-term solution; we keep the current headings, but repeat the links from the "options" table in the right-hand TOC. This means that (some) sections will appear twice in the TOC;

  • once using --flagname as title (e.g. --pull)
  • once using the heading title (Set the pull policy (--pull))

This approach

  • 👍 makes the --flagnames easier to discover in the right-hand navigation
  • 👍 example titles continue to be listed in the navigation to help discoverability
  • 👎 possibly confusing (two links to the same section)
B. Use --flagname for the headings, and put the examples as separate headings inside that

This approach would "split" the flagname and examples. Both are linkable;

--workdir, -w

Set the working directory inside the container.

Set a custom working directory for a container

Description of this example, mention WORKDIR etc etc

$ docker container run --workdir=/foo .....
  • 👍 makes the --flagnames easier to discover in the right-hand navigation
  • 👎 / ❓ if we show both the --flagname and the "Set a custom working directory for a container" in the TOC, the TOC may still be cluttered
C. Separate examples and flag descriptions

Similar to A., but actually make the flag description and examples related to the flag separate sections (not nested).

  • 👍 makes the --flagnames easier to discover in the right-hand navigation
  • 👍 example titles continue to be listed in the navigation to help discoverability
  • 👎 navigating to the flag description only provides a (basic) description for the flag; sometimes an example is more useful to understand "why to use this flag"
  • ☝️ we can still link from the flag description section to the corresponding example(s), but this requires additional maintenance, and may make the flag description section a bit "cluttered" (short description, followed by potentially multiple links to the examples).
D. Other options?

Perhaps there's other options?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reviewing the related issue 16469 and the current Docker reference pages, then compare how projects structure flag descriptions and examples; done means agreeing on and documenting one consistent presentation approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.