[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

#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