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

Restructure user guide into top-level guides, reference and explanation parts #9379

Merged
merged 2 commits into from
Nov 5, 2023

Conversation

malteneuss
Copy link
Collaborator

@malteneuss malteneuss commented Oct 28, 2023

Another step of the user guide improvement initiative #9214:

Restructure Cabal documentation top-level parts

The goal is for users to easier find pages for typical problems through search engines and page navigation.

  • The top-level layout is based on the popular documentation structure by https://documentation.divio.com/ to give a
    clear structure to users and future documentation contributors:
    • Guides: Present a solution to a single, atomic, typical user problem.
    • Reference: Describe user API (CLI fields, syntax etc) with technical rigour and completeness.
    • Explanation: Discuss background information, scope, design decisions etc.
  • Move existing documentation roughly into these categories with minimal editing as the basis for further editing.
  • Rename guide titles to mention how-to for improving SEO.
  • Rename some files to improve SEO since that name becomes part of the URL (often called slug).
    Important page keywords should appear in the slug as well to make pages rank higher in search engines.

Template Β: This PR does not modify cabal behaviour (documentation, tests, refactoring, etc.)

Include the following checklist in your PR:

@malteneuss malteneuss added documentation re: devx Improving the cabal developer experience (internal issue) re: readthedocs Concerning hosting documentation on `readthedocs` labels Oct 28, 2023
Copy link
Collaborator

@ffaf1 ffaf1 left a comment

Choose a reason for hiding this comment

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

I appreciate the new TOC

doc/_templates/layout.html Outdated Show resolved Hide resolved
doc/_templates/layout.html Outdated Show resolved Hide resolved
doc/cabal-package-description-file.rst Outdated Show resolved Hide resolved
doc/conf.py Show resolved Hide resolved
doc/how-to-report-bugs.rst Outdated Show resolved Hide resolved
doc/how-to-report-bugs.rst Show resolved Hide resolved
doc/cabal-package-description-file.rst Outdated Show resolved Hide resolved
@@ -1,5 +1,5 @@
Nix Integration
===============
How to integrate Cabal into Nix
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this? IIRC there's a ticket noting that the functionality is broken and suggesting to delete it.

Copy link
Collaborator Author

@malteneuss malteneuss Oct 29, 2023

Choose a reason for hiding this comment

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

I kept it for now to show how a consistent guide naming could look like. I'd like to remove it in a separate PR, copy over possibly useful information into the Nix docs, and a reference here.

Copy link
Contributor

Choose a reason for hiding this comment

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

There is already an open PR for the deletion of this section (which also removes the nix integration from cabal itself) here: #9239

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, I think, it's better to remove it ASAP (at least the docs): it's a wart that is actively harming ux.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

.. TIP::
If this is your first time using `cabal` you should check out the :doc:`Getting Started guide <getting-started>`.

Starting from scratch, we're going to walk you through creating a simple
Copy link
Collaborator

Choose a reason for hiding this comment

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

This sounds like it is the Getting Started guide.

Copy link
Collaborator

Choose a reason for hiding this comment

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

On second thought, given @ffaf1's comment on a deleted line, this whole thing is just relocated and this confusion was already there. We should probably still figure out what we want.

Copy link
Collaborator Author

@malteneuss malteneuss Oct 29, 2023

Choose a reason for hiding this comment

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

Yeah, the idea is that the getting started is a heavily condensed version of the more detailed package guide, just enough to get a feel for the tool/library

doc/how-to-package-haskell-code.rst Outdated Show resolved Hide resolved
doc/how-to-package-haskell-code.rst Show resolved Hide resolved
doc/how-to-package-haskell-code.rst Outdated Show resolved Hide resolved
doc/how-to-package-haskell-code.rst Show resolved Hide resolved
doc/how-to-package-haskell-code.rst Show resolved Hide resolved
doc/how-to-package-haskell-code.rst Outdated Show resolved Hide resolved
- ``pkgname >=n``
- ``pkgname ^>=n`` (since Cabal 2.0)
- ``pkgname >=n && <m``
- ``pkgname ==n.*`` (since Cabal 1.6)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we care about the "since" here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not, sure, but i like to add more explicit examples in a later PR. Let's keep it for now as is.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it's not the reference part of the manual, things like since Cabal 1.6 are better omitted. Of course, if you feel like leaving it as a future work, that's fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

