From 70b0dbf4e151f72ea8fc4d033199ae2dc1d402cd Mon Sep 17 00:00:00 2001 From: Pentium44 Date: Wed, 9 Jun 2021 20:26:24 -0700 Subject: [PATCH] Added website to sources, documentation. --- misc/api/basics.html | 141 +++++++++++++++++++++++++++++ misc/api/compression-encoding.html | 53 +++++++++++ misc/api/file-manipulation.html | 126 ++++++++++++++++++++++++++ misc/api/functions.html | 104 +++++++++++++++++++++ misc/api/index.html | 77 ++++++++++++++++ misc/api/networking.html | 107 ++++++++++++++++++++++ misc/index.html | 94 +++++++++++++++++++ misc/style.css | 73 +++++++++++++++ 8 files changed, 775 insertions(+) create mode 100644 misc/api/basics.html create mode 100644 misc/api/compression-encoding.html create mode 100644 misc/api/file-manipulation.html create mode 100644 misc/api/functions.html create mode 100644 misc/api/index.html create mode 100644 misc/api/networking.html create mode 100644 misc/index.html create mode 100644 misc/style.css diff --git a/misc/api/basics.html b/misc/api/basics.html new file mode 100644 index 0000000..51871e2 --- /dev/null +++ b/misc/api/basics.html @@ -0,0 +1,141 @@ + + + + SlideScript API: The Basics ~ The Lazy Language + + + + + + +
+
+ SlideScript +
+
+ +
+ +
+ +

Getting SlideScript

+

+ Starting off with SlideScript, you'll first need to obtain the source and build it. + We're going to assume you're using a *nix based system today, so the easiest way to + get the source is with a tool a developer should be familiar with: git.

+Installing system-wide: +


+# git clone https://notabug.org/Pentium44/slidescript 
+# cd slidescript/
+# make & make install
+# slidescript
+ss:prompt: 
+
+Running after build: +

+# git clone https://notabug.org/Pentium44/slidescript
+# cd slidescript/
+# make
+# ./slidescript
+ss:prompt:
+
+ From this step, you should easily have built SlideScript, and + would be sitting at the fancy incorporation of an interactive shell. + Want to use it at as a script? Just make a file "script.ss", and + add a shebang after system wide install:
+ #!/usr/bin/slidescript +
Of course, make sure your script is executable! +

+ +

Variables & strings

+

+ SlideScript will parse an equal character into a variable using the + contents on each side of such equal character. No quotes are needed + after an equal character and can be ended via new-line. You can print + variables and/or strings to stdout in SlideScript using the "print" function. + Examples (interactive and scripted): +


+ss:prompt: buffer=This will be the contents of variable "buffer"
+ss: var 'buffer' -> This is the contents of variable "buffer"
+ss:prompt: print "%buffer%"
+This is the contents of variable "buffer"
+ss:prompt: 
+
+OR
+
+#!/usr/bin/slidescript
+# This is a comment, script away
+buffer=This will be the contents of variable "buffer"
+print "%buffer%"
+# Unset function on variables similar to perl
+unset "buffer" # Dumps buffer from memory!
+
+
+ From here, we are going to be refering to all examples as scripts. Yes, + SlideScript does have interactive mode for being a convenient all-in-one + shell, but lets focus on the scripting side of things; shall we? +

+ +

Piping, math & backquoting

+

+ Piping is very similar to piping within a *nix shell. In SlideScript, + the piping character remains "vertical bar" or "|". The return value + of the function processed on the left side of the piping character will + be pushed into a variable known as "PIPE". Hmm, wonder why? :P + You can use piping in recursion in SlideScript.
+ Backquotes or "`" are used within SlideScript, mainly in variables, + for processing functions within the language, and saving the returned value + as a string. For example: whatsthetime=`time` would be saved as: + ss: var 'whatsthetime' -> Wed Jun 9 17:56:23 2021
+ Here are some examples: +


