Commit df8d036c authored by Edward Z. Yang's avatar Edward Z. Yang Committed by GitHub
Browse files

Merge pull request #3842 from sopvop/master

Even more docs beautification
parents a6066e54 dae579de
......@@ -55,3 +55,6 @@ dist-test
register.sh
/Cabal/tests/PackageTests/Configure/include/HsZlibConfig.h
/Cabal/tests/PackageTests/Configure/zlib.buildinfo
# python artifacts from documentation builds
*.pyc
......@@ -2,6 +2,7 @@
{% block menu %}
{{ super() }}
<a href="cabal-projectindex.html">Reference</a>
<a href="genindex.html">Index</a>
{% endblock %}
This diff is collapsed.
......@@ -11,6 +11,8 @@ import sphinx_rtd_theme
# Support for :base-ref:, etc.
sys.path.insert(0, os.path.abspath('.'))
import cabaldomain
version = "1.25"
extensions = ['sphinx.ext.extlinks']
......@@ -40,6 +42,8 @@ release = version # The full version, including alpha/beta/rc tags.
highlight_language = 'cabal'
#pygments_style = 'tango'
primary_domain = 'cabal'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['.build', "*.gen.rst"]
......@@ -190,7 +194,8 @@ def setup(app):
doc_field_types=[
Field('since', label='Introduced in GHC version', names=['since']),
])
app.add_lexer('cabal', CabalLexer())
cabaldomain.setup(app)
def increase_python_stack():
# Workaround sphinx-build recursion limit overflow:
......@@ -200,29 +205,3 @@ def increase_python_stack():
# Default python allows recursion depth of 1000 calls.
sys.setrecursionlimit(10000)
import pygments.lexer as lexer
import pygments.token as token
import re
class CabalLexer(lexer.RegexLexer):
name = 'Cabal'
aliases = ['cabal']
filenames = ['.cabal']
flags = re.MULTILINE
tokens = {
'root' : [
(r'\n', token.Text),
(r'^\s*(--.*)$', token.Comment.Single),
# key: value
(r'^(\s*)([\w\-_]+)(:)',
lexer.bygroups(token.Whitespace, token.Keyword, token.Punctuation)),
(r'^([\w\-_]+)', token.Keyword), # library, executable, flag etc.
(r'[^\S\n]+', token.Text),
(r'(\n\s*|\t)', token.Whitespace),
(r'&&|\|\||==|<=|>=|<|>|^>=', token.Operator),
(r',|:|{|}', token.Punctuation),
(r'.', token.Text)
],
}
This diff is collapsed.
......@@ -146,6 +146,8 @@ The layout of these secure local repos matches the layout of remote
repositories exactly; the :hackage-pkg:`hackage-repo-tool`
can be used to create and manage such repositories.
.. _installing-packages:
Building and installing packages
================================
......@@ -441,6 +443,8 @@ The various commands and the additional options they support are
described below. In the simple build infrastructure, any other options
will be reported as errors.
.. _setup-configure:
setup configure
---------------
......@@ -585,7 +589,7 @@ package:
In the simple build system, *dir* may contain the following path
variables: ``$prefix``, ``$pkgid``, ``$pkg``, ``$version``,
``$compiler``, ``$os``, ``$arch``, ``$abi``, \`$abitag
``$compiler``, ``$os``, ``$arch``, ``$abi``, ``$abitag``
.. option:: --libdir=dir
......@@ -1252,6 +1256,8 @@ Miscellaneous options
Specify a soft constraint on versions of a package. The solver will
attempt to satisfy these preferences on a "best-effort" basis.
.. _setup-build:
setup build
-----------
......@@ -1271,6 +1277,8 @@ This command takes the following options:
specified at the build step are in addition not in replacement of
any options specified at the configure step.
.. _setup-haddock:
setup haddock
-------------
......@@ -1338,6 +1346,8 @@ This command takes the following options:
runhaskell Setup.hs hscolour --css=*path*
.. _setup-hscolour:
setup hscolour
--------------
......@@ -1360,6 +1370,8 @@ This command takes the following options:
the given CSS file to the directory with the generated HTML files
(renamed to ``hscolour.css``) rather than linking to it.
.. _setup-install:
setup install
-------------
......@@ -1370,7 +1382,7 @@ register the package with the compiler, i.e. make the modules it
contains available to programs.
The `install locations <#installation-paths>`__ are determined by
options to ``setup configure``.
options to `setup configure`_.
This command takes the following options:
......@@ -1386,6 +1398,8 @@ This command takes the following options:
the default if the :option:`setup configure --user` option was supplied
to the ``configure`` command.)
.. _setup-copy:
setup copy
----------
......@@ -1401,6 +1415,8 @@ This command takes the following option:
Specify the directory under which to place installed files. If this is
not given, then the root directory is assumed.
.. _setup-register:
setup register
--------------
......@@ -1464,6 +1480,8 @@ This command takes the following options:
supplemental files installed --- plain Haskell libraries should be
fine.
.. _setup-unregister:
setup unregister
----------------
......@@ -1489,12 +1507,14 @@ This command takes the following options:
``unregister.sh``, on Windows, ``unregister.bat``. This script might
be included in a binary bundle, to be run on the target system.
.. _setup-clean:
setup clean
-----------
Remove any local files created during the ``configure``, ``build``,
``haddock``, ``register`` or ``unregister`` steps, and also any files
and directories listed in the ``extra-tmp-files`` field.
and directories listed in the :pkg-field:`extra-tmp-files` field.
This command takes the following options:
......@@ -1553,6 +1573,8 @@ the package.
quote options containing spaces because a single option is assumed,
so options will not be split on spaces.
.. _setup-sdist:
setup sdist
-----------
......
This diff is collapsed.
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