Code Monkey home page Code Monkey logo

chtml's Introduction

Catalan HyperText Markup Language

An attempt to make HTML easier to write in simple text editors using brackets. The name comes from the Catalan numbers, as the design is based around brackets.

Basic idea

Instead of

<div>
    <p class="silly">Hello, World!</p>
</div>

users should only have to type something like

(div
  (p class: silly; Hello, World!)
)

Or, for the power user, something like (div [p class:silly; Hello, World!]) (i.e. using interchangeable (.)s and [.]s).

Implementation

The program will be a Python script that will output .html files, just like Markdown. The inverse should be possible too: any .html should be easily translated to .chtml (or perhaps .cht for short) for working.

Syntactic elements

The general form will be something like <a href="x">link</a> โ†’ (a href: x; link). A possible alternate canonical form would be something like a(href: x; link), so the scope of the element is very clear. This would yield

div(
   p(class: silly; Hello, World!)
)
  • A problem with this is if there are elements that are not part of the normal namespace, the parser will freak out.
  • A problem might also be that special characters cause the compiler to end the group (as they're called in regexes) prematurely.
  • Another possible problem is that the class might be a little unclear. For instance, <p class="silly, fancy">text</p> โ†’ (p class: silly, fancy; text) renders it a little less clear, as there is no delimiter between the list of classes and the actual contents. Perhaps this is mitigated by enclosing the text in quotation marks, e.g. (p class: silly, fancy; 'text'), or more experimental solutions such as (p class: silly, fancy; | text) which is quite pleasing to the eye, though might yield other problems with keyboards other than US qwerty.

Possible (plausible?) features

  • flag to dot .cht files when compiling .html files

chtml's People

Watchers

 avatar  avatar

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.