Commit 7463a95d authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

users-guide: Better error messages on incomplete ghc-flag directives

parent 3625728a
......@@ -28,6 +28,7 @@ from docutils import nodes
from docutils.parsers.rst import Directive, directives
from sphinx import addnodes
from sphinx.domains.std import GenericObject
from sphinx.errors import SphinxError
### Settings
......@@ -125,6 +126,12 @@ class Flag(GenericObject):
if 'noindex' in self.options:
return
# Validity checking
if 'shortdesc' not in self.options:
raise SphinxError('ghc-flag (%s) directive missing :shortdesc: key' % self.names)
if 'type' not in self.options:
raise SphinxError('ghc-flag (%s) directive missing :type: key' % self.names)
# Set the flag category (default: misc)
self.category = 'misc'
if not 'category' in self.options or self.options['category'] == '':
......
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