Code Monkey home page Code Monkey logo

cohtml's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

cohtml's Issues

HTML Escaped inner texts

div | cohtml <b>is</b> interesting.

should compile to

<div>cohtml<b>is</b>interesting.</div>

but

div |! cohtml <b>is</b> interesting.

should compile to

<div>cohtml&lt;b&gt;is&lt;/b&gt;interesting.</div>

Add support for Whitespace/Newline preserving Block Strings

Add a new kind of block string that preserves the newlines and whitespace.

i.e.

div ```My name is dan.
  And I enter    whitespace for no reasons. ```

should transpile to

<div>My name is dan.<br>&nbsp;&nbsp;And I enter&nbsp;&nbsp;&nbsp;&nbsp;whitespace for no reasons.&nbsp;</div>

Add extensibility features to cohtml

One of the core ideas behind cohtml was to make it extensible in such a manner that it's code can be reused in other projects that seek to extend cohtml. (For example, my project 'copolymer' which adds in support for native conditional like if for etc in cohtml and transpiles to a polymer web-component)

We need to modify the api in such a way that it can be easily extended and reused.

The code needs to be separated into more chunks.

Root level only one tag being accepted

The following compiles successfully

!doctype html
  html lang="en"
    head
      title | Cohtml Demo
    body
      h1 | Cohtml Demo

However the following doesn't

!doctype html
html lang="en"
  head
    title | Cohtml Demo
  body
    h1 | Cohtml Demo

Shorthand for inline styles

Inline styles can have shorthands so that they can be easily identified and typed. Round braces can be a good way to inline styles.

div$myId someattr="someValue" (color:red) | some text

can transpile to

<div id="myId" someattr="someValue" style="color:red">some text</div>

Make the cohtml-grammar definition better

  1. Its not completely standard compliant.
  2. There might be some definitions missing.
  3. Indent of a child must be one {indent} greater than that of it's parent. I was unable to express this in Context Free Grammer. Maybe the grammar can't be context free. Need some insight regarding this.

[https://github.com/iShafayet/cohtml/blob/master/docs/dev-notes/cohtml-grammar.md]

Pipe indicated text nodes

Just like

div
  `cohtml`
  b | is
  `interesting.`

this

div
  | cohtml
  b | is
  | interesting.

should compile to

<div>cohtml<b>is</b>interesting.</div>

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.