Mercurial Hosting > lang
changeset 10:b0b325565d30
add public tools
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 21 Jul 2025 19:13:02 -0600 |
parents | 46097e607701 |
children | 003a90ce72d7 |
files | src/tools/hello_html.html src/tools/hello_luan.html.luan src/tools/markdown.html |
diffstat | 3 files changed, 75 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/tools/hello_html.html Mon Jul 21 19:13:02 2025 -0600 @@ -0,0 +1,17 @@ +<!doctype html> +<html lang="en"> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Lang</title> + <style> + @import "/site.css"; + </style> + <script src="https://cdn.jsdelivr.net/npm/markdown-it@14.1.0/dist/markdown-it.min.js"></script> + <script src="/site.js"></script> + </head> + <body> + <div content> + <p>Hello HTML</p> + </div> + </body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/tools/hello_luan.html.luan Mon Jul 21 19:13:02 2025 -0600 @@ -0,0 +1,26 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error +local Io = require "luan:Io.luan" +local Http = require "luan:http/Http.luan" +local Shared = require "site:/lib/Shared.luan" +local head = Shared.head or error() +local header = Shared.header or error() + + +return function() + Io.stdout = Http.response.text_writer() +%> +<!doctype html> +<html lang="en"> + <head> +<% head() %> + </head> + <body> +<% header() %> + <div content> + <p>Hello Luan</p> + </div> + </body> +</html> +<% +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/tools/markdown.html Mon Jul 21 19:13:02 2025 -0600 @@ -0,0 +1,32 @@ +<!doctype html> +<html lang="en"> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>Lang</title> + <style> + @import "/site.css"; + </style> + <script src="https://cdn.jsdelivr.net/npm/markdown-it@14.1.0/dist/markdown-it.min.js"></script> + <script src="/site.js"></script> + <script> + function markdown() { + let textarea = document.querySelector('textarea'); + let result = document.querySelector('div[result]'); + result.textContent = textarea.value; + result.setAttribute('markdown',''); + handleMarkdown(); + } + </script> + </head> + <body> + <div content> + <form action="javascript:markdown()"> + <h1>Markdown</h1> + <p><textarea rows=20 cols=80></textarea></p> + <p><input type=submit></p> + </form> + <div result> + </div> + </div> + </body> +</html>