Code Monkey home page Code Monkey logo

Comments (8)

patrick-steele-idem avatar patrick-steele-idem commented on May 21, 2024

The meaning of render-tag-if is unclear since it could easily just be interpreted to be the same as if. That is, render-tag-if doesn't make it clear that only the body will render if the condition evaluates to false. body-only-if makes it clear that only the body content will be rendered (not the surrounding tag) if the condition evaluates to true.

Since body-only-if will rarely be used, I'm inclined to keep its usage as-is. What do you think?

from marko.

Orrico avatar Orrico commented on May 21, 2024

I think you had a good point. The meaning of body-only-if is more clear than render-tag-if, because, like you said, the condition is relative to the content in the tag, not to the tag itself.

from marko.

philidem avatar philidem commented on May 21, 2024

I didn't know about body-only-if until I saw this issue, but after learning about it I would recommend keeping body-only-if. For me, the intention is to only render the body (and less about only rendering the tag). Kind of confusing but I think it works :)

from marko.

patrick-steele-idem avatar patrick-steele-idem commented on May 21, 2024

@pedramphp, I agree with you that body-only-if feels a little backwards, but I am not seeing a better name. Thank you for the suggestion, but let's stick with body-only-if unless you have another idea on how this functionality could be provided in a less confusing way.

from marko.

redben avatar redben commented on May 21, 2024

Not really important but "body-only-if" confused me at first since it could be read as "render body, only if condition", instead of "render body only, if condition". May be changing to "only-body-if" could make it clearer...?

from marko.

yomed avatar yomed commented on May 21, 2024

Good suggestion, only-body-if seems much clearer to me. I was also confused when I first used this feature.

from marko.

CestDiego avatar CestDiego commented on May 21, 2024

I would add to this that maybe only-body-when or only-body-if make sense :)

from marko.

yomed avatar yomed commented on May 21, 2024

Maybe the current wording comes off a bit strange because it intends to group the words "body only," but "only if" is already a phrase (as in "if and only if").

from marko.

Related Issues (20)

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.