Giter Site home page Giter Site logo

tkluck / haml.jl Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 3.0 396 KB

HTML Abstract Markup Language for Julia. Inspired by Ruby's HAML.

Home Page: https://tkluck.github.io/HAML.jl/stable/

License: Other

Julia 98.64% HTML 0.05% JavaScript 0.02% Haml 1.29%
haml julia templating html

haml.jl's People

Contributors

tkluck avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

haml.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Support value-less attributes

As reported by @mlhetland in #6. They suggest attr=nothing as a possible way of expressing this, but I'm not sure that's very intuitive as other empty values (e.g. []) mean that the attribute should not be rendered at all. Suggestions welcome.

Be more conservative about attribute escaping

Attribute escaping breaks e.g. charset declarations (at least in firefox), leading to [workarounds like this(https://github.com/tkluck/StatProfilerHTML.jl/blob/109ad6f/haml/index.hamljl#L4). This issue is also reported by @mlhetland in #6 . We could fix this by e.g. only escaping "; maybe there's authoritative behaviour documented somewhere?

Permit syntactic oddities?

I may be missing some mechanism in the current library, but while trying to recreate some existing HTML5, I ran into the following roadblocks (for non-XML HTML5 syntax oddities):

  • Equals-signs in attribute values are auto-escaped, which means I can't generate, e.g., content="width=device-width, initial-scale=1".
  • Attributes must have values, which means I can't generate, e.g., <script defer …>.
  • Tags are always closed (either empty or with a closing tag), which means I can't generate, e.g., <meta charset="utf-8">.

Now, it may be that the more XML-friendly 'width&#61;device-width …', defer="" and <meta …/> are just fine HTML5-wise – so permitting stuff light this might just add unnecessary complication? ¯_(ツ)_/¯

(BTW, for the value-less attributes, I tested using defer=nothing – a solution I've used myself in similar situations, but that seems to have broken the rendering completely, including for the following attributes.)

Allow non-closing tags like `meta`

HTML5 allows certain tags as only declarations without /> nor a matching closing tag. One option is to have a whitelist of these tags, but maybe we can also have a syntax for it.

Support more blocks

We currently do not support the following blocks:

  • elseif
  • function
  • begin
  • let

These would be interesting additions.

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.