Skip to content

Commit

Permalink
GITBOOK-8: change request with no subject merged in GitBook
Browse files Browse the repository at this point in the history
  • Loading branch information
victor authored and gitbook-bot committed Aug 19, 2023
1 parent d327dc1 commit a7c9fae
Show file tree
Hide file tree
Showing 16 changed files with 231 additions and 1 deletion.
Binary file added .gitbook/assets/image (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion README.md
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.
23 changes: 23 additions & 0 deletions SUMMARY.md
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)
9 changes: 9 additions & 0 deletions data-types/arrays.md
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>
9 changes: 9 additions & 0 deletions data-types/data.md
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.
28 changes: 28 additions & 0 deletions data-types/event.md
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!
27 changes: 27 additions & 0 deletions data-types/page.md
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
}
```
````
13 changes: 13 additions & 0 deletions data-types/variables.md
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)"
```
````
25 changes: 25 additions & 0 deletions data-types/view.md
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 !"
}
```
19 changes: 19 additions & 0 deletions getting-started/install.md
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)&#x20;



### 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.
11 changes: 11 additions & 0 deletions the-basics/conditions.md
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"
}
```
````
21 changes: 21 additions & 0 deletions the-basics/include.md
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:&#x20;

```
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"
```
19 changes: 19 additions & 0 deletions the-basics/sessions.md
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
}
```
11 changes: 11 additions & 0 deletions the-basics/static-site-export.md
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"
```
9 changes: 9 additions & 0 deletions the-basics/string-concatenation.md
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>

0 comments on commit a7c9fae

Please sign in to comment.