+#!/usr/bin/slidescript
+# First, lets show how a pipe works:
+print "hello" | print "%PIPE% world" # Returns: hello world
+
+# Now for stacked piping, lets use a variable with the current time, and
+# Play with it!
+
+whatsthetime=`time` # return: ss: var 'whatsthetime' -> Wed Jun  9 17:56:23 2021
+
+calc "56.5 * 6.25" | print "Solved: %PIPE%" | print "[%whatsthetime%] %PIPE%" 
+### Return value of the contraption: [Wed Jun  9 17:56:23 2021] Solved: 353.125000
+
+# This is more for, how math works in SlideScript #
+# Example of using piping to do mathimatical equations with parathesis!
+calc "33.3 / 2" | calc "%PIPE% * 26" | calc "%PIPE% + 2" # Return: 434.899994
+
+

+ +

IRC server

+

+ Still need help? Want to report a bug? Join us!

+ IP/Port: cddo.cc/1337
+ Main hang channel: #theroot
+ FreeBox channel: #freebox
+ FreonLinux channel: #freonlinux +

+ +
+ + + + diff --git a/misc/api/compression-encoding.html b/misc/api/compression-encoding.html new file mode 100644 index 0000000..99008f0 --- /dev/null +++ b/misc/api/compression-encoding.html @@ -0,0 +1,53 @@ + + + + SlideScript API: Compression & Encoding / Decoding ~ The Lazy Language + + + + + + +
+
+ SlideScript +
+
+ +
+ +
+

Under development...

+ +

IRC server

+

+ Still need help? Want to report a bug? Join us!

+ IP/Port: cddo.cc/1337
+ Main hang channel: #theroot
+ FreeBox channel: #freebox
+ FreonLinux channel: #freonlinux +

+ +
+ + + + diff --git a/misc/api/file-manipulation.html b/misc/api/file-manipulation.html new file mode 100644 index 0000000..e231008 --- /dev/null +++ b/misc/api/file-manipulation.html @@ -0,0 +1,126 @@ + + + + SlideScript API: File manipulation ~ The Lazy Language + + + + + + +
+
+ SlideScript +
+
+ +
+ +
+

If you're following through the API documentation, chapter by chapter, + then you have a good idea of the foundation of the language in terms + of it's structure. Now for some features of SlideScript. File manipulation + is definitely something that can be tackled without a doubt. A selection + of functions within SlideScript that are file related are: isfile, isdir, + showdir (ls), showpath (pwd), move (mv), delete, chdir (cd), read, write, + and cat.

+ To be honest, how could SlideScript be shell like without having the + functionality of all the system utilities. Here's the kicker, everything + is built-in to the core of SlideScript, making it extremely versatile and + super simple! No dependency on other software! +


+#!/usr/bin/slidescript
+# File manipulation examples
+
+# showdir: list directories/files in current directory.
+# argument count: 0
+# returns: file list.
+showdir
+ls # alias
+
+# showpath: show current working directory location (alias pwd).
+# argument count: 0
+# returns: working directory path
+showpath
+pwd # alias
+
+# chdir: Change directory 
+# argument count: 1,  ex: docs/; /home/user
+# returns: No return
+chdir "docs/"
+showpath # Show return of change
+
+# backdir: Back a directory / to parent directory (same as chdir "..")
+# argument count: 0
+# returns: No return
+backdir
+
+# isdir / isfile: Return true or false (0 or 1) on file / directory find.
+# argument count: 1,  ex: "docs/README.txt"
+# returns: true / false
+isfile "docs/README.txt" # returns: true
+isdir "docs/" # returns: true
+isfile "docs/" # returns: false
+
+# move: move file / rename file based on arguments.
+# argument count: 2,  , ex: "docs/" "documents/"
+# returns: no return
+move "docs" "documents" # renamed docs -> documents
+
+# delete: delete file (non-recursive)
+# argument count: 1, , ex: "docs/README.txt"
+# return: no return
+delete "docs/README.txt" # deletes README.txt inside docs/
+
+# read: read contents of file given to function
+# argument count: 1, , ex: "docs/README.txt"
+# return: contents of file
+read "docs/README.txt" # Returns contents of "README.txt"
+
+# write: write contents to file.
+# argument count: 2,  , ex: "test.txt" "Hello world!"
+# return: no return
+write "test.txt" "Hello world!"
+
+# cat: catenate file with given contents
+# argument count: 2,  , ex: "test.txt" "I'm back!"
+# return: no return
+cat "test.txt" "I'm back!" # catenates "I'm back!" to the end of the original test.txt "Hello world!"
+# Ending file contents of "test.txt":
+#   Hello world!
+#   I'm back!
+
+

