GithubHelp home page GithubHelp logo

luatml's People

Contributors

numpad avatar

Watchers

 avatar  avatar

luatml's Issues

Add optional `href` verifier

Hardcoding links/hrefs is fine, but there should be an optional feature to ensure (internal) links are not dead.

Consider the following scenario:

  • index.lua contains a hyperlink to /contact/ (โ†’ contact.lua).
  • some time later, the file contact.lua is renamed to contact-us.lua.
  • however, the hyperlink in index.lua was never updated and is dead now.

With some kind of validation in place, this should fail during build, and print an error.

a {
  "Contact Us",
  href=luatml_link('contact.lua'),
}

Fix `luatml_foreach`

This works:

luatml_foreach {"a", "b", "c"} {
  function (item) return p {item} end
}

This does not:

luatml_foreach {"a", "b", "c"} {
  p { function (item) return item end }
}

Add validator / "dry build"

When running with luatml serve ... I would (optionally) like to ensure the whole project builds without errors so that I can catch errors early on.

Aditionally, an extension to the luatml build command could make much sense, so that we actually build everything but discard the results. This could nicely integrate with other tools, so that a luatml build my-website/ --dry-run does nothing in the best case, and in case of errors returns a non-zero exit code without much more info (maybe the error message to stdout?)

Implement void tags

HTML-tags such as meta, img, input etc. do not use a corresponding closing tag. This is not handled in luatml.

Fix `require` for Lua >= 5.4

Lua 5.4 introduced a change to the return value of the function require(modname), now returning more than one parameter on the first load of a previously unloaded module.

This breaks the following code:

div {
  require "my/component"
}

This results in the imported module ("component") being built normally, as the first parameter is the same as before. The second parameter returned is a string representing the path to said module (when loaded for the first time), wrongly/unexpectedly writing it to the output as well.

The current hotfix is to monkey patch the global require function to restore behavior of Lua 5.3 and before. This sucks pretty bad.

Alternative solutions include:

  • Not supporting Lua 5.4
  • Exchanging require for a dedicated function
  • setfenv patching of require

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.