Skip to content

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

Merged
merged 2 commits into from
Feb 14, 2018

Conversation

harpocrates
Copy link
Collaborator

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 and cabal haddock --hyperlinked-source.


Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

Please also shortly describe how you tested your change. Bonus points for added tests!

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.
@23Skidoo
Copy link
Member

Nice, thanks a lot!

@harpocrates harpocrates changed the title Feature/haddock hyperlinker Support Haddock's hyperlinker Feb 13, 2018
@harpocrates
Copy link
Collaborator Author

Looks like in some cases CI is unreliable? Anything I should do to make things green?

@23Skidoo
Copy link
Member

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.

Copy link
Member

@23Skidoo 23Skidoo left a 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
Copy link
Member

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.

Copy link
Collaborator Author

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?

Copy link
Member

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.

@23Skidoo
Copy link
Member

I guess we should also deprecate the cabal hscolour command in favour of cabal haddock --hyperlink-source.

@harpocrates
Copy link
Collaborator Author

@23Skidoo What does deprecation involve (beyond changing the options description)?

@23Skidoo 23Skidoo merged commit 55588e0 into haskell:master Feb 14, 2018
@23Skidoo
Copy link
Member

Merged, thanks!

@23Skidoo
Copy link
Member

@harpocrates

What does deprecation involve (beyond changing the options description)?

A changelog note + I think we should make cabal hscolour print a warning that it's going to be removed in the next release (3.0).

harpocrates added a commit that referenced this pull request Mar 27, 2018
* 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.
harpocrates added a commit to harpocrates/cabal that referenced this pull request Jun 8, 2018
* 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.
23Skidoo pushed a commit that referenced this pull request Jun 9, 2018
* 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.
23Skidoo pushed a commit that referenced this pull request Jun 13, 2018
* 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.
23Skidoo pushed a commit that referenced this pull request Jun 13, 2018
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants