testing script and source
This commit is contained in:
5
test/archive_test/Fes.toml
Normal file
5
test/archive_test/Fes.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
[app]
|
||||
|
||||
name = "archive"
|
||||
version = "0.0.1"
|
||||
authors = ["vx-clutch"]
|
||||
4
test/archive_test/README.md
Normal file
4
test/archive_test/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# archive
|
||||
|
||||
This example demonstrates the archive feature of Fes it is useful for file
|
||||
sharing purposes.
|
||||
22
test/archive_test/archive/facts/seals/seals.txt
Normal file
22
test/archive_test/archive/facts/seals/seals.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
Pinnipeds [2] are the seals and their relatives, a group of semi-aquatic marine
|
||||
mammals. The Pinnipedia is in the Order Carnivora. There are three seal
|
||||
families: Odobenidae (walruses), Otariidae (eared seals, including sea lions
|
||||
and fur seals), and Phocidae (true seals).[3]
|
||||
|
||||
Seals are sleek-bodied and barrel-shaped. Their bodies are well adapted to the
|
||||
aquatic habitat where they spend most of their lives. Pinnipeds have flippers
|
||||
for hands, big bulky bodies, doggish faces, and big eyes. Unlike cetaceans,
|
||||
pinnipeds have their noses on their faces, and each nostril of the nose closes
|
||||
when the pinniped goes underwater. Like cetaceans, pinnipeds have a thick layer
|
||||
of blubber (fat) just under their skin: this blubber keeps them warm in cold
|
||||
waters and keeps them fed during times when food is not easily found. When they
|
||||
cannot find food, they live off the fat in the blubber.
|
||||
|
||||
Pinnipeds are carnivorous. This means they eat only meat (such as fish or
|
||||
squid) and not plants. However, almost all pinnipeds can be eaten by polar
|
||||
bears, sharks and killer whales.
|
||||
|
||||
Seals are often trained in zoos or aquariums to put on shows. However, in
|
||||
Sweden, it is illegal to train a seal to balance a ball on its nose.[4]
|
||||
|
||||
From [Pinniped Wikipedia](https://simple.wikipedia.org/wiki/Pinniped)
|
||||
BIN
test/archive_test/archive/seal.png
Normal file
BIN
test/archive_test/archive/seal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
10
test/archive_test/www/index.lua
Normal file
10
test/archive_test/www/index.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
local fes = require("fes")
|
||||
local site = fes.fes()
|
||||
|
||||
site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD")
|
||||
|
||||
site:h1("Hello, World!")
|
||||
|
||||
site:a("/archive", fes.std.h2("To the file room!"))
|
||||
|
||||
return site
|
||||
5
test/basic_hello_world/Fes.toml
Normal file
5
test/basic_hello_world/Fes.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
[app]
|
||||
|
||||
name = "hello"
|
||||
version = "0.0.1"
|
||||
authors = ["vx-clutch"]
|
||||
4
test/basic_hello_world/README.md
Normal file
4
test/basic_hello_world/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# hello
|
||||
|
||||
This is a very simple hello world program, the only difference between this and
|
||||
default is this README.
|
||||
8
test/basic_hello_world/www/index.lua
Normal file
8
test/basic_hello_world/www/index.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
local fes = require("fes")
|
||||
local site = fes.fes()
|
||||
|
||||
site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD")
|
||||
|
||||
site:h1("Hello, World!")
|
||||
|
||||
return site
|
||||
5
test/complex_sample_project/Fes.toml
Normal file
5
test/complex_sample_project/Fes.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
[app]
|
||||
|
||||
name = "best"
|
||||
version = "0.0.1"
|
||||
authors = ["vx-clutch"]
|
||||
23
test/complex_sample_project/README.md
Normal file
23
test/complex_sample_project/README.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# best
|
||||
|
||||
This is an example of best practices for the Fes framework.
|
||||
|
||||
## Parts
|
||||
|
||||
With best practice we can break our sites into a few parts.
|
||||
|
||||
## Index
|
||||
|
||||
The main page of the site loads in the header and the footer, as well as shows
|
||||
some core information
|
||||
|
||||
## Include
|
||||
|
||||
Within include the header and footer are defined.
|
||||
|
||||
* **Header:** Site navigation and name display
|
||||
* **Footer:** Extra and external information.
|
||||
|
||||
## Static
|
||||
|
||||
This is where we store our favicon.
|
||||
13
test/complex_sample_project/include/footer.lua
Normal file
13
test/complex_sample_project/include/footer.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
local footer = {}
|
||||
|
||||
footer.render = function(std)
|
||||
return table.concat({
|
||||
std.h2("Other resources"),
|
||||
std.tl({
|
||||
std.external("https://git.vxserver.dev/fSD/fes", "Fes source"),
|
||||
std.external("https://docs.vxserver.dev/static/fes.html", "Documentation"),
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
||||
return footer
|
||||
7
test/complex_sample_project/include/header.lua
Normal file
7
test/complex_sample_project/include/header.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
local header = {}
|
||||
|
||||
header.render = function(std)
|
||||
return std.center(std.ha("/", std.h1("Best Practices")))
|
||||
end
|
||||
|
||||
return header
|
||||
BIN
test/complex_sample_project/static/favicon.ico
Normal file
BIN
test/complex_sample_project/static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
20
test/complex_sample_project/www/index.lua
Normal file
20
test/complex_sample_project/www/index.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
local fes = require("fes")
|
||||
local std = fes.std
|
||||
local u = fes.util
|
||||
|
||||
local site = fes.fes()
|
||||
|
||||
site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD")
|
||||
site.title = "Best practices"
|
||||
site.favicon = "/static/favicon.ico"
|
||||
|
||||
site:banner(fes.app.header.render(std))
|
||||
|
||||
site:note(u.cc {
|
||||
std.h2("Hello, World!"),
|
||||
std.p("This is an example of the best practices/canonical Fes site.")
|
||||
})
|
||||
|
||||
site:note(fes.app.footer.render(std))
|
||||
|
||||
return site
|
||||
5
test/default_project/Fes.toml
Normal file
5
test/default_project/Fes.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
[app]
|
||||
|
||||
name = "default"
|
||||
version = "0.0.1"
|
||||
authors = ["vx-clutch"]
|
||||
33
test/default_project/README.md
Normal file
33
test/default_project/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# default
|
||||
|
||||
```
|
||||
fes new default
|
||||
```
|
||||
|
||||
> **Know what you are doing?** Delete this file. Have fun!
|
||||
|
||||
## Project Structure
|
||||
|
||||
Inside your Fes project, you'll see the following directories and files:
|
||||
|
||||
```
|
||||
.
|
||||
├── Fes.toml
|
||||
├── README.md
|
||||
└── www
|
||||
└── index.lua
|
||||
```
|
||||
|
||||
Fes looks for `.lua` files in the `www/` directory. Each file is exposed as a route based on its file name.
|
||||
|
||||
## Commands
|
||||
|
||||
All commands are run from the root of the project, from a terminal:
|
||||
|
||||
| Command | Action |
|
||||
| :------------------------ | :----------------------------------------------- |
|
||||
| `fes run .` | Runs the project at `.` |
|
||||
|
||||
## What to learn more?
|
||||
|
||||
Check out [Fes's docs](https://docs.vxserver.dev/static/fes.html).
|
||||
8
test/default_project/www/index.lua
Normal file
8
test/default_project/www/index.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
local fes = require("fes")
|
||||
local site = fes.fes()
|
||||
|
||||
site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD")
|
||||
|
||||
site:h1("Hello, World!")
|
||||
|
||||
return site
|
||||
5
test/expected_error/Fes.toml
Normal file
5
test/expected_error/Fes.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
[app]
|
||||
|
||||
name = "error"
|
||||
version = "0.0.1"
|
||||
authors = ["vx-clutch"]
|
||||
6
test/expected_error/README.md
Normal file
6
test/expected_error/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# error
|
||||
|
||||
This shows what a Lua error looks like to the user. Lua errors are the most
|
||||
common and the most critical so that is why they are shown to the user. Other,
|
||||
lesser errors, are only shown to the developer because of their different
|
||||
nature.
|
||||
10
test/expected_error/www/index.lua
Normal file
10
test/expected_error/www/index.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
local fes = require("fes")
|
||||
local site = fes.fes()
|
||||
|
||||
site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD")
|
||||
|
||||
This is what an error looks like
|
||||
|
||||
site:h1("Hello, World!")
|
||||
|
||||
return site
|
||||
5
test/markdown_render/Fes.toml
Normal file
5
test/markdown_render/Fes.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
[app]
|
||||
|
||||
name = "markdown"
|
||||
version = "0.0.1"
|
||||
authors = ["vx-clutch"]
|
||||
3
test/markdown_render/README.md
Normal file
3
test/markdown_render/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# markdown
|
||||
|
||||
This example demonstrate Fes's ability to handle markdown routes.
|
||||
3
test/markdown_render/www/index.md
Normal file
3
test/markdown_render/www/index.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Markdown!
|
||||
|
||||
**Fes** also supports markdown routes!
|
||||
5
test/minimal_return/Fes.toml
Normal file
5
test/minimal_return/Fes.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
[app]
|
||||
|
||||
name = "simple"
|
||||
version = "0.0.1"
|
||||
authors = ["vx-clutch"]
|
||||
5
test/minimal_return/README.md
Normal file
5
test/minimal_return/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# simple
|
||||
|
||||
This simple example shows the extensibility of the Fes framework. It shows the
|
||||
you do not necessarily need to use the site object (although it is recommended)
|
||||
you can define your own site, similar to how Lisps do things.
|
||||
1
test/minimal_return/www/index.lua
Normal file
1
test/minimal_return/www/index.lua
Normal file
@@ -0,0 +1 @@
|
||||
return "Hello, World!"
|
||||
Reference in New Issue
Block a user