@malteneuss malteneuss force-pushed the top-level-guides-and-reference branch 2 times, most recently from 17cc303 to 82371cf Compare October 29, 2023 21:21
@malteneuss
Copy link
Collaborator Author

I've cleaned up the commits

Copy link
Collaborator

@ffaf1 ffaf1 left a comment

Choose a reason for hiding this comment

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

edit: not a good idea, ignore this


Can you try this for extra clarity?
If it is a mess you can reset the commit.

Comparison:

  • image
  • (tbd)

doc/cabal-package-description-file.rst Show resolved Hide resolved
doc/cabal-project-description-file.rst Show resolved Hide resolved
Copy link
Collaborator

@ffaf1 ffaf1 left a comment

Choose a reason for hiding this comment

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

The new TOC with 4+2 main sections is very good.

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

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

I like the overall direction, but it’s a little hard to navigate all the changes. Please, expand the description of the PR (+ the commit message, which I haven’t checked, but should be identical to the PR description), and explain what exactly this achieves. References to 3rd party sites is allowed but the description should be self-contained nevertheless. Right now it’s not.

one clear flaw in the current PR is renaming of the source files. Let’s probably try to avoid this since it’ll break a lot of links to the latest version of the docs. The name of the file doesn’t need to match the name of the section.

@ulysses4ever
Copy link
Collaborator

Since it’s a significant restructure of our main documentation source, I invite the main contributors to chime In @Kleidukos @Mikolaj @fgaz @gbaz @andreasabel @andreabedini

@BinderDavid
Copy link
Contributor

I really like the new TOC! I played around a bit with using captions, i.e. using the following index.rst:


Welcome to the Cabal User Guide
===============================

.. toctree::
   :caption: Getting Started
   :numbered:

   getting-started

.. toctree::
   :caption: Cabal Guide
   :numbered:

   how-to-package-haskell-code
   how-to-build-like-nix
   how-to-integrate-into-nix
   how-to-report-bugs

.. toctree::
   :caption: Cabal Reference
   :numbered:

   cabal-package-description-file
   cabal-project-description-file
   cabal-config-and-commands
   setup-commands
   file-format-changelog
   buildinfo-fields-reference

.. toctree::
   :caption: Cabal Explanation
   :numbered:

   cabal-context
   package-concepts
   cabal-interface-stability

This yields the following look:
Screenshot 2023-10-30 at 08-14-26 Welcome to the Cabal User Guide — Cabal 3 11 0 0 User's Guide

The problem is that the sections aren't consecutively numbered on the left, but this layout might be an alternative.

@Mikolaj
Copy link
Member

Mikolaj commented Oct 30, 2023

I love the restructure.

BTW, I wonder how the structure in the aborted project https://github.com/haskell/cabal-userguide compares with this one? Does it correspond to just the "Cabal Guilde" part? Is there anything to be learned or scavenged? @JonathanLorimer, would you have any remarks about the new restructure proposed in this ticket or generally an advice from a veteran?

@ulysses4ever
Copy link
Collaborator

I like David's version more. There's no reason to number the highest-level sections like Guide / Reference / Explanation in my opinion.

@malteneuss
Copy link
Collaborator Author

I really like the new TOC! I played around a bit with using captions, i.e. using the following index.rst:
...
The problem is that the sections aren't consecutively numbered on the left, but this layout might be an alternative.

That's a really nice layout. I've copied it over.

@malteneuss malteneuss force-pushed the top-level-guides-and-reference branch from d036b0a to 2b5a8a9 Compare October 30, 2023 22:29
@malteneuss
Copy link
Collaborator Author

I like the overall direction, but it’s a little hard to navigate all the changes. Please, expand the description of the PR (+ the commit message, which I haven’t checked, but should be identical to the PR description), and explain what exactly this achieves. References to 3rd party sites is allowed but the description should be self-contained nevertheless. Right now it’s not.

one clear flaw in the current PR is renaming of the source files. Let’s probably try to avoid this since it’ll break a lot of links to the latest version of the docs. The name of the file doesn’t need to match the name of the section.

I've expanded the PR message and squashed the relevant commits to use that same message.

Regarding file renames i've added SEO as the reason. Our aim should be to have our latest Cabal pages rank highest for typical search queries like "how to package Haskell", "cabal file", and related variations instead of GHC, stack or blogs.

@malteneuss
Copy link
Collaborator Author

I love the restructure.

BTW, I wonder how the structure in the aborted project https://github.com/haskell/cabal-userguide compares with this one? Does it correspond to just the "Cabal Guilde" part? Is there anything to be learned or scavenged? @JonathanLorimer, would you have any remarks about the new restructure proposed in this ticket or generally an advice from a veteran?

The structure of that alternative looks like what the authors of https://documentation.divio.com/ would call a tutorial, teaching a user step-by-step more and more involved usages of Cabal. This may not be needed with Cabal, although some the topics would make good guides as well.

@BinderDavid
Copy link
Contributor

I said something similar in #9214 already, but I think that this is an absolutely essential step in improving the documentation of cabal. Large sections in the manual can currently not decide whether they want to be a tutorial or guide introducing how to accomplish some task, or whether they want to be the reference documentation which exhaustively enumerates all the knobs and options. Making this explicit, like this PR does, is helpful in spotting and naming these discrepancies and fixing them in subsequent smaller PRs. Thanks @malteneuss for doing this :)

@julialongtin
Copy link
Contributor

hmm. was just trying to use these docs (i have an upstream package with a bug in it). i uploaded it to a remote git repository, and wanted to tell cabal to use that version instead of the one from hackage, but the language around Specifying Packages from Remote Version Control Locations left me confused. "where do i put the name of the package?"

i think "specifying packages from an external version control" was missing an action verb. "specifying packages for cabal to download from an external version control" would have been clearer, along with some language about cabal matching the name of the package you're trying to use by first downloading the package, then looking at the cabal file there.

@malteneuss
Copy link
Collaborator Author

hmm. was just trying to use these docs (i have an upstream package with a bug in it). i uploaded it to a remote git repository, and wanted to tell cabal to use that version instead of the one from hackage, but the language around Specifying Packages from Remote Version Control Locations left me confused. "where do i put the name of the package?"

i think "specifying packages from an external version control" was missing an action verb. "specifying packages for cabal to download from an external version control" would have been clearer, along with some language about cabal matching the name of the package you're trying to use by first downloading the package, then looking at the cabal file there.

This is out of scope for this PR, but such question should definitely be answered by the docs. Could you add a separate PR against the existing docs? Maybe also adding what other "type" of version control is supported? Ideally the phrasing would use keywords that you would use to search with when you had no idea about the docs.

@malteneuss malteneuss force-pushed the top-level-guides-and-reference branch from 76f48d4 to 8b47c3c Compare November 2, 2023 22:02
@malteneuss malteneuss added the merge me Tell Mergify Bot to merge label Nov 2, 2023
@malteneuss malteneuss force-pushed the top-level-guides-and-reference branch from 8b47c3c to 3b89724 Compare November 3, 2023 20:58
@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Nov 5, 2023
The goal is for users to easier find pages for typical problems through search engines and page navigation.
- The top-level layout is based on the popular documentation structure by https://documentation.divio.com/ to give a
   clear structure to users and future documentation contributors:
  * Guides: Present a solution to a single, atomic, typical user problem.
  * Reference: Describe user API (CLI fields, syntax etc) with technical rigour and completeness.
  * Explanation: Discuss background information, scope, design decisions etc.
- Move existing documentation roughly into these categories with minimal editing as the basis for further editing.
- Rename guide titles to mention how-to for improving SEO.
- Rename some files to improve SEO since that name becomes part of the URL (often called slug).
  Important page keywords should appear in the slug as well to make pages rank higher in search engines.
@Mikolaj Mikolaj force-pushed the top-level-guides-and-reference branch from 3b89724 to 759ba8e Compare November 5, 2023 20:59
@mergify mergify bot merged commit 2fca50b into haskell:master Nov 5, 2023
45 checks passed
@ulysses4ever
Copy link
Collaborator

I just noticed that this patch did break URLs like https://cabal.readthedocs.io/en/X/cabal-project.html. Compare:

It may be good to look into restoring them using some Sphynx magic (there should be a way to assign URLs, I believe).

@malteneuss
Copy link
Collaborator Author

I can take a look, probably on the weekend. Thanks for reporting.

@ulysses4ever
Copy link
Collaborator

@malteneuss that would be awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge re: devx Improving the cabal developer experience (internal issue) re: readthedocs Concerning hosting documentation on `readthedocs`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants