luatml's People
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 tocontact-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.
Add optional static-file verifier
Think #3, but for static files like stylesheets/images/...
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 ofrequire
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.