diff --git a/.gitbook/assets/image (1).png b/.gitbook/assets/image (1).png new file mode 100644 index 0000000..6e03d2a Binary files /dev/null and b/.gitbook/assets/image (1).png differ diff --git a/.gitbook/assets/image.png b/.gitbook/assets/image.png new file mode 100644 index 0000000..bfaef4c Binary files /dev/null and b/.gitbook/assets/image.png differ diff --git a/README.md b/README.md index 7d8b3af..b2f3733 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -# Documentation \ No newline at end of file +# What is BuckShot++? + +BuckShot++ is an Object Oriented programming language built for the web. It's like if PHP, react js and css was one unified programming language. + +In bpp, you simply write bpp code, and then this code will be compiled into a fully working web server, html, css and js! + +So, in bpp you can create [views](data-types/view.md), views are the heart of bpp they define a bpp object that can be seen, it's like writing HTML, CSS and JS, but in a simple unified object. diff --git a/SUMMARY.md b/SUMMARY.md new file mode 100644 index 0000000..8807629 --- /dev/null +++ b/SUMMARY.md @@ -0,0 +1,23 @@ +# Table of contents + +## 🤝 Getting started + +* [What is BuckShot++?](README.md) +* [Install](getting-started/install.md) + +## 👔 Data types + +* [Variables](data-types/variables.md) +* [Arrays](data-types/arrays.md) +* [View](data-types/view.md) +* [Data](data-types/data.md) +* [Page](data-types/page.md) +* [Event](data-types/event.md) + +## 🤓 The basics + +* [Include](the-basics/include.md) +* [String concatenation](the-basics/string-concatenation.md) +* [Conditions](the-basics/conditions.md) +* [Sessions](the-basics/sessions.md) +* [Static site export](the-basics/static-site-export.md) diff --git a/data-types/arrays.md b/data-types/arrays.md new file mode 100644 index 0000000..9d5c481 --- /dev/null +++ b/data-types/arrays.md @@ -0,0 +1,9 @@ +--- +description: Learn how to use arrays in BuckShot++ +--- + +# Arrays + +Arrays are useful, when you want, for example, to specify multiple views into a view content, like the following example: + +

Small example of how to use arrays

