-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GITBOOK-8: change request with no subject merged in GitBook
- Loading branch information
1 parent
d327dc1
commit a7c9fae
Showing
16 changed files
with
231 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
# Documentation | ||
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: | ||
|
||
<figure><img src="../.gitbook/assets/image (1).png" alt=""><figcaption><p>Small example of how to use arrays</p></figcaption></figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
``` | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)" | ||
``` | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 !" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
``` | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: | ||
|
||
<figure><img src="../.gitbook/assets/image.png" alt=""><figcaption><p>Example of string concatenation for includes</p></figcaption></figure> |