From 0eef58cbb1fe20da04610b80287a9cafff31b4e7 Mon Sep 17 00:00:00 2001 From: "Daniel A. Nagy" Date: Sat, 13 Sep 2025 09:16:43 +0200 Subject: [PATCH 1/5] Introduction to Compy The intended audience are beta testers. --- doc/intro.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 doc/intro.md diff --git a/doc/intro.md b/doc/intro.md new file mode 100644 index 00000000..140987fb --- /dev/null +++ b/doc/intro.md @@ -0,0 +1,53 @@ +# Introduction to Compy + +Compy is a 7'' portable educational computer with an interactive development +environment for the [love2d](https://love2d.org) framework. It runs on top of +Android operating system and uses the Lua programming language for the command +line, scripting, configuration and programming. The primary interface is the +command console, with the standard input displayed at the bottom of the screen, +with real-time syntax highlingting (when appropriate). The standard output is +displayed on a terminal occupying the rest of the screen, which also doubles as +a graphical canvas. Thus, commands with both text-based or graphical output can +be entered. Below are some invariant principles of operations: + +* Pointing devices (such as mice, touch pad or touch screen) might be used, but + are not necessary for the successful operation of Compy. +* Apart from syntax highlighting, anything entered in the console + input will only take effect upon pressing the **Enter** key. +* If the input is syntactically invalid at the time of pressing **Enter**, the + user can continue editing, correcting the mistake. +* Users cannot render compy unusable from the command line. Compy can always + be restored to its initial state by inserting a clean _SD card_ or formatting + the currently inserted one. Example projects are written onto the SD card by + entering `example_projects()` on the command line. + +## Persistence + +All data persisted by the user is saved on the included _SD card_. It is +organized into named _projects_, with no file system hieararchy. Technically, +each project is a directory under `Documents/compy/projects/` on the SD card. +Inside these directories, there is no further directory structure. + +Projects can be selected or, in the absence of one, created by entering +`project("...")` in the console, with the project's name between the double +quotes. Running the project means executing a file called "`main.lua`" in its +directory. It can be done by entering `run()` in the console for the currently +selected project or `run("...")` for a different project, with the name of the +project between the double quotes. + +Text files, including Lua sources can be edited using the built-in text editor +that can be started by entering `edit("...")` in the console, with the name of +the file between the quotes. In its absence, `main.lua` will be edited. + +No changes to the edited file will occur unless the user presses **Enter** _and_ +the text in the edit area at the bottom of the screen is syntactically correct. +Pressing **Enter** takes immediate effect on the SD card, there is no need to +"save" the edited file separately. + +If there is no highlighted section in the edited file, the text inputed in the +console will be appended to the end of the file. If there is a bright white +highlight, the entered text is inserted before it. If there is a bright yellow +highlight, the entered text replaces it. + +For more information, please see the documentation of the editor and the +console. From 529ccd32c134e6cac0d10eb46d785e7894e7d8d9 Mon Sep 17 00:00:00 2001 From: "Daniel A. Nagy" Date: Sat, 13 Sep 2025 09:18:05 +0200 Subject: [PATCH 2/5] link to editor documentation --- doc/intro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/intro.md b/doc/intro.md index 140987fb..26c404be 100644 --- a/doc/intro.md +++ b/doc/intro.md @@ -49,5 +49,5 @@ console will be appended to the end of the file. If there is a bright white highlight, the entered text is inserted before it. If there is a bright yellow highlight, the entered text replaces it. -For more information, please see the documentation of the editor and the -console. +For more information, please see the documentation of the [editor](EDITOR.md) +and the console. From 06d433156158d220a442ed4adfa4f9ad831bc4ef Mon Sep 17 00:00:00 2001 From: "Daniel A. Nagy" Date: Sat, 13 Sep 2025 09:19:42 +0200 Subject: [PATCH 3/5] Link to command line documentation --- doc/intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/intro.md b/doc/intro.md index 26c404be..5dc5d240 100644 --- a/doc/intro.md +++ b/doc/intro.md @@ -50,4 +50,4 @@ highlight, the entered text is inserted before it. If there is a bright yellow highlight, the entered text replaces it. For more information, please see the documentation of the [editor](EDITOR.md) -and the console. +and the [console](../README.md). From e683c9ac9bade89aa8e77f62831c33ba220e8adb Mon Sep 17 00:00:00 2001 From: "Daniel A. Nagy" Date: Mon, 17 Nov 2025 12:38:53 +0100 Subject: [PATCH 4/5] Remove runfile() Made redundant by properly working `require` --- src/controller/consoleController.lua | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/controller/consoleController.lua b/src/controller/consoleController.lua index 8cb2f51c..a560c8c1 100644 --- a/src/controller/consoleController.lua +++ b/src/controller/consoleController.lua @@ -310,18 +310,6 @@ function ConsoleController.prepare_env(cc) end) end - --- @param name string - --- @return any - prepared.runfile = function(name) - local code = check_open_pr(cc._readfile, cc, name) - local chunk, err = load(code, '', 't') - if chunk then - chunk() - else - print(err) - end - end - --- @param name string prepared.edit = function(name) return check_open_pr(cc.edit, cc, name) From e25e94ee441b399d073fb86eaad3a482d2114eb0 Mon Sep 17 00:00:00 2001 From: "Daniel A. Nagy" Date: Mon, 17 Nov 2025 12:46:32 +0100 Subject: [PATCH 5/5] Update README.md to reflect removal of `runfile()` --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 08e56e21..e9573df6 100644 --- a/README.md +++ b/README.md @@ -140,10 +140,6 @@ contents. Write to _file_ the text supplied as the _content_ parameter. This can be either a string, or an array of strings. -- `runfile(file)` - - Run _file_ if it's a lua script. - ## Editor If a project is open, the files inside can be edited or new ones