Mercurial Hosting > editor
changeset 53:d5681da8ece8 default tip
add website
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 24 May 2025 21:52:13 -0600 (5 hours ago) |
parents | 3f4c3722b78b |
children | |
files | .hgignore build.sh dev.sh src/luan_editor/Java.luan src/luan_editor/editor.luan src/luan_editor/window.luan website/serve.sh website/src/index.html website/src/init.luan website/src/site.css |
diffstat | 10 files changed, 87 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Sat May 24 16:25:55 2025 -0600 +++ b/.hgignore Sat May 24 21:52:13 2025 -0600 @@ -5,3 +5,5 @@ Makefile build/ *.class +*.tar +push.sh
--- a/build.sh Sat May 24 16:25:55 2025 -0600 +++ b/build.sh Sat May 24 21:52:13 2025 -0600 @@ -23,6 +23,10 @@ cp scripts/uninstall.sh build/luan_editor hg identify >build/luan_editor/hg_rev.txt -build/luan_editor/install.sh || sudo build/luan_editor/install.sh +cd build + +tar -cf ../website/src/download/luan_editor.tar luan_editor + +luan_editor/install.sh || sudo luan_editor/install.sh echo done
--- a/dev.sh Sat May 24 16:25:55 2025 -0600 +++ b/dev.sh Sat May 24 21:52:13 2025 -0600 @@ -10,4 +10,4 @@ mkdir -p ~/.luan_editor -java -Xdock:name="Luan Editor" -classpath $CLASSPATH luan.Luan classpath:luan_editor/editor.luan "$@" 2>&1 | grep --line-buffered -v 'NSRemoteView\|NSSavePanel' | tee err +java -Dport=56588 -Xdock:name="Luan Editor" -classpath $CLASSPATH luan.Luan classpath:luan_editor/editor.luan "$@" 2>&1 | grep --line-buffered -v 'NSRemoteView\|NSSavePanel' | tee err
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/luan_editor/Java.luan Sat May 24 21:52:13 2025 -0600 @@ -0,0 +1,13 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error +require "java" +local System = require "java:java.lang.System" + + +local Java = {} + +Java.home_dir = System.getProperty("user.home") + +Java.port = System.getProperty("port") + +return Java
--- a/src/luan_editor/editor.luan Sat May 24 16:25:55 2025 -0600 +++ b/src/luan_editor/editor.luan Sat May 24 21:52:13 2025 -0600 @@ -3,6 +3,7 @@ local ipairs = Luan.ipairs or error() local String = require "luan:String.luan" local contains = String.contains or error() +local to_number = String.to_number or error() local Io = require "luan:Io.luan" local new_file = Io.schemes.file or error() local Rpc = require "luan:Rpc.luan" @@ -10,11 +11,17 @@ local swing_run = Swing.run or error() local to_front = Swing.to_front or error() local new_window = require "classpath:luan_editor/window.luan" +local Java = require "classpath:luan_editor/Java.luan" local Logging = require "luan:logging/Logging.luan" local logger = Logging.logger "editor/editor" -local port = 56587 +local port = Java.port +if port == nil then + port = 56587 +else + port = to_number(port) or error("bad port: "..port) +end Rpc.cipher_suites = nil local server_socket
--- a/src/luan_editor/window.luan Sat May 24 16:25:55 2025 -0600 +++ b/src/luan_editor/window.luan Sat May 24 21:52:13 2025 -0600 @@ -32,6 +32,7 @@ local choose_file = File_chooser.awt_choose_file or error() local Option_pane = require "luan:swing/Option_pane.luan" local show_message_dialog = Option_pane.show_message_dialog or error() +local Java = require "classpath:luan_editor/Java.luan" local Logging = require "luan:logging/Logging.luan" local logger = Logging.logger "editor/window" @@ -47,7 +48,7 @@ end end -local config_file = Io.uri("file:"..Swing.home_dir.."/.luan_editor/config.json") +local config_file = Io.uri("file:"..Java.home_dir.."/.luan_editor/config.json") local config = {} if config_file.exists() then try
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/website/serve.sh Sat May 24 21:52:13 2025 -0600 @@ -0,0 +1,1 @@ +luan luan:http/serve.luan src 2>&1 | tee err
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/website/src/index.html Sat May 24 21:52:13 2025 -0600 @@ -0,0 +1,27 @@ +<!doctype html> +<html lang="en"> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <style> + @import "/site.css"; + + h1 { + margin-bottom: 8px; + } + h4 { + margin-top: 0; + } + </style> + <title>Luan Editor</title> + </head> + <body> + <h1>Luan Editor</h1> + <h4>by <a href="https://linkmy.style/fschmidt">fschmidt</a></h4> + + <p>Is another text editor needed? <a href="https://www.sublimetext.com/">Sublime Text</a> isn't bad. And to be honest, the main reason that I wrote Luan Editor was to learn Java Swing. But now that it is finished, I rather like it.</p> + + <p>Luan Editor requires <a href="https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html">Java (JDK) 8</a>, so you must install this first. It also requires <a href="https://www.reactionary.software/learn_bash.html#access">Bash</a>. Once these are working, you can download <a href="/download/">the tar file</a> and install it. Then you can run <code>luan_editor</code> from the command line.</p> + + <p>Luan Editor is <a href="https://hg.reactionary.software/repo/editor/">open source</a> and is written in <a href="https://www.luan.software/">Luan</a>.</p> + </body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/website/src/init.luan Sat May 24 21:52:13 2025 -0600 @@ -0,0 +1,5 @@ +local Hosted = require "luan:host/Hosted.luan" + +Hosted.set_https and Hosted.set_https(true) + +return true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/website/src/site.css Sat May 24 21:52:13 2025 -0600 @@ -0,0 +1,23 @@ +* { + box-sizing: border-box; +} + +body { + font-family: Sans-Serif; + margin-left: 3%; + margin-right: 3%; +} + +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} + +code { + background-color: #DDD; + white-space: pre-wrap; + word-wrap: break-word; + padding: 2px; +}