From 8997f27f4a9ef79cb403684310836209453fccaf Mon Sep 17 00:00:00 2001
From: Erlend <49862976+Erb3@users.noreply.github.com>
Date: Sun, 29 May 2022 13:08:06 +0200
Subject: [PATCH 01/13] tset1
---
docs/_sidebar.md | 2 ++
docs/home.md | 21 +++++++++++++++++++++
docs/index.html | 23 +++++++++++++++++++++++
3 files changed, 46 insertions(+)
create mode 100644 docs/_sidebar.md
create mode 100644 docs/home.md
create mode 100644 docs/index.html
diff --git a/docs/_sidebar.md b/docs/_sidebar.md
new file mode 100644
index 0000000..ab30970
--- /dev/null
+++ b/docs/_sidebar.md
@@ -0,0 +1,2 @@
+- [Home](/)
+- [Getting Started](/gettingStarted)
\ No newline at end of file
diff --git a/docs/home.md b/docs/home.md
new file mode 100644
index 0000000..b9f8776
--- /dev/null
+++ b/docs/home.md
@@ -0,0 +1,21 @@
+# Welcome to The Basalt Wiki!
+*Note: The Basalt Wiki is a work in progress, now also just migrated away from github wiki. Please treat Wiki errors the same as bugs and report them accordingly.*
+
+Here you can find information about how to use Basalt as well as examples of functional Basalt code. The aim of Basalt is to improve user interaction through visual display.
+
+On the right side of this page you can find a Wiki Navigation, where you can find a more detailed list of Basalt's features
+
+## About Basalt
+
+Basalt is intended to be an easy-to-understand UI Framework designed for CC:Tweaked (AKA Computer Craft: Tweaked) - a popular minecraft mod. For more information about CC:Tweaked, checkout the project's home page.
+
+## Quick Demo
+
+
+## Questions & Bugs
+
+Obviously NyoriE has implemented some easter eggs, _some people_ call them "bugs". If you happen to discover one of these just make a new issue.
+
+Additionally, if you have questions about Basalt or how to make use of it, feel free to create a new discussion on Basalt's Discussion Board.
+
+You may also join the Discord: https://discord.gg/yNNnmBVBpE
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 0000000..d522e4e
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+ Basalt Docs
+
+
+
+
+
+
+
\ No newline at end of file
--
2.49.1
From 455127114ee9e6567aa2c1b5cda1b1796f4889c4 Mon Sep 17 00:00:00 2001
From: Erlend <49862976+Erb3@users.noreply.github.com>
Date: Sun, 29 May 2022 13:12:52 +0200
Subject: [PATCH 02/13] Name it correctly
---
docs/{home.md => README.md} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename docs/{home.md => README.md} (100%)
diff --git a/docs/home.md b/docs/README.md
similarity index 100%
rename from docs/home.md
rename to docs/README.md
--
2.49.1
From d1e0220d54cd48b0d17faf21715d7da02062bf3d Mon Sep 17 00:00:00 2001
From: Erlend <49862976+Erb3@users.noreply.github.com>
Date: Sun, 29 May 2022 13:28:06 +0200
Subject: [PATCH 03/13] Home Category
---
docs/_sidebar.md | 6 ++--
docs/home/gettingStarted.md | 69 +++++++++++++++++++++++++++++++++++
docs/home/installer.md | 72 +++++++++++++++++++++++++++++++++++++
3 files changed, 145 insertions(+), 2 deletions(-)
create mode 100644 docs/home/gettingStarted.md
create mode 100644 docs/home/installer.md
diff --git a/docs/_sidebar.md b/docs/_sidebar.md
index ab30970..c1ec61c 100644
--- a/docs/_sidebar.md
+++ b/docs/_sidebar.md
@@ -1,2 +1,4 @@
-- [Home](/)
-- [Getting Started](/gettingStarted)
\ No newline at end of file
+- Home
+ - [Home](/)
+ - [Getting Started](/home/gettingStarted)
+ - [Installer](/home/installer)
\ No newline at end of file
diff --git a/docs/home/gettingStarted.md b/docs/home/gettingStarted.md
new file mode 100644
index 0000000..9e9b220
--- /dev/null
+++ b/docs/home/gettingStarted.md
@@ -0,0 +1,69 @@
+Basalt aims to be a relatively small, easy to use framework.
+
+Accordingly, we have provided an installation script.
+
+
+Just use the following command in any CC:Tweaked shell:
+
+`wget https://github.com/Pyroxenium/Basalt/raw/master/basalt.lua basalt.lua`
+
+This will download `basalt.lua` to your local directory.
+
+To load the framework, make use of the following snippet:
+````lua
+--> For those who are unfamiliar with lua, dofile executes the code in the referenced file
+local basalt = dofile("basalt.lua")
+````
+
+
+Here is a fully functioning example of Basalt code:
+
+````lua
+local basalt = dofile("basalt.lua") --> Load the Basalt framework
+
+--> Create the first frame. Please note that Basalt needs at least one active "non-parent" frame to properly supply events
+--> When Basalt#createFrame makes use of unique identifiers (commonly referred to as UIDs), meaning that the supplied value must be UNIQUE
+--> If the supplied UID is ambiguous, Basalt#createFrame returns a nil value
+local mainFrame = basalt.createFrame("mainFrame")
+
+--> Show the frame to the user
+mainFrame:show()
+
+local button = mainFrame:addButton("clickableButton") --> Add a button to the mainFrame (With a unique identifier)
+
+--> Set the position of the button, Button#setPosition follows an x, y pattern.
+--> The x value is how far right the object should be from its anchor (negative values from an anchor will travel left)
+--> The y value is how far down the object should be from its anchor (negative values from an anchor will travel up)
+button:setPosition(4, 4)
+
+button:setText("Click me!") --> Set the text of our button
+
+local function buttonClick() --> This function serves as our click logic
+ basalt.debug("I got clicked!")
+end
+
+--> Remember! You cannot supply buttonClick(), that will only supply the result of the function
+--> Make sure the button knows which function to call when it's clicked
+button:onClick(buttonClick)
+
+button:show() --> Make the button visible, so the user can click it
+
+basalt.autoUpdate() --> Basalt#autoUpdate starts the event listener to detect user input
+````
+If you're like us and strive for succinct and beautiful code, here is a cleaner implementation of the code above:
+````lua
+local basalt = dofile("basalt.lua")
+
+local mainFrame = basalt.createFrame("mainFrame"):show()
+local button = mainFrame --> Basalt returns an instance of the object on most methods, to make use of "call-chaining"
+ :addButton("clickableButton") --> This is an example of call chaining
+ :setPosition(4,4)
+ :setText("Click me!")
+ :onClick(
+ function()
+ basalt.debug("I got clicked!")
+ end)
+ :show()
+
+basalt.autoUpdate()
+````
diff --git a/docs/home/installer.md b/docs/home/installer.md
new file mode 100644
index 0000000..41e4959
--- /dev/null
+++ b/docs/home/installer.md
@@ -0,0 +1,72 @@
+This is just a script which helps you to install basalt.lua, if it's not already on the computer. Means, you create your program (which requires basalt) and add this on the top of your program. Now, everytime you execute your program it checks if basalt.lua exists or not.
+
+## Visual Installer
+This is a visual version, it asks the user if he wants to install basalt.lua (if not found)
+
+````lua
+--Basalt configurated installer
+local filePath = "basalt.lua" --here you can change the file path default: basalt.lua
+if not(fs.exists(filePath))then
+ local w,h = term.getSize()
+ term.clear()
+ local _installerWindow = window.create(term.current(),w/2-8,h/2-3,18,6)
+ _installerWindow.setBackgroundColor(colors.gray)
+ _installerWindow.setTextColor(colors.black)
+ _installerWindow.write(" Basalt Installer ")
+ _installerWindow.setBackgroundColor(colors.lightGray)
+ for line=2,6,1 do
+ _installerWindow.setCursorPos(1,line)
+ if(line==3)then
+ _installerWindow.write(" No Basalt found! ")
+ elseif(line==4)then
+ _installerWindow.write(" Install it? ")
+ elseif(line==6)then
+ _installerWindow.setTextColor(colors.black)
+ _installerWindow.setBackgroundColor(colors.gray)
+ _installerWindow.write("Install")
+ _installerWindow.setBackgroundColor(colors.lightGray)
+ _installerWindow.write(string.rep(" ",5))
+ _installerWindow.setBackgroundColor(colors.red)
+ _installerWindow.write("Cancel")
+ else
+ _installerWindow.write(string.rep(" ",18))
+ end
+ end
+ _installerWindow.setVisible(true)
+ _installerWindow.redraw()
+ while(not(fs.exists(filePath))) do
+ local event, p1,p2,p3,p4 = os.pullEvent()
+ if(event=="mouse_click")then
+ if(p3==math.floor(h/2+2))and(p2>=w/2-8)and(p2<=w/2-2)then
+ shell.run("pastebin run ESs1mg7P") -- this is an alternative to the wget command
+ _installerWindow.setVisible(false)
+ term.clear()
+ break
+ end
+ if(p3==h/2+2)and(p2<=w/2+9)and(p2>=w/2+4)then
+ _installerWindow.clear()
+ _installerWindow.setVisible(false)
+ term.setCursorPos(1,1)
+ term.clear()
+ return
+ end
+ end
+ end
+ term.setCursorPos(1,1)
+ term.clear()
+end
+
+local basalt = dofile(filePath) -- here you can change the variablename in any variablename you want default: basalt
+````
+
+## Basic Installer
+Here is a very basic one which just installs basalt.lua if don't exist:
+````lua
+--Basalt configurated installer
+local filePath = "basalt.lua" --here you can change the file path default: basalt.lua
+if not(fs.exists(filePath))then
+ shell.run("wget https://github.com/Pyroxenium/Basalt/raw/master/basalt.lua basalt.lua")
+end
+local basalt = dofile(filePath) -- here you can change the variablename in any variablename you want default: basalt
+
+````
\ No newline at end of file
--
2.49.1
From 22f649be39de2aa72dbbe46556cf21b3e035280f Mon Sep 17 00:00:00 2001
From: Erlend <49862976+Erb3@users.noreply.github.com>
Date: Sun, 29 May 2022 13:31:22 +0200
Subject: [PATCH 04/13] Added headings, and disabled jekyll which makes sidebar
work...
---
docs/.nojekyll | 0
docs/home/gettingStarted.md | 2 ++
docs/home/installer.md | 2 ++
3 files changed, 4 insertions(+)
create mode 100644 docs/.nojekyll
diff --git a/docs/.nojekyll b/docs/.nojekyll
new file mode 100644
index 0000000..e69de29
diff --git a/docs/home/gettingStarted.md b/docs/home/gettingStarted.md
index 9e9b220..b470a31 100644
--- a/docs/home/gettingStarted.md
+++ b/docs/home/gettingStarted.md
@@ -1,3 +1,5 @@
+# Getting Started!
+
Basalt aims to be a relatively small, easy to use framework.
Accordingly, we have provided an installation script.
diff --git a/docs/home/installer.md b/docs/home/installer.md
index 41e4959..cc83958 100644
--- a/docs/home/installer.md
+++ b/docs/home/installer.md
@@ -1,3 +1,5 @@
+# Installer
+
This is just a script which helps you to install basalt.lua, if it's not already on the computer. Means, you create your program (which requires basalt) and add this on the top of your program. Now, everytime you execute your program it checks if basalt.lua exists or not.
## Visual Installer
--
2.49.1
From 39020d99d3cb3727b4640f902c2ef3ea099f9255 Mon Sep 17 00:00:00 2001
From: Erlend <49862976+Erb3@users.noreply.github.com>
Date: Sun, 29 May 2022 13:40:07 +0200
Subject: [PATCH 05/13] dark theme
---
docs/index.html | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/index.html b/docs/index.html
index d522e4e..c693efe 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -5,6 +5,7 @@
+
Basalt Docs
@@ -19,5 +20,6 @@
};
+