Giter Site home page Giter Site logo

hamplify's People

Contributors

kangaroux avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hamplify's Issues

Add support for '= var.name'

When using Jinja2 or Django templates, the = var syntax will compile to {{var}}.

Example:

= user.username
%p= user.email

Gets compiled to:

{{user.username}}
<p>{{user.email}}</p>

When using this on the same line as a tag, there must not be any whitespace between the end of the tag and the =. If there is, it will be interpreted as plain text.

Allow #id at beginning of a tag definition

#id can only come at the end of tag definitions currently. Sometimes tags have a long lists of classes and it would be better to have the ID at the start so it doesn't get lost.

The ID should NOT be able to appear in the middle of a list of classes. The ID should either either be at the beginning or the end.

Conditional IE comments are not parsed

Regular comments are not parsed which is correct, however since conditional IE comments aren't really comments, they should be parsed.

In general, if it's going to be rendered for use on the page, then the contents should be parsed.

Add compile warnings

The compiler currently has error handling where it will raise a ParseError if it encounters some bad syntax and doesn't know how to proceed. However, there are times where it would be more appropriate to notify the user about something but still proceed with compilation.

For example, if the user writes a conditional comment but puts some text after the comment:

-#[if IE] like this

We can parse that line just fine, but the text is ignored so it serves no purpose. It would be nice to notify the user that it should be removed.

The type of quotation used for attributes is not respected

If the template has single quotes for the attribute, then when converted it should still use single quotes. This causes issues when there are quotes inside attributes for template tags.

Template:

%img(src='{% static "some_url" %}')

Converted:

<img src="{% static "some_url" %}" />

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.