-
Notifications
You must be signed in to change notification settings - Fork 710
Support Haddock's hyperlinker #5140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Haddock's hyperlinker #5140
Conversation
Fixes haskell#4613. If a new enough version of Haddock is being used, `--hyperlink-source` will run via Haddock's `--hyperlinked-source` instead of going through HsColour.
Nice, thanks a lot! |
Looks like in some cases CI is unreliable? Anything I should do to make things green? |
I've restarted those builds. I think you should now also be able to do that if you log in to Travis with your GitHub ID. |
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.
LGTM.
@@ -54,6 +54,8 @@ | |||
into per-component condition trees anyway. Now it's finally been put | |||
out of its misery. | |||
* Add `BlockArguments` to `KnownExtension`. | |||
* `--hyperlinked-source` now uses Haddock's hyperlinker backend when |
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.
The cabal haddock
option name is --hyperlink-source
. We may want to add a --hyperlinked-source
synonym.
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.
@23Skidoo If you don't mind, I would very much like this - I've hit my head on it several times. In fact, could we change the primary option name to --hyperlinked-source
?
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.
Adding a synonym is fine, but I don't think we should change the config setting name, since people have old config files lying around and I don't want to break those without sufficient reason.
I guess we should also deprecate the |
@23Skidoo What does deprecation involve (beyond changing the options description)? |
Merged, thanks! |
A changelog note + I think we should make |
* warning in hscolour's description * warning when hscolour is run * added 'hyperlinked-source' (the name Haddock has for the option) as a synonym for 'hyperlink-source' Follows up comments from #5140.
* warning in hscolour's description * warning when hscolour is run * added 'hyperlinked-source' (the name Haddock has for the option) as a synonym for 'hyperlink-source' Follows up comments from haskell#5140.
* warning in hscolour's description * warning when hscolour is run * added 'hyperlinked-source' (the name Haddock has for the option) as a synonym for 'hyperlink-source' Follows up comments from #5140.
* warning in hscolour's description * warning when hscolour is run * added 'hyperlinked-source' (the name Haddock has for the option) as a synonym for 'hyperlink-source' Follows up comments from #5140.
* warning in hscolour's description * warning when hscolour is run * added 'hyperlinked-source' (the name Haddock has for the option) as a synonym for 'hyperlink-source' Follows up comments from #5140.
Fixes #4613. If a new enough version of Haddock is being used,
--hyperlink-source
will run via Haddock's--hyperlinked-source
instead of going through HsColour.I've tested this out with a recent version of GHC/Haddock (8.0.2) and an old version of GHC/Haddock (7.10.2), just to confirm that the fallback behaviour was working properly.
I'm doubly motivated to see this merge since there has been substantial progress on the Haddock hyperlinker backend (we use GHC's tokenizer, so tokenization is accurate as of haskell/haddock#714), and since I was recently bitten by the difference between
cabal haddock --haddock-option="--hyperlinked-sources
andcabal haddock --hyperlinked-source
.Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!