Commit 42411899 authored by Leonid Onokhov's avatar Leonid Onokhov

Fix highlighting in all docs

Also makes 'cabal' a default highlighter
parent 0a53171b
......@@ -37,7 +37,7 @@ copyright = u'2016, Cabal Team'
release = version # The full version, including alpha/beta/rc tags.
# Syntax highlighting
highlight_language = 'haskell'
highlight_language = 'cabal'
#pygments_style = 'tango'
# List of patterns, relative to source directory, that match files and
......@@ -221,7 +221,7 @@ class CabalLexer(lexer.RegexLexer):
(r'^([\w\-_]+)', token.Keyword), # library, executable, flag etc.
(r'[^\S\n]+', token.Text),
(r'(\n\s*|\t)', token.Whitespace),
(r'&&|\|\||==|<=|>=|<|>|^=', token.Operator),
(r'&&|\|\||==|<=|>=|<|>|^>=', token.Operator),
(r',|:|{|}', token.Punctuation),
(r'.', token.Text)
......@@ -1314,6 +1314,7 @@ demonstrate the use of the ``exitcode-stdio-1.0`` interface.
.. code-block:: cabal
:caption: foo.cabal
:name: foo-bench.cabal
Name: foo
Version: 1.0
.. highlight:: console
Cabal is the standard package system for
Haskell_ software. It helps people to
configure, build and install Haskell software and to distribute it
......@@ -60,8 +62,8 @@ Developers can use the tool with packages in local directories, e.g.
cd foo/
cabal install
$ cd foo/
$ cabal install
While working on a package in a local directory, developers can run the
individual steps to configure and build, and also generate documentation
......@@ -71,7 +73,7 @@ It is also possible to install several local packages at once, e.g.
cabal install foo/ bar/
$ cabal install foo/ bar/
Developers and users can use the tool to install packages from remote
Cabal package archives. By default, the ``cabal`` tool is configured to
......@@ -81,7 +83,7 @@ with any other suitable archive.
cabal install xmonad
$ cabal install xmonad
This will install the ``xmonad`` package plus all of its dependencies.
......@@ -91,8 +93,8 @@ example
cabal install foo-1.0.tar.gz
cabal install
$ cabal install foo-1.0.tar.gz
$ cabal install
Cabal provides a number of ways for a user to customise how and where a
package is installed. They can decide where a package will be installed,
......@@ -165,17 +167,17 @@ parameters.
./configure --prefix=...
make install
$ ./configure --prefix=...
$ make
$ make install
compared to
cabal configure --prefix=...
cabal build
cabal install
$ cabal configure --prefix=...
$ cabal build
$ cabal install
Cabal's build system for simple packages is considerably less flexible
than make/automake, but has builtin knowledge of how to build Haskell
.. highlight:: shell
.. highlight:: console
......@@ -9,13 +9,13 @@ local builds with this command (configuring is not necessary):
cabal new-build
$ cabal new-build
To open a GHCi shell with this package, use this command:
cabal new-repl
$ cabal new-repl
Developing multiple packages
......@@ -44,29 +44,29 @@ this behavior; you will need to upgrade to HEAD.)
cabal new-build
$ cabal new-build
To build a specific package, you can either run ``new-build`` from the
directory of the package in question:
cd cabal-install
cabal new-build
$ cd cabal-install
$ cabal new-build
or you can pass the name of the package as an argument to
``cabal new-build`` (this works in any subdirectory of the project):
cabal new-build cabal-install
$ cabal new-build cabal-install
You can also specify a specific component of the package to build. For
example, to build a test suite named ``package-tests``, use the command:
cabal new-build package-tests
$ cabal new-build package-tests
Targets can be qualified with package names. So to request
``package-tests`` *from* the ``Cabal`` package, use
......@@ -288,8 +288,8 @@ Some example targets:
cabal new-build lib:foo-pkg # build the library named foo-pkg
cabal new-build foo-pkg:foo-tests # build foo-tests in foo-pkg
$ cabal new-build lib:foo-pkg # build the library named foo-pkg
$ cabal new-build foo-pkg:foo-tests # build foo-tests in foo-pkg
(There is also syntax for specifying module and file targets, but it
doesn't currently do anything.)
......@@ -324,6 +324,7 @@ this:
.. highlight:: cabal
constraints: HTTP ==4000.3.3,
HTTP +warp-tests -warn-as-error -network23 +network-uri -mtl1 -conduit10,
QuickCheck ==2.9.1,
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