Coder Social home page Coder Social logo

parma's People

Contributors

antoinelamy avatar daniloc avatar dasautoooo avatar iberatkaya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

parma's Issues

Support for code block, blockquote etc.

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?

  • Divider
  • Multi-level ordered list
  • Block quote
  • Code block

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

Paragraph styling

It looks like the following function isn’t called anywhere, not sure if it should be or not.

/// Define the paragraph text style.
/// - Parameter text: The text string captured from paragraph.
func paragraph(text: String) -> Text

I ended up having to use

func paragraphBlock(view: AnyView) -> AnyView

instead.

As a user, I'd like to have .leading alignment by default, not .center

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.

Hyperlinks?

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!

Linebreak

Hi,

I can't seem to get line breaks to work. Are these not supported yet ?

Thanks

imageView fails

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

Line Limit modifier produces very unexpected results

    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

How to render image?

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.

How to modify Text inside listItem?

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.

Adjacent bold and italic render incorrectly

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.

Ability to calculate the height of the view

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?

Custom Tags

Hi, is it possible to add custom tags and define their appearance?
For example:

[Detail](This is a detail text)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.