diff --git a/data-types/data.md b/data-types/data.md new file mode 100644 index 0000000..d6a3651 --- /dev/null +++ b/data-types/data.md @@ -0,0 +1,9 @@ +--- +description: Discover what is the data datatype and how to use it +--- + +# Data + +Data is like a [view](view.md), but can't be rendered. + +For example, the [session ](../the-basics/sessions.md)object is of type data. diff --git a/data-types/event.md b/data-types/event.md new file mode 100644 index 0000000..0509de4 --- /dev/null +++ b/data-types/event.md @@ -0,0 +1,28 @@ +--- +description: Learn how to use event objects in BuckShotPlusPlus! +--- + +# Event + +Events in BuskShot++ are view that will override an other view, when they are called. + +Here is an example on how to create an event, that will change the content and color of my view on click: + +```` +```bpp +event changeTitle{ + content = "You already clicked!" + color = "red" +} + +view MyCoolButton{ + type = "button" + content = "Click on me!" + onclick = changeTitle + cursor = "pointer" +} + +``` +```` + +If you try this on your bpp project, you will see the content of the button change to "You already clicked!" in red once you click the button! diff --git a/data-types/page.md b/data-types/page.md new file mode 100644 index 0000000..f1f28fa --- /dev/null +++ b/data-types/page.md @@ -0,0 +1,27 @@ +--- +description: Discover how to use page objects in BuckShotPlusPlus! +--- + +# Page + +A pager object is similar to a [view](view.md) object, but is used to create new pages, here is how you create a new page in bpp: + +```` +```bpp +page index{ + title = "My Index!" + body = My_Body_View +} +``` +```` + +This will create an index page, the index page is a special keyword and will be accessible trough the / url, but if you set something else as the page name, like blog, then your page would be accessible trough /blog, here is an example: + +```` +```bpp +page blog{ + title = "My cool blog!" + body = My_Blog_Body_View +} +``` +```` diff --git a/data-types/variables.md b/data-types/variables.md new file mode 100644 index 0000000..8d2cc20 --- /dev/null +++ b/data-types/variables.md @@ -0,0 +1,13 @@ +--- +description: Learn how variables works in BuskShot++ +--- + +# Variables + +Variables in bpp are simples and straightforward, you simply set YourVariableName = "Your value" + +```` +```bpp +CoolWhiteColor = "rgb(250,250,250)" +``` +```` diff --git a/data-types/view.md b/data-types/view.md new file mode 100644 index 0000000..e9a83a1 --- /dev/null +++ b/data-types/view.md @@ -0,0 +1,25 @@ +# View + +The view data type is the core of BuckShot++, it can contains html, css and js properties and is a reusable object! + +### Declaring new views + +Here is how you create a view in bpp: + +``` +view MyFirstView{ + type = "h1" + content = "This is an awesome title!" + color = "red" +} +``` + +### Child views + +Since bpp is Object Oriented, you can create new views based of the properties of an other parent view, if you do so, the new view will inehrit all the properties from the parent. Here is an example of how to do so: + +``` +view MyChildView:MyFirstView{ + content = "I have just changed the content of MyFirstView !" +} +``` diff --git a/getting-started/install.md b/getting-started/install.md new file mode 100644 index 0000000..50bf4e9 --- /dev/null +++ b/getting-started/install.md @@ -0,0 +1,19 @@ +--- +description: Learn how to install Buckshot++ +--- + +# Install + +### Use latest binary + +The simplest method to get started with Buckshot++, simply download the lastest binary on our GitHub repo or on the official website + +### Compile from the source + +If you want you can build your own binary for Buckshot++ using the official source code available on [our GitHub repo](https://github.com/BuckshotPlusPlus/BuckshotPlusPlus) + + + +### Run your BuckShot++ server + +To run your bpp server you just have to run the BuckShotPlusPlus executable with your main.bpp file path as first argument. diff --git a/the-basics/conditions.md b/the-basics/conditions.md new file mode 100644 index 0000000..d5d8b6d --- /dev/null +++ b/the-basics/conditions.md @@ -0,0 +1,11 @@ +# Conditions + +Here is how you can create a simple condition in bpp: + +```` +```bpp +if (MyVar == "test"){ + MyView.content = "The condition is true" +} +``` +```` diff --git a/the-basics/include.md b/the-basics/include.md new file mode 100644 index 0000000..34d053d --- /dev/null +++ b/the-basics/include.md @@ -0,0 +1,21 @@ +--- +description: Learn how includes works in BuckShot++ +--- + +# Include + +### Local includes + +If you want to include local bpp files to your project, you just have to do the following: + +``` +include "local/path/to/your/file.bpp" +``` + +### Network includes + +You can include any bpp file accessible trough an https link, to do so use a normal include, but specify the url as shown below: + +``` +include "https://link_to_your_bpp_file" +``` diff --git a/the-basics/sessions.md b/the-basics/sessions.md new file mode 100644 index 0000000..3c6ec27 --- /dev/null +++ b/the-basics/sessions.md @@ -0,0 +1,19 @@ +--- +description: Discover what are sessions and how they work +--- + +# Sessions + +Sessions in bpp enables you to keep track of what a user is doing, the session data object, is a data object accessible inside pages or views and have the following variables in it: + +* ip : The current IP address used by thye session +* id : The unique ID of the current session + +So for example if you would like to create a text displaying the user ip address you could do: + +``` +view MyIPTest{ + type = "p" + content = session.ip +} +``` diff --git a/the-basics/static-site-export.md b/the-basics/static-site-export.md new file mode 100644 index 0000000..8d5c1c9 --- /dev/null +++ b/the-basics/static-site-export.md @@ -0,0 +1,11 @@ +--- +description: Learn how to export static websites in BuckShot++ +--- + +# Static site export + +To export a static website you just have to use the export command, here is how: + +```sh +BuckShotPlusPlus.exe export "path/to/your/main.bpp" "path/to/your/export/folder" +``` diff --git a/the-basics/string-concatenation.md b/the-basics/string-concatenation.md new file mode 100644 index 0000000..ddebcd5 --- /dev/null +++ b/the-basics/string-concatenation.md @@ -0,0 +1,9 @@ +--- +description: Learn how to concatenate string in bpp +--- + +# String concatenation + +String concatenation is useful when you want to concatenate multiple strings or variables together, simply using the + symbol, here is an example: + +

Example of string concatenation for includes