Skip to content

[skip circleci] Update code documentation generation instructions #2288

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

Closed
wants to merge 5 commits into from

Conversation

jneira
Copy link
Member

@jneira jneira commented Oct 21, 2021

  • The cabal command generates:
documentation: True

package *
  documentation: True
  ghc-options: -haddock

program-options
  ghc-options: -haddock

//cc @georgefst @DunetsNM @eirikm

@georgefst
Copy link
Collaborator

We should also mention that documentation: True can be set globally in ~/.cabal/config.

@jneira
Copy link
Member Author

jneira commented Oct 21, 2021

We should also mention that documentation: True can be set globally in ~/.cabal/config.

yeah, thanks for noting it

@jneira
Copy link
Member Author

jneira commented Oct 22, 2021

I tried

  ```yaml
  build:
    haddock: true

and the links are not shown for local package definitions.
@georgefst do you know why cabal's --enable-documentation makes them work?

As it seems does not work to show links
@jneira jneira requested a review from michaelpj October 22, 2021 05:32
Copy link
Collaborator

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look fine, although I haven't tried any of it!

@jneira jneira changed the title Update code documentation generation instructions [skip ci] Update code documentation generation instructions Oct 22, 2021
@georgefst
Copy link
Collaborator

@georgefst do you know why cabal's --enable-documentation makes them work?

Not really, no.

@georgefst
Copy link
Collaborator

On reflection, I think we should actually avoid merging this until #2194 is fixed somehow. There's not much point advertising a feature that's completely broken.

@jneira
Copy link
Member Author

jneira commented Oct 22, 2021

I've tried a cabal project removing and adding documentation: True and i not see any effect in documentation links: they are shown for dependencies and no for local packages definition in both cases.
I did a cabal clean and remove hie-bios cache between tests just in case.

@georgefst
Copy link
Collaborator

Behaviour here is very odd and needs further investigation. --enable-documentation is required for the Documentation link to show up, even though (as of a recent change?) that link leads to a webpage rather than the local copy which --enable-documentation caused to be built.

@jneira
Copy link
Member Author

jneira commented Oct 22, 2021

even though (as of a recent change?) that link leads to a webpage rather than the local copy which --enable-documentation caused to be built.

there is a vscode config option to open docs locally as before, but we decided to set open in hackage the default due to broken links

@jneira jneira requested a review from michaelpj October 22, 2021 09:45
@jneira jneira marked this pull request as draft October 22, 2021 09:45
@jneira
Copy link
Member Author

jneira commented Oct 22, 2021

Behaviour here is very odd and needs further investigation.

agree

@georgefst
Copy link
Collaborator

I've tried a cabal project removing and adding documentation: True and i not see any effect in documentation links: they are shown for dependencies and no for local packages definition in both cases. I did a cabal clean and remove hie-bios cache between tests just in case.

Huh, that's weird. I'm on Linux, GHC 8.10.7, Cabal 3.6.0.0, FWIW. Can easily reproduce with a simple exe package that has just one dependency on extra: --enable-documentation makes the difference as to whether I see the Documentation link for splitOn.

@jneira
Copy link
Member Author

jneira commented Oct 22, 2021

thanks , will try to reproduce, just to be sure the behaviour is:

  • with no config options, there is no docs neither links on hover
  • with --ghc-options=-haddock you get docs but no link
  • with --enable-documentation you get the link but no docs
  • with both (and only with both) --ghc-options=-haddock --enable-documentation you get docs and links
    ??

@georgefst
Copy link
Collaborator

thanks , will try to reproduce, just to be sure the behaviour is:

* with no config options, there is no docs neither links on hover

* with `--ghc-options=-haddock` you get docs but no link

* with `--enable-documentation` you get the link but no docs

* with both (and only with both) `--ghc-options=-haddock --enable-documentation` you get docs and links
  ??

Correct.

@georgefst
Copy link
Collaborator

even though (as of a recent change?) that link leads to a webpage rather than the local copy which --enable-documentation caused to be built.

there is a vscode config option to open docs locally as before, but we decided to set open in hackage the default due to broken links

Aha, that explains a few things! See #2194 (comment).

@georgefst
Copy link
Collaborator

georgefst commented Oct 22, 2021

On reflection, I think we should actually avoid merging this until #2194 is fixed somehow. There's not much point advertising a feature that's completely broken.

I'm also wary of haskell/cabal#7690 (comment), though I have no idea what's going on there.

@jneira jneira changed the title [skip ci] Update code documentation generation instructions [skip circleci] Update code documentation generation instructions Oct 28, 2021
@jneira jneira closed this Feb 4, 2022
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.

4 participants