dasautoooo / parma Goto Github PK
View Code? Open in Web Editor NEWA SwiftUI view for displaying Markdown with customizable appearances.
License: MIT License
A SwiftUI view for displaying Markdown with customizable appearances.
License: MIT License
Hi, is it possible to add custom tags and define their appearance?
For example:
[Detail](This is a detail text)
I have some markdown text like this:
And this is my body
And when I use the plaintText(_ text: String) to provide a font for the plain body text, it overrides the header font changes value and forces all text from the entire string an displays it with the same font
I just noticed that when my markdown includes bold and italic text separated by a space, the space does not appear in the rendered result. That is:
**bold** _italic_
renders as: bolditalic.
You list hyperlinks under "Unsupported" rather than "Possibly Support in Future Versions", but I see the stub for the function
func link(textView: Text, destination: String?) -> Text
.
Is there anything that can be done with it at this point? I can see how to use it to style the textView, but since the result is a Text
view there's no way to add an .onTapGesture()
modifier in the function, is there?
Thank you for this terrific package!
Hi,
I can't seem to get line breaks to work. Are these not supported yet ?
Thanks
Hi,
Fiest of all thank you for this project it really looks fantastic and would solve a problem in my current application.
Could you please elaborate what is currently stopping the implementation of the types stated in the readme?
As far as I can see these types are supported from Down and there even exist commented code for some of these types?
I would really like to understand the current issue with these to make sure whether this library could be useful for my project or not.
Kind regards,
David
Parma(markdown, render: MyRender())
.lineLimit(1)
I would expect this to work similarly to Text or not at all.. but it does work. Just not predictably.
It clips each line. Looks like it might be applying the limit to literally each line individually.
Any workaround suggestions would be greatly appreciated
Consider the following examples and their respective expected results:
Markdown | Expected Result | Actual Result | Is Correct? | |
---|---|---|---|---|
1 | **[Bold-Link]()** |
Bold-Link | Bold-Link | Yes |
2 | **Bold [Link]()** |
Bold Link | Link | No |
3 | **[Link]() Bold** |
Link Bold | Bold (this actually should have a space before the word | No |
Any tips on how to fix this would be highly appreciated
It looks like the following function isn’t called anywhere, not sure if it should be or not.
Parma/Sources/Parma/Render/ParmaRenderable.swift
Lines 21 to 23 in 3c213ac
I ended up having to use
func paragraphBlock(view: AnyView) -> AnyView
instead.
Says it was looking for the x86_64
version and did not find it.
Thanks for building this great lib, but I could not find a example how to render a image, just tried with
![](https://picsum.photos/200/300.jpg)
but not working.
This is fantastic, thank you so much!
I noticed that ,by default, the render is centered, which is uncommon, I believe.
How can I change that to leading?
Ideally, .leading should be the default render without the need for any configuration.
Once again, thanks for this fantastic work and building such a simple SwiftUI component.
Hi @dasautoooo! Parma is working really fine on what I was doing, but there is just one thing I can't achieve yet:
Is there a way to modify the Text view inside the listItem
method without using the plainText
one?
In my case I have both a heading and a bullet list, so If I modify the Text view inside the plainText
method the Text view inside heading
is also being modified, and I don't want that. I already tried with paragraph
but nothing happens.
Thanks in advance,
Francisco.
I am planning to use this view to display messages as markdown in a UICollectionView cell that hosts a SwiftUI view. How would I be able to pre-calculate the required height this view will be based on a string and a constrained width?
Hello and thanks for ur great work!
I've run into one issue related to images. I've derived from ParmaRenderable as discribed as follows:
struct AlculateRender: ParmaRenderable {
func imageView(with urlString: String) -> AnyView {
AnyView(Text(urlString))
}
}
and initialize Parma with it. But the imageView function never got executed. So started a bit of debugging and the Image ElementComposer never called the imageView function.
struct ImageElementComposer: BlockElementComposer {
func view(in context: ComposingContext, render: ParmaRenderable) -> AnyView {
guard let urlString = context.attributes["destination"] else {
return AnyView(EmptyView())
}
return render.imageView(with: urlString)
}
}
The guard statement fails and it returns the EmptyView. The context.attributes contains one key/value element = ["xml:space", "preserve"], which is weired.
I tried the following markdown:
![Image](http://url/a.png)
![Image][1]
[1]: http://url/b.jpg
Before i start further debugging, i may ask if u have any idea about that.
Thanks in advance
Hello. It is very common to use a strikethrough text style. Could you please add support for that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.