Giter Site home page Giter Site logo

fushra / meml-standard Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 1.0 181 KB

MEML is a simple LISP-like markup language that translates into HTML/CSS

Home Page: https://meml.fivnex.co

License: GNU Affero General Public License v3.0

Python 100.00%
html html5 html-css html-framework html-translation lisp lisp-dialect lisp-like css css3

meml-standard's People

Contributors

loralighte avatar lunarequest avatar trickypr avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

Forkers

trickypr

meml-standard's Issues

SSR Rendering

This is an issue tracker for language design around basic SSR, similar to handlebars or pug. Before SSR will be usable, a number of language design decisions need to be made.

Specifying MEML to be rendered

There a number of different methods that could be used to specify what MEML should be rendered.

Just use a file

Just pass a MEML file and dump an object into its scope. For example with the following MEML file.

(head
     (title "" page " | Fushra")
)
(body
    (h1 "Hello " username)
)

Which in JS could be used like:

import { page } from 'meml-ssr'

// Scan and parse on program start
const home = page('./src/index.meml')

app.get('/', (req, res) => {
    res.send(home({ page: 'Home', username: 'trickypr' }))
})

Would output:

<!DOCTYPE html>
<html>
<head>
    <title>Home | Fushra</title>
</head>
<body>
    <h1>Hello trickypr</h1>
</body>
</html>

Advantages:

  • Any existing MEML code can be ssr rendered without any changes
  • Simple idea
    Disadvantages:
  • There is no way to specify what arguments should be provided

Reuse components and exports [Preferred]

In your SSR application you can execute components at any time. For example, the following MEML:

(component Home (page, username) (
    (head
         (title "" page " | Fushra")
    )
    (body
        (h1 "Hello " username)
    )
))

(component Logout (page, username) (
    (head
         (title "" page " | Fushra")
    )
    (body
        (h1 "Goodbye " username)
    )
))

(export (Home, Logout))

Which in JS could be used like:

import { page } from 'meml-ssr'

// Scan and parse on program start
const { Home, Logout } = page('./src/index.meml')

app.get('/', (req, res) => {
    res.send(Home({ page: 'Home', username: 'trickypr' }))
   // or
   res.send(Home('Home', 'trickypr'}))
})

Would output:

<!DOCTYPE html>
<html>
<head>
    <title>Home | Fushra</title>
</head>
<body>
    <h1>Hello trickypr</h1>
</body>
</html>

Advantages:

  • Fairly easy to migrate everything
  • Obvious what arguments will be supplied
  • Allows for multiple pages per file
  • You can render smaller components easier

Logic blocks

The following blocks will need to be implemented

(if (a == b) 
    "equal"
elseif (a > b)
    "greater"
else
   "something else"
)
(for item in array
    item
)

Given

let obj = { name: 'trickypr', twitter: '@_trickypr' }

then

(using obj
     "Follow " name " on twitter at " twitter
)

Switching Codebase to V

I have used the V programming language for a little over a year now. I want MEML to be a binary, not an interpreted thing. I was looking into several languages, and so far it seems like V is the perfect option for us. I will be working on translating to V immediately.

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.