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

Reference docs: use canonical URL / command names #10471

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Mar 17, 2020

Opening as draft

In the current reference documentation, separate pages are included for commands that have aliases. For example, a page exists for both docker run (https://docs.docker.com/engine/reference/commandline/run/), and for docker container run (https://docs.docker.com/engine/reference/commandline/container_run/)

This situation is confusing, because it's difficult for users to learn that both commands are equivalent, but also because only one page has an extended description (and examples).

This PR:

  • updates the YAML docs with YAML generated by [WIP] reorganise reference docs cli#2389, which moves the extended descriptions to the <object>_<verb>.yaml files
  • removes the duplicate pages, instead redirecting all commands to their <object> <verb> counterparts
  • updates the titles of those pages to include both the short-hand (docker run) and long-hand (docker container run) commands in the title.

To discuss:

For some commands, the "short-hand" may actually be the preferred / canonical command, so instead of redirecting to the <object>_<verb> page, we could redirect the other way round (redirect docker container run to docker run).

I decided not to go that direction, because (even though lengthier to type), the docker container run command:

  • makes the user end up in the "container" sub-section in the navigation
  • also has links to "related" commands (docker container stop, docker container rm)

Because of the above, it's easier for users to both "discover" related commands, and to understand what type of object the command relates to. The same is less easy to discover with the short-hand commands. For example, to learn that docker rmi relates to images, whereas docker rm relates to containers.

To do

Update usage descriptions where possible, for example, the "usage" section (and --help output) of docker run does not mention the aliases;

Usage:	docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

We could probably update those to mention both variations:

Usage:	docker container run [OPTIONS] IMAGE [COMMAND] [ARG...]

For other commands, there's even more variations (docker ps, docker container ls, docker container list, docker container ps); we need to decide what to do with those.

_config.yml Outdated
@@ -11,7 +11,6 @@ incremental: true
permalink: pretty
safe: false
lsi: false
url: https://docs.docker.com
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to double-check if this has no side-effects. I couldn't find any, but perhaps may have missed some

@thaJeztah
Copy link
Member Author

@usha-mandya ptal; open to feedback / suggestions

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the canonical_reference_urls branch 2 times, most recently from 2950f0e to 5c6df12 Compare September 30, 2020 23:56
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the canonical_reference_urls branch from 5c6df12 to 7300a68 Compare October 1, 2020 00:01
@netlify
Copy link

netlify bot commented Oct 1, 2020

Deploy preview for docsdocker ready!

Built with commit 7300a68

https://deploy-preview-10471--docsdocker.netlify.app

@sudo-bmitch
Copy link
Collaborator

This is a definite improvement over trying to maintain copies of these pages without them getting out of sync.

Few issues I'm seeing:

  • Looking at the new redirected link, I'm not seeing the examples getting pulled in for container ls, it's missing filters and formatting options (perhaps that's because ps.md was renamed to container_ps.md instead of container_ls.md).

  • I'm getting a 404 when trying to navigate from the reference page to the docker or dockerd CLI pages.

  • For the individual pages after the rename, it would be good to update the examples with the new (longer) command to match the title/url.

From a UX perspective, the ideal for me would be a single command in the title and an alias section at the top of the page (similar to how Wikipedia adds a redirect section at the top of articles). E.g.:

docker container ls

Description

...

Aliases

The following commands are equivalent and redirect here:

docker ps
docker container ls
docker container list
docker container ps

Usage

...

I dug around but didn't see where the actual redirects were happening in these changes. Entirely possible I'm blind and need to do more digging in the page generator code, but if that's back in a private repo, let me know so I don't lose any more hair :)

@docker-robott
Copy link
Collaborator

Thanks for the pull request. We'd like to make our product docs better, but haven’t been able to review all the suggestions.
As our docs have also diverged, we do not have the bandwidth to review and rebase old pull requests.

If the updates are still relevant, review our contribution guidelines and rebase your pull request against the latest version of the docs, then mark it as fresh with a /remove-lifecycle stale comment.
If not, this pull request will be closed in 30 days. This helps our maintainers focus on the active pull requests.

Prevent pull requests from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine Issue affects Docker engine/daemon lifecycle/frozen
Projects
None yet
3 participants