+ +

IRC server

+

+ Still need help? Want to report a bug? Join us!

+ IP/Port: cddo.cc/1337
+ Main hang channel: #theroot
+ FreeBox channel: #freebox
+ FreonLinux channel: #freonlinux +

+ +
+ + + + diff --git a/misc/api/functions.html b/misc/api/functions.html new file mode 100644 index 0000000..238ab54 --- /dev/null +++ b/misc/api/functions.html @@ -0,0 +1,104 @@ + + + + SlideScript API: Functions & built-in's ~ The Lazy Language + + + + + + +
+
+ SlideScript +
+
+ +
+ +
+

Now that most of the basic built-in functions are aware, time to + start playing with some of the more interesting parts of SlideScript. + SlideScript does indeed seem more shell-like than anything but has its + own unique abilities unlike other scripting languages.

+ +

Loop, comp, and if(n) statements

+

+ You can indeed compare values / process based on what's found around. + For example, file functions like isdir and isfile return a true or false + based on what they find. These returns can be used by some of the + statement handling built into SlideScript's lexer.
+ if(n): +


+#!/usr/bin/slidescript
+# Using isfile/isdir and if/ifn for determining when something needs to be done
+doesitexist=`isfile "test.txt"` # returns 0 / false
+ifn: %doesitexist%; write "test.txt" "created..." # If false, write
+if: %doesitexist%; cat "test.txt" "adding to file..." # if true, catenate
+
+ comp(are): +

+#!/usr/bin/slidescript
+# Using compare and if/ifn for determining if a string is similar or different
+string1=Testing strings
+string2=String testings
+match=`comp: "%string1%" "%string2%"` 
+ifn: %match%; print "Different" # If false, different
+if: %match%; print "Same" # if true, same
+
+ loop: +

+#!/usr/bin/slidescript
+# Using compare and if/ifn for determining when something needs to be done
+count=5
+loop: %count%; print "Printing %count% times..."
+
+

+ +

Other system functions

+

+ SlideScript is a list of other functions that can be used at a given time + or place: time, and sleep. +


+#!/usr/bin/slidescript
+# Time example:
+time
+
+# Sleep example:
+sleep "3"
+print "Will print after 3 seconds..."
+
+

+ +

IRC server

+

+ Still need help? Want to report a bug? Join us!

+ IP/Port: cddo.cc/1337
+ Main hang channel: #theroot
+ FreeBox channel: #freebox
+ FreonLinux channel: #freonlinux +

+ +
+ + + + diff --git a/misc/api/index.html b/misc/api/index.html new file mode 100644 index 0000000..847cf89 --- /dev/null +++ b/misc/api/index.html @@ -0,0 +1,77 @@ + + + + SlideScript API ~ The Lazy Language + + + + + + +
+
+ SlideScript +
+
+ +
+ +
+

SlideScript is pretty simple, and to be worth working with, you + must know how to use it. I'm going to break down the basics of SlideScript + and the functions built-in to the core of the project. This page will + grow and adapt as the project moves onward. Please note that some functions + may slightly differ when building nightly source!

+ + Documentation / API: +

    +
  1. Basics: Strings, variables, pipes, and math
  2. +
  3. File manipulation: Working with files
  4. +
  5. Functions: compare, loop, if, and if-not
  6. +
  7. Networking functions
  8. +
  9. Compression & Encoding
  10. +
+

+ +

Get SlideScript:

+

+ SlideScript is available as source on + NotABug. In + due time, I will start compiling binaries for SlideScript for a range + of operating systems from *Nix 32/64 bit, Windows, OSX, Android (Termux), + and more! But due to rapidly changing in features, and bugfixes, its + just too unstable and... well... outdated after a week or two :D +

+ +

IRC server

+

+ Still need help? Want to report a bug? Join us!

+ IP/Port: cddo.cc/1337
+ Main hang channel: #theroot
+ FreeBox channel: #freebox
+ FreonLinux channel: #freonlinux +

+ +
+ + + + diff --git a/misc/api/networking.html b/misc/api/networking.html new file mode 100644 index 0000000..d9d1661 --- /dev/null +++ b/misc/api/networking.html @@ -0,0 +1,107 @@ + + + + SlideScript API: Networking ~ The Lazy Language + + + + + + +
+
+ SlideScript +
+
+ +
+ +
+

There are various functions within SlideScript in terms of networking availability. + The micro web server is stable and 100% usable, and also incorporated: netlisten and nettoss. +

+ +

SS:HTTP

+

+ SlideScript has, for convenience and ease of use at the prompt level, + a built-in web server. The function is known as nethttp.
+ The function has the ability to fork into the background as an + operational daemon until the SlideScript session is ended. + When not forked, the web server runs in the foreground and + will inform when a connection has been made and requests a file + from the webserver. +


+#!/bin/usr/slidescript
+# Starting the built-in web server
+# run in background!
+nethttp "8080" "1"
+
+chdir "docs"
+
+# run in foreground!
+nethttp "8081" "0"
+
+

+ +

Flat file listening server, and file tossing.

+

+ Amazingly convenient feature for passing raw text from machine + to machine, and these functions are known as: netlisten and nettoss. +
+ Listening server: +


+#!/usr/bin/slidescript
+# Start listening server on port "7000"
+netlisten "7000"
+
+ Incoming connections send data using the nettoss function and + data is saved into a flat file in the working directory as a + random filename based on time, srand, and rand in C.
+ Tossing text / files to listening server: +

+### Sending text / files via interactive shell ###
+
+ss:prompt: nettoss "127.0.0.1" "7000" "Hello!"
+ss:client:connected to 127.0.0.1:7000
+ss:prompt: 
+
+### Listening socket ###
+
+ss:server:listening on '7000'
+ss:server:connection from 127.0.0.1
+ss:server:client buffer saved as 'wQiHVlWxD595XZlk'
+
+

+ +

IRC server

+

+ Still need help? Want to report a bug? Join us!

+ IP/Port: cddo.cc/1337
+ Main hang channel: #theroot
+ FreeBox channel: #freebox
+ FreonLinux channel: #freonlinux +

+ +
+ + + + diff --git a/misc/index.html b/misc/index.html new file mode 100644 index 0000000..178cfae --- /dev/null +++ b/misc/index.html @@ -0,0 +1,94 @@ + + + + SlideScript ~ The Lazy Language + + + + + + +
+
+ SlideScript +
+
+ +
+ +
+

Welcome to the world of SlideScript! To make it simple, SlideScript + is the lazy language and has a very laid-back script parser. What does + that mean for you? Well, you can take what's comfortable with you and + implement it into a SlideScript ready form-factor with just a bit of + behind the scenes information on how SlideScript works!

+ + SlideScript is early in development but supports a heap of features + right out the gate: +

+
+ + As of being just shy of 8,000 lines of C, with this much functionality, + my goal is to bring SlideScript up to par as a functioning language + and Shell implementation along the way! Flexibility, power, and + lightweight is what we strive for in the future development of + SlideScript, yet be as independent as possible. SlideScript requires + next to nothing in terms of dependencies, and has proven to be quite + cross-platform compatible! +

+ +

Get SlideScript:

+

+ SlideScript is available as source on + NotABug. In + due time, I will start compiling binaries for SlideScript for a range + of operating systems from *Nix 32/64 bit, Windows, OSX, Android (Termux), + and more! But due to rapidly changing in features, and bugfixes, its + just too unstable and... well... outdated after a week or two :D +

+ +

IRC server

+

+ IP/Port: cddo.cc/1337
+ Main hang channel: #theroot
+ FreeBox channel: #freebox
+ FreonLinux channel: #freonlinux +


+ +
+ + + + diff --git a/misc/style.css b/misc/style.css new file mode 100644 index 0000000..3383671 --- /dev/null +++ b/misc/style.css @@ -0,0 +1,73 @@ +/* + +CC-BY-SA-NC 4.0 - Chris Dorman, 2020 +cddo.cc - Stylesheet + +*/ + @import url('https://fonts.googleapis.com/css?family=Ubuntu+Mono&display=swap'); + @import url('https://fonts.googleapis.com/css2?family=Monoton&display=swap'); + @media only screen and (min-width: 2001px) { body { max-width: 1000px; } } + @media only screen and (max-width: 2000px) { body { max-width: 1000px; } } + @media only screen and (max-width: 1400px) { body { max-width: 1000px; } } + @media only screen and (max-width: 1200px) { body { max-width: 900px; } } + @media only screen and (max-width: 1000px) { body { max-width: 700px; } } + @media only screen and (max-width: 800px) { body { max-width: 600px; } } +/* @media only screen and (max-width: 700px) { body { max-width: 600px; } } + @media only screen and (max-width: 600px) { body { max-width: 500px; } } + @media only screen and (max-width: 500px) { body { max-width: 450px; } } + @media only screen and (max-width: 400px) { body { max-width: 350px; } } */ + + html { font-family: "Ubuntu Mono", sans-serif; background-color: #dddddd; color: #222222; padding: 4px; margin: 0 auto; font-size: 16px; min-width: 700px;} + body { margin: 0 auto; } + a { color: #aa00ff; } + a:hover { color: #bb00ff; text-decoration: none; } + + table { width: 100%; } + + .logoimg { + display: block; + margin: 0 auto; + } + + p { padding: 5px; } + + .menu { + font-size: 20px; + background: #999999; + padding: 3px 3px 3px 3px; + border: solid 1px #a2a2a2; + width: 95%; + margin: auto; + text-align: center; + border-radius: 4px; + box-shadow: 0px 0px 10px #000000; + } + + .menu a { + color: #9900dd; + text-decoration: none; + padding: 3px 10px 3px 10px; + /* some effects */ + transition: ease-in .4s color, ease-in .4s background-color, ease-in .4s text-shadow, ease-in .4s border-top; + -moz-transition: ease-in .4s color, ease-in .4s background-color, ease-in .4s text-shadow, ease-in .4s border-top; + -webkit-transition: ease-in .4s color, ease-in .4s background-color, ease-in .4s text-shadow, ease-in .4s border-top; + -o-transition: ease-in .4s color, ease-in .4s background-color, ease-in .4s text-shadow, ease-in .4s border-top; + } + + .menu a:hover { + color: #bb00ff; text-decoration: none; + background-color: #dbdbdb; text-shadow: 0px 0px 7px silver; + border-top: solid 1px #bb00ff; + } + + .header { + font-family: "Monoton", "Ubuntu Mono", sans-serif; + font-size: 28px; + color: #aa00ff; + } + + .container { padding: 12px; } + .footer { font-size: 16px; color: #565656; text-align: center; } + .footer a { text-decoration: none; } + .note { color: red; font-weight: 500; padding: 7px; } + .rfloat { float: right; position: inline-block; }