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

Markdown preview widget #149

Closed
boussou opened this issue Mar 13, 2019 · 15 comments
Closed

Markdown preview widget #149

boussou opened this issue Mar 13, 2019 · 15 comments

Comments

@boussou
Copy link

boussou commented Mar 13, 2019

I need a control that will allow displaying basic HTML generated from markdown. So very simplistic HTML: bold,italic,ol,ul,p,br. including IMG tag
I would like to see it happen, and I am willing to pay for it.
Any volonteer?

@niaow
Copy link
Contributor

niaow commented Mar 13, 2019

If the goal is to render markdown, it would probably be easier to render the markdown itself rather than the HTML. HTML has lots of formatting quirks, whereas markdown is more minimalist. The popular blackfriday markdown package exports a syntax tree that could be used to set up some object tree in fyne.

@andydotxyz
Copy link
Member

I also would like to see this happen - and agree with @jadr2ddude. In fact I had already bookmarked blackfriday to explore once the 1.0 release was out :)

The only problem with ignoring the HTML approach is that embedded markup won’t work correctly - but we could find a way to deal with that in the short term I am sure.

@boussou
Copy link
Author

boussou commented Mar 14, 2019

Then the next problem is to be able to calculate the widget size after render. You have to understand the fyne internals for that

@andydotxyz
Copy link
Member

That should not be problematic at all - by implementing the layout it will automatically know the correct widget size?
Either it will cause a full space to render all the components, or it can be put into a ScrollContainer which could be set to a more suitable size if you want to scroll.

Unless I misunderstood your concern about sizing?

@boussou
Copy link
Author

boussou commented Mar 14, 2019

Ok, that is usually the faced problem in such case. So this lib appear to be well designed ;-)

@andydotxyz
Copy link
Member

Let's hope so!
We will see where this comes in the planning for 1.1 next week

@andydotxyz
Copy link
Member

I think we can see our way to add this to the 1.1 milestone. It will, however, require additional work before it can be implemented:

  • Add text wrap support to widget.textProvider
  • Text markup or style support in text blocks - so that sub-sections can be styled or linked, etc.

This is quite a bit of work and so I don't imagine it would come in early - I imagine that 1.1 could take 3 months to complete, but it has not been fully planned yet.

I was considering setting up a bounty source / donation system to support Fyne development, if that were in place would you (@boussou ) consider donating with the specific aim of accelerating this feature? Looking at the complexity it is a pretty large item of work...

@andydotxyz
Copy link
Member

Oh, also - can we rename this "Markdown preview widget"? I'd like to steer clear of thinking about HTML rendering for a long time ;)

@boussou
Copy link
Author

boussou commented Mar 18, 2019

@andydotxyz Yep. I have to take time to create account etc.

Having this available would be awesome.

@andydotxyz andydotxyz added this to the Release 1.1 milestone Mar 19, 2019
@andydotxyz andydotxyz changed the title Basic HTML rendering from Markdown Markdown preview widget Mar 20, 2019
@andydotxyz andydotxyz added the future Features that might take a while to be sheduled label May 1, 2019
@andydotxyz andydotxyz removed this from the Release 1.1 milestone May 1, 2019
@andydotxyz andydotxyz added this to the Release 1.2 milestone Jun 18, 2019
@andydotxyz andydotxyz removed this from the 1.2 - Mobile support milestone Oct 15, 2019
@andydotxyz andydotxyz added this to the 1.3 - Data Binding milestone Nov 20, 2019
@andydotxyz
Copy link
Member

OK I'm going out on a limb and saying that 1.3 will have some more widgets and that this should be one of them :)

@andydotxyz
Copy link
Member

Depends upon #332, after that we should start work on it

@matrixik
Copy link

Just a heads-up that some tools (like Hugo) started moving from blackfriday to goldmark because it is compliant with CommonMark.

@kcmvp
Copy link

kcmvp commented Feb 7, 2021

I really want this happen! As the md file may contain html section so it’s would be great to render as html

@andydotxyz
Copy link
Member

Sorry but we're not intending to support the HTML embedded rendering.
The markdown will be rendered as formatted text, not using a web engine.

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jun 26, 2021
Functionality is not complete, it will expand as RichText supports more.
Fixes fyne-io#149
@andydotxyz
Copy link
Member

Now on develop for testing

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

No branches or pull requests

6 participants