From 5c10f5ce8831a59f67f2c42ed5d7cf5be10c0860 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 4 Jan 2016 16:43:02 +0100 Subject: users_guide: Add ghci-cmd directive Note only does this make the markup cleaner and more semantic, but it clears up some warnings and enables proper hyperlinks. Yay Sphinx! While I was at it I generally cleaned up the markup Test Plan: Read it Reviewers: hvr, thomie, austin Differential Revision: https://phabricator.haskell.org/D1730 --- docs/users_guide/conf.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs/users_guide/conf.py') diff --git a/docs/users_guide/conf.py b/docs/users_guide/conf.py index e7c203b5b7..f7c6c14672 100644 --- a/docs/users_guide/conf.py +++ b/docs/users_guide/conf.py @@ -110,3 +110,17 @@ texinfo_documents = [ u'GHC Team', 'GHCUsersGuide', 'The Glasgow Haskell Compiler.', 'Compilers'), ] + +def parse_ghci_cmd(env, sig, signode): + from sphinx import addnodes + name = sig.split(';')[0] + sig = sig.replace(';', '') + signode += addnodes.desc_name(name, sig) + return name + +def setup(app): + # the :ghci-cmd: directive used in ghci.rst + app.add_object_type('ghci-cmd', 'ghci-cmd', + parse_node=parse_ghci_cmd, + objname='GHCi command', + indextemplate='pair: %s; GHCi command') -- cgit v1.2.1