Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
haddock
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jade
haddock
Commits
9c25808e
Verified
Commit
9c25808e
authored
4 years ago
by
Marcin Szamotulski
Browse files
Options
Downloads
Patches
Plain Diff
Document multi component support
parent
00f5c936
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/index.rst
+1
-0
1 addition, 0 deletions
doc/index.rst
doc/multi-components.rst
+48
-0
48 additions, 0 deletions
doc/multi-components.rst
with
49 additions
and
0 deletions
doc/index.rst
+
1
−
0
View file @
9c25808e
...
...
@@ -13,6 +13,7 @@ Contents:
invoking
markup
common-errors
multi-components
Indices and tables
...
...
This diff is collapsed.
Click to expand it.
doc/multi-components.rst
0 → 100644
+
48
−
0
View file @
9c25808e
Haddocks of multiple components
===============================
Haddock supports building documentation of multiple components. First, one
needs to build haddocks of all components which can be done with:
.. code-block:: none
cabal haddock --haddock-html \
--haddock-quickjump \
--haddock-option="--use-index=../doc-index.html" \
--haddock-option="--use-contents=../index.html" \
--haddock-option="--base-url=.." \
all
The new ``--base-url`` option will allow to access the static files from the
main directory (in this example its the relative ``./..`` directory). It will
also prevent ``haddock`` from copying its static files to each of the
documentation folders, we're only need a single copy of them where the
``--base-url`` option points to.
The second step requires to copy all the haddocks to a common directory, let's
say ``./docs``, this will depend on your project and it might look like:
.. code-block:: none
cp -r dist-newstyle/build/x86_64-linux/ghc-9.0.1/package-a-0.1.0.0/doc/html/package-a/ docs
cp -r dist-newstyle/build/x86_64-linux/ghc-9.0.1/package-b-0.1.0.0/doc/html/package-b/ docs
Note that you can also include documentation of other packages in this way,
e.g. ``base``, but you need to know where it is hidden on your hard-drive.
To build html and js (``quickjump``) indexes one can now invoke ``haddock`` with:
.. code-block:: none
haddock \
-o docs \
--quickjump --gen-index --gen-contents \
--read-interface=package-a,docs/package-a/package-a.haddock \
--read-interface=package-b,docs/package-b/package-b.haddock
Note: the ``PATH`` in ``--read-interface=PATH,...`` must be a relative url of
a package it points to (relative to the ``docs`` directory).
There's an example project which shows how to do that posted `here
<https://github.com/coot/haddock-example>`_, which haddocks are served on
`github-pages <https://coot.github.io/haddock-example>`_.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment