summaryrefslogtreecommitdiff
path: root/docs/users_guide/flags.py
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-11-27 14:01:02 -0500
committerBen Gamari <ben@smart-cactus.org>2017-11-27 20:28:37 -0500
commite4dc2cd51902a8cd83476f861cf52996e5adf157 (patch)
tree48caa6602cd630b76c440fd57627e68e19bfd295 /docs/users_guide/flags.py
parenteb86e867694bceedfb47a527d71429197ffe6dda (diff)
downloadhaskell-e4dc2cd51902a8cd83476f861cf52996e5adf157.tar.gz
relnotes: Rework treatment of included package list
Previously the included package lists took a disproportionate amount of space in the resulting document and were difficult to maintain. Turn it into a table. Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D4230
Diffstat (limited to 'docs/users_guide/flags.py')
-rw-r--r--docs/users_guide/flags.py26
1 files changed, 1 insertions, 25 deletions
diff --git a/docs/users_guide/flags.py b/docs/users_guide/flags.py
index 66b0e92eff..cc30b8c066 100644
--- a/docs/users_guide/flags.py
+++ b/docs/users_guide/flags.py
@@ -49,6 +49,7 @@ from docutils.parsers.rst import Directive, directives
from sphinx import addnodes
from sphinx.domains.std import GenericObject
from sphinx.errors import SphinxError
+from utils import build_table_from_list
### Settings
@@ -326,31 +327,6 @@ class LanguageExtension(GenericFlag):
### Flag Printing
-# Taken from Docutils source inside the ListTable class. We must bypass
-# using the class itself, but this function comes in handy.
-def build_table_from_list(table_data, col_widths):
- table = nodes.table()
- tgroup = nodes.tgroup(cols=len(col_widths))
- table += tgroup
- for col_width in col_widths:
- colspec = nodes.colspec(colwidth=col_width)
- tgroup += colspec
- rows = []
- for row in table_data:
- row_node = nodes.row()
- for cell in row:
- entry = nodes.entry()
- entry += cell
- row_node += entry
- rows.append(row_node)
- thead = nodes.thead()
- thead.extend(rows[:1])
- tgroup += thead
- tbody = nodes.tbody()
- tbody.extend(rows[1:])
- tgroup += tbody
- return table
-
# Generate a table of flags
def generate_flag_table(flags, category):