ladici-fengari: Move the main lua script from the html to ladici-fengari.lua

This commit is contained in:
Nedko Arnaudov 2023-12-01 18:47:02 +02:00
parent 4da23951ca
commit 583fae6e73
2 changed files with 24 additions and 21 deletions

View File

@ -3,26 +3,6 @@
</head>
<body>
<script src="fengari-web.js" type="text/javascript"></script>
<!-- <script src="/my-script.lua" type="application/lua" async></script> -->
<script type="application/lua">
print("LADICI lua in web browser!")
--print(package.path)
package.path = './?.lua'
--print(package.path)
local js = require "js"
--print("js: " .. repr(js))
local window = js.global
--window.title = "LADICI lua in web browser!"
--print("window: " .. repr(window))
local document = window.document
--print("document: " .. repr(document))
local text = document:createTextNode("LADICI lua in web browser!")
document.body:appendChild(text)
document.body:appendChild(document:createElement("br"))
local buildno = require "buildno01"
local text = document:createTextNode(buildno.description)
document.body:appendChild(text)
print("LADICI done")
</script>
<script src="/ladici-fengari.lua" type="application/lua" async></script>
</body>
</html>

23
ladici-fengari.lua Normal file
View File

@ -0,0 +1,23 @@
-- -*- Mode: Lua; indent-tabs-mode: nil; lua-indent-level: 2 -*-
-- LADI Continuous Integration (ladici)
-- SPDX-FileCopyrightText: Copyright © 2023 Nedko Arnaudov */
-- SPDX-License-Identifier: GPL-2.0-or-later
print("LADICI lua in web browser!")
--print(package.path)
package.path = './?.lua'
--print(package.path)
local js = require "js"
--print("js: " .. repr(js))
local window = js.global
--window.title = "LADICI lua in web browser!"
--print("window: " .. repr(window))
local document = window.document
--print("document: " .. repr(document))
local text = document:createTextNode("LADICI lua in web browser!")
document.body:appendChild(text)
document.body:appendChild(document:createElement("br"))
local buildno = require "buildno01"
local text = document:createTextNode(buildno.description)
document.body:appendChild(text)
print("LADICI done")