-
Notifications
You must be signed in to change notification settings - Fork 105
Fix #622 Handle multi-line value for field description #623
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
Conversation
|
The CI is failing for reasons unrelated to this pull request. See: |
2af50c7 to
70d3a41
Compare
sellout
left a comment
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.
This looks good as far as I can tell. Shares code with the existing description formatting, looks like it correctly handles Cabal versioning 👍
What does ugly rendering mean? Something like this? flag my-flag
description: This is some text
.
This is more some text
manual: True
default: True |
|
@mpilgrem I'm gonna do a review, but can you please give me feedback on my question first? |
|
@sol, I am away from a machine, but the short answer is: in part. With a With a |
|
One thing I have not checked, but needs to be understood, is how Hackage renders a multi-paragraph description for a flag. (I know how Hackage renders a long description, because the EDIT: Now checked with a package candidate: Hackage does respect and render a multi-paragraph description for a Cabal flag. |
8a37854 to
d65dd67
Compare
|
@sol, the current solution uses flags:
my-flag:
description: |
This is some text
This is more some textrenders as: flag my-flag
description: This is some text
.
This is more some textHowever, the limitation is that if Hpack 'sniffs' from the flag my-flag
description: This is some text
.
This is more some textI consider that to be 'ugly'. |
OK, understand, thanks for pointing this out. I think the issue here is that A clean way to address this could be to add support for multi-line strings to I'd be happy to help with the code. But before doing so, I think it would help if we can answer the following questions:
|
|
@sol, given Cabal's current online documentation: I would expect all Cabal file fields that accept See:
Such fields are (1) top level: Also:
together suggest that such fields also include (1) top level: Empirically, the following (extract) is a valid Cabal file: cabal-version: 2.2
name: testDotStyle
version: 0.1.0.0
description: Paragraph one.
.
Paragraph two.
homepage: Paragraph one.
.
Paragraph two.
bug-reports: Paragraph one.
.
Paragraph two.
author: Paragraph one.
.
Paragraph two.
maintainer: Paragraph one.
.
Paragraph two.
copyright: Paragraph one.
.
Paragraph two.
stability: Paragraph one.
.
Paragraph two.
synopsis: Paragraph one.
.
Paragraph two.
category: Paragraph one.
.
Paragraph two.
build-type: Simple
source-repository head
type: git
location: Paragraph one.
.
Paragraph two.
flag my-flag
description: Paragraph one.
.
Paragraph two.EDIT: Although what Hackage expects or requires of a Cabal file can be a further consideration, for example: |
|
Rebased against |
See:
flagsdescriptionproduces invalid Cabal file #622This uses
LineSeparatedListso that:renders as:
otherwise I could not see how to avoid ugly rendering.