Skip to content
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

[Feature][UI] Description field - support simple markup #2796

Open
mwerle opened this issue Jun 23, 2019 · 3 comments
Open

[Feature][UI] Description field - support simple markup #2796

mwerle opened this issue Jun 23, 2019 · 3 comments
Labels
Enhancement GUI Issues affecting the interactive GUI

Comments

@mwerle
Copy link
Contributor

mwerle commented Jun 23, 2019

Problem

Is your feature request related to a problem? Please describe.
Longer descriptions are just a contiguous unformatted blob of text, making it difficult to read.

Suggestions

Describe the solution you'd like
Support a recognised markup scheme (my favourite would be "Markdown", or at least a sub-set of it) in order to allow people to add nice-looking descriptions for their mods from within the CKAN GUI.

Describe alternatives you've considered
Support a custom very simple markup format with a very restricted set of markup (eg, newlines, bold, italic), the most important of which is support for newlines.

Possible Issues
How would the Command-line tools render this?

Additional context
Look at "Nehemiah Engineering Orbital Science" for a mod which would benefit from at least having line-breaks in its description. (In fact, line-breaks are in the meta-data, but are not displayed)

@DasSkelett DasSkelett added Enhancement GUI Issues affecting the interactive GUI labels Jun 23, 2019
@DasSkelett
Copy link
Member

On my system (Kubuntu using mono 5.20.1.19) line-breaks are displayed, which OS are you using?

It's only a handful of mods using the description field, so in my opinion there's only a very little benefit of adding bold and italic formatting support, and creating a new standard just for that.

'Easiest' to implement would probably be Microsoft's RTF (in case mono is supporting it), but that's a pain to write, looking at the given example.

Everything else will be really complicated, since we either need to parse it to RTF and display it in a RichTextBox, or create a custom Label/TextBox derived class controlling the rendering directly with GDI+.
That's what I got from here: https://stackoverflow.com/questions/11311/formatting-text-in-winform-label

Or somebody finds a good library with the right licence.

@mwerle
Copy link
Contributor Author

mwerle commented Jun 24, 2019

I've been mostly working on Windows recently (I miss my Linux!!) so possibly a "\r\n" vs "\n" issue (I put "\n" into the description) . Would have thought it would render either correctly or incorrectly regardless of host OS. So that might be something to look into.

And yes, I know only a few mods use "Description" so far, but it would be nice if more did, allowing users to browse mods in CKAN instead of having to click on the links to get more information. Was just a thought that making it look more appealing might garner more support.

So yes, this is mostly a very low priority wishlist item.

@HebaruSan
Copy link
Member

HebaruSan commented Jan 9, 2021

I've been looking at options for text formatting to address some unrelated issues with the auto update dialog, and it looks like this may not be possible to do well in a cross platform way. Mono's RichTextBox is shockingly, atrociously incomplete—if your document has something as simple as a bullet point character, RichTextBox prints an asterisk to the console instead of adding a bullet point to the application window; I'm not sure it handles any actual formatting at this point:

https://github.com/mono/mono/blob/f1db846a0ab24144adbd5847b93ee3c223db887e/mcs/class/System.Windows.Forms/System.Windows.Forms/RichTextBox.cs#L1990-L1993

(Update: It doesn't seem to (handle any actual formatting); I tried using RTF syntax to make the font bold and larger, and it had no effect. Mono ships a plain textbox named RichTextBox. 🤮)

And Mono's WebBrowser doesn't work at all! It displays NOTHING in the application and prints this to the console:

libgluezilla not found. To have webbrowser support, you need libgluezilla installed

(Side note, I do have libmono-webbrowser4.0-cil installed, as suggested by most StackExchange discussions of this error. So that doesn't solve it, and even if there is some other solution, supporting all Linux users through it is not viable.)

So the two big obvious options for displaying formatted text in WinForms, are essentially Windows-only solutions. Even if a third party control could do this (I'm skeptical because if it was that easy, why can't Mono do it?), that would amount to embedding a web browser in ckan.exe, which seems like kind of extreme overkill for one or two dialogs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement GUI Issues affecting the interactive GUI
Projects
None yet
Development

No branches or pull requests

3 participants