Commit a95f7185 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot
Browse files

doc: Write out documented flag list

parent 98c09422
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment