[GHC] #13980: Broken ghc-flag links in the users guide
#13980: Broken ghc-flag links in the users guide -------------------------------------+------------------------------------- Reporter: patrickdoc | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Documentation | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I'm working on cleaning up the users guide, and I have come across an issue with referencing ghc-flags. Essentially, it has to with flags that take arguments. You can see a couple examples if you go to the flag reference here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/flags.html #redirecting-output The top flags all have valid links, but the code to generate them is doing it slightly wrong. Let's consider `-o ⟨filename⟩` for instance. There needs to be a specific reference name for this flag. This name serves a couple purposes. First, it forms the end of the url (i.e. .../separate_compilation.html#ghc-flag--o). Second, the form of cross- references to it (i.e. {{{:ghc-flag:`-o`}}}). There are two options: Option 1 (The current system): We exclude the arguments from the reference name of the flag. So {{{:ghc- flag:`-o`}}} is a valid reference that gets rendered as __-o__. The main issue with this system is loss of information. If someone wanted to include the flags in the link, they would have to do {{{:ghc-flag:`-o ⟨filename⟩ <-o>`}}}, which would render as __-o ⟨filename⟩__ but link to the same place as __-o__. This also leads to possibly different choices for the argument name. In fact, the definition has `⟨file⟩` but the reference table has `⟨filename⟩`. Option 2: We include the arguments in the reference name. So to make the reference, one would have to match the definition exactly: {{{:ghc-flag:`-o ⟨file⟩`}}} which would be rendered as __-o ⟨file⟩__, and {{{:ghc-flag:`-o ⟨filename⟩`}}} would not be a valid reference. This solves the loss of information issue from option 1, but does require the person documenting to check for the exact argument wording. I would argue for the second option as it is more consistent, but either is workable. Also note that the current parser automatically converts < (less than) into ⟨, so dealing with special characters is very easy. And these issues also apply to flags that use '='. I thought it best to ask before I converted everything to one way of dealing with these. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13980> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13980: Broken ghc-flag links in the users guide -------------------------------------+------------------------------------- Reporter: patrickdoc | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Documentation | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3778 Wiki Page: | -------------------------------------+------------------------------------- Changes (by patrickdoc): * status: new => patch * failure: None/Unknown => Documentation bug * differential: => Phab:D3778 Comment: I've submitted a patch implementing option 2. Additionally, a fair bit of work was done to bring all the other pieces into line, so now almost all flag related references should be valid. Those that are not (there are about 350) are references to flags with no documentation. I noticed that most places in the docs that referenced flags with arguments manually appended them to the ref anyway. This way they are now automatically included. I also added a note about how to quickly find the proper flag argument names for easy copy-pasting. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13980#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13980: Broken ghc-flag links in the users guide -------------------------------------+------------------------------------- Reporter: patrickdoc | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Documentation | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3778 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Thanks a lot for doing this, patrickdoc! If you are familiar with Sphinx, it would also be great to knock off #11654 so we can drop `mkUserGuidePart`. In principle I would even be okay with dropping the options summary table if that makes things easier (which would also issues like #12155 out of existance). However, the problem is we still need the flag descriptions for the manpage. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13980#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13980: Broken ghc-flag links in the users guide -------------------------------------+------------------------------------- Reporter: patrickdoc | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Documentation | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3778 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Also, #14023 would be another nice thing to polish off. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13980#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13980: Broken ghc-flag links in the users guide -------------------------------------+------------------------------------- Reporter: patrickdoc | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Documentation | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3778 Wiki Page: | -------------------------------------+------------------------------------- Comment (by patrickdoc): I am not familiar with Sphinx outside of this brief expedition, but I would certainly be willing to take on those tickets. I'm making a full pass of the users guide in general, so I can work those in too. This just happened to be a relatively self-contained chunk. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13980#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13980: Broken ghc-flag links in the users guide -------------------------------------+------------------------------------- Reporter: patrickdoc | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Documentation | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3778 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"44b090be9a6d0165e2281542a7c713da1799e885/ghc" 44b090b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="44b090be9a6d0165e2281542a7c713da1799e885" users-guide: Standardize and repair all flag references This patch does three things: 1.) It simplifies the flag parsing code in `conf.py` to properly display flag definitions created by `.. (ghc|rts)-flag::`. Additionally, all flag references must include the associated arguments. Documentation has been added to `editing-guide.rst` to explain this. 2.) It normalizes all flag definitions to a similar format. Notably, all instances of `<>` have been replaced with `⟨⟩`. All references across the users guide have been updated to match. 3.) It fixes a couple issues with the flag reference table's generation code, which did not handle comma separated flags in the same cell and did not properly reference flags with arguments. Test Plan: `SPHINXOPTS = -n` to activate "nitpicky" mode, which reports all broken references. All remaining errors are references to flags without any documentation. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13980 Differential Revision: https://phabricator.haskell.org/D3778 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13980#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13980: Broken ghc-flag links in the users guide -------------------------------------+------------------------------------- Reporter: patrickdoc | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Documentation | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3778 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): You will likely want to rebase on top of `master` as I did a pass over the users guide as well (see .2dff2c7fbb5aa68445e617d691451c0427fad0a5). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13980#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13980: Broken ghc-flag links in the users guide -------------------------------------+------------------------------------- Reporter: patrickdoc | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.2 Component: Documentation | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Documentation | Unknown/Multiple bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3778 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.2.2 Comment: Merged for GHC 8.2.2 as well. I believe we can now close this. Thanks patrickdoc! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13980#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC