Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
a95f7185
Commit
a95f7185
authored
Oct 04, 2019
by
Ben Gamari
🐢
Committed by
Marge Bot
Oct 08, 2019
Browse files
doc: Write out documented flag list
parent
98c09422
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/users_guide/flags.py
View file @
a95f7185
...
...
@@ -53,6 +53,8 @@ from sphinx.errors import SphinxError
from
distutils.version
import
LooseVersion
from
utils
import
build_table_from_list
import
os.path
### Settings
# Categories to titles as well as a canonical list of categories
...
...
@@ -590,15 +592,23 @@ class ExtensionPrintDirective(Directive):
### Additional processing
# Convert every flagprint node into its output format
def
process_print_nodes
(
app
,
doctree
,
fromdocname
):
# Convert every flagprint node into its output format
for
node
in
doctree
.
traverse
(
flagprint
):
node
.
generate_output
(
app
,
fromdocname
)
for
node
in
doctree
.
traverse
(
extensionprint
):
node
.
generate_output
(
app
,
fromdocname
)
# Write out file listing all documented flags
with
open
(
os
.
path
.
join
(
app
.
outdir
,
'ghc-flags.txt'
),
'w'
)
as
f
:
flag_names
=
\
{
name
for
flag
in
app
.
env
.
all_flags
for
name
in
flag
[
'names'
]}
f
.
write
(
'
\n
'
.
join
(
flag_names
))
# To avoid creating duplicates in the serialized environment, clear all
# flags originating from a file before re-reading it.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment