[GHC] #11654: User Guide: Generate command line options table from ghc-flags directives

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: 8.2.1 Component: Documentation | Version: 7.10.3 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: -------------------------------------+------------------------------------- Since the move to ReStructuredText and Sphinx we've generated the options summary tables and manpage with `utils/mkUserGuidePart`. The options are described in a set of Haskell modules which are a pain to edit and may easily fall out of date. It would be far better if we could generate these tables from the `.. ghc- flags` directives already present in the users guide. This will involve a bit of hacking with Sphinx, although it should be more than up to the task. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: task | Status: new Priority: normal | Milestone: 8.2.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by siddhanathan: @@ -7,1 +7,1 @@ - flags` directives already present in the users guide. This will involve a + flag` directives already present in the users guide. This will involve a New description: Since the move to ReStructuredText and Sphinx we've generated the options summary tables and manpage with `utils/mkUserGuidePart`. The options are described in a set of Haskell modules which are a pain to edit and may easily fall out of date. It would be far better if we could generate these tables from the `.. ghc- flag` directives already present in the users guide. This will involve a bit of hacking with Sphinx, although it should be more than up to the task. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.2.1 => 8.4.1 Comment: This won't happen for 8.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: patrickdoc Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by patrickdoc): * owner: (none) => patrickdoc Comment: The Sphinx tutorial on writing extensions is very similar to this: http ://shimizukawa-sphinx.readthedocs.io/en/latest/extdev/tutorial.html. That one just happens to use a list instead of a table. I'll see what I can do. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: patrickdoc Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by patrickdoc): I have a proof of concept for this. It's looking like the best plan is to wrap the table info into the declaration of a flag, something like: {{{ .. ghc-flag:: -v :shortdesc: verbose mode (equivalent to -v3) :type: dynamic :reverse: (none for this flag) Longer decription here... }}} Which would render as: **-v** Longer description here and then the table could look like, | **-v** | verbose mode (equivalent to -v3) | dynamic | | --- The main tasks remaining are figuring out the formatting of the table, determining what variables actually need to be passed around, and moving all the info into the flag declarations from the `mkUserGuidePart` files. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: patrickdoc Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Yay, thank you patrickdoc! Indeed that flag definition is exactly what I had in mind. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: patrickdoc Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by patrickdoc): Things are mostly working now, but a question has arisen. How do we want to categorize the flags? We could just have them grouped by source file (inflexible but simple). Alternatively, we could add an additional option to the flag declaration that chooses the category (flexible but requires specifying where every single flag should go). I could even make it an optional override deal where it is put under source file by default, but you can choose another if you want. I believe the current system is mostly source file based, but not entirely. I'm hesistant to add a 4th field to the declaration, so I thought I would ask if this is something worth supporting or not. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: patrickdoc Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Adding a category field sounds like the right solution. I'm not terribly worried about the field count but being able to specify a file-wide default would make this nicer. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: patrickdoc Type: task | Status: patch Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): D3839 Wiki Page: | -------------------------------------+------------------------------------- Changes (by patrickdoc): * status: new => patch * differential: => D3839 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: patrickdoc Type: task | Status: patch Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3839 Wiki Page: | -------------------------------------+------------------------------------- Changes (by patrickdoc): * differential: D3839 => Phab:D3839 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: patrickdoc
Type: task | Status: patch
Priority: normal | Milestone: 8.4.1
Component: Documentation | Version: 7.10.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3839
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: patrickdoc Type: task | Status: closed Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3839 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: Thanks Patrickdoc! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: patrickdoc Type: task | Status: closed Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3839 Wiki Page: | -------------------------------------+------------------------------------- Comment (by patrickdoc): What happens to the `mkUserGuidePart` code now? I seem to have left a bit of orphaned content laying around the build system and code comments. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: patrickdoc Type: task | Status: closed Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3839 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Indeed this should get cleaned up. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3839 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: closed => new * owner: patrickdoc => (none) * resolution: fixed => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: patch Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3839, Wiki Page: | Phab:D3886 -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: Phab:D3839 => Phab:D3839, Phab:D3886 Comment: Here is a quick attempt at ripping it out. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11654: User Guide: Generate command line options table from ghc-flags directives -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: task | Status: closed Priority: normal | Milestone: 8.4.1 Component: Documentation | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3839, Wiki Page: | Phab:D3886 -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: Phab:D3886 has been merged. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11654#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC