-
Notifications
You must be signed in to change notification settings - Fork 239
Conversation
5e68f07
to
33522ff
Compare
848a29c
to
8373782
Compare
@Kleidukos anything, beside resolving conflicts ;), that I can help to make this PR get reviewed / accepted? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, a pretty good PR. I left a couple of remarks, mostly extraneous blank lines, and a question about the Json parser you're committing. cc @coot
@coot Also, don't forget to open a PR to update the docs with the new option |
8373782
to
69da008
Compare
Which branch should I target, |
I see that the |
69da008
to
9a08ccd
Compare
@Kleidukos all your comments are addressed. |
@coot Wonderful, thank you very much for this contribution ✨ |
9a08ccd
to
c667a96
Compare
I spottved a typo in the description of |
This is certainly an improvement. Thanks @coot. The patch didn't do quite what I expected though, the resulting index has all the modules merged together from all different packages. and clicking on links from one package to another local package result in a rendering error, as the links are not correctly relative to the other copied documentation. |
@Kleidukos maybe you can help me: how one can build haddock I tried to use just released
Building with Wouldn't it be more convenient to support multiple versions of ghc by haddock? |
@coot Can you rebase on the current |
Thanks @Kleidukos, it worked :). |
c667a96
to
8906a23
Compare
@mpickering did you tried to pass an absolute url to |
Did you build haddock of sub-packages with |
8906a23
to
36c3173
Compare
I force pushed, because I found that the |
Aeson style FromJSON class with Parsec based json parser.
When creating haddock summary page for multiple packages render doc-index.json file using contents of all found 'doc-index.json' files.
When rendering html, render doc-index.json file independently of maybe_index_url option. doc-index.json file is useful now even if maybe_index_url is not `Nothing`.
New `Flag_BaseURL` which configures from where static files are loaded (--base-url). If given and not equal "." static files are not coppied, as this indicates that they are not read from the the directory where we'd copy them. The default value is ".".
29a6443
to
4899f99
Compare
4899f99
to
de8873e
Compare
All tests now pass :). |
@alexbiehl This is a pretty meaty PR, I'll need your eyes on that one for the end ;) |
Great job! Am I right that this could be used (perhaps with some changes) as a workaround for haddock not being able to produce sensible Hackage documentation for packages with many internal libraries? If this is trivial enough, could the necessary invocations be listed in documentation as well? I'd gladly test them on my multi-lib package. |
Yes you're right :).
Good point, I should add that; For now you can check here for instructions (the haddocs are served on github-pages). The ultimate goal is to have |
Alright it's squashed and merged. Thanks a lot for your patience @coot |
@Kleidukos my pleasure; since its merged to |
@coot I'll backport the patch to ghc-9.2 as well |
Let me know if you'll have any problems or need some help with testing. It's easy to get it wrong (or at least I got it wrong when I was rebasing). |
Okay sure, will ping you! :) |
Description
This PR allows to create documentation for multiple packages. It is useful if one has multiple packages in a single repository.
Workflow
Workflow to create documentation for multiple packages. It assumes that there are two packages
package-1
andpackage-2
.Configure & create haddocks
Add the following lines to
cabal.project.local
file (for every package):The newly added option
--base-url
configures the location from which static files will be loaded.One can now run:
To compile haddocks.
Copy documentation
Copy documentation to a common directory (
docs
in this example), e.g.Create index
The following command will create
html
index as welldoc-index.json
file by combiningdoc-index.json
files of all included packages.Serve
docs
directory and enjoy the documentation with a single html index and QuickSearch working across all projects.Changes
aeson
for serialisation and deserialisation ofdoc-index.json
files;doc-index.json
file for the summary page is generated fromdoc-index.json
files of all packages included with--read-interface
option (-i
);--base-url
flag (Flag_BaseURL
). If given and not equal to.
or./
static files (css, js, json) will not be copied. All pages will load them from the given url.Target branch
I am not sure which target branch I should pick for this PR, I choose
ghc-8.10
as this is the current version ofghc
.