Skip to content

Commit

Permalink
chore(docs): update documentation to use the new import mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFola committed May 7, 2024
1 parent 42b7acf commit 0aff6bd
Show file tree
Hide file tree
Showing 23 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion draft/database/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} PRIVATE ArkReactor ${SQLite3_LIBRARIES})

target_compile_features(ArkReactor PRIVATE cxx_std_20)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)

add_custom_command(TARGET ${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy
Expand Down
2 changes: 1 addition & 1 deletion draft/database/tests/main.ark
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(import "database.arkm")
(import database)

(let db (database:sqlite:open "test.db"))

Expand Down
2 changes: 1 addition & 1 deletion draft/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} PRIVATE ArkReactor OpenSSL::Crypto OpenSSL::SSL)

target_compile_features(ArkReactor PRIVATE cxx_std_20)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)

add_custom_command(TARGET ${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy
Expand Down
2 changes: 1 addition & 1 deletion draft/http/documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Disclaimer: this module does not handle
* chunked transfer encoding
* server-sent events
* multiple servers per program
* digest authentification (needs OpenSSL and libcrypto for that)
* digest authentication (needs OpenSSL and libcrypto for that)
14 changes: 7 additions & 7 deletions draft/http/documentation/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ They work as pairs with:

## http:client:create

Create an http client to query a server.
Create a http client to query a server.

**Parameters**
- `host`: string, you must not put the protocol `http://` nor `https://`
Expand All @@ -44,7 +44,7 @@ Create an http client to query a server.

## http:client:get

Get content from an online ressource.
Get content from an online resource.

**Parameters**
- `client`: `UserType<httpClient>`
Expand Down Expand Up @@ -176,7 +176,7 @@ It works like `http:headers:create`, you need to give an even number of Strings
Convert an `httpParams` to an ArkScript readable list.

**Parameters**
- `httpParams`: UserType<Params>, can generated by the module with `http:params:create`
- `httpParams`: UserType<Params>, can be generated by the module with `http:params:create`

**Return value** `List`

Expand Down Expand Up @@ -248,7 +248,7 @@ Set the write timeout.

## http:client:setBasicAuth

Set the basic authentification username and password for a client to use.
Set the basic authentication username and password for a client to use.

**Parameters**
- `username`: string
Expand All @@ -261,7 +261,7 @@ Set the basic authentification username and password for a client to use.

## http:client:setBearerTokenAuth

Set the basic bearer token authentification for a client to use.
Set the basic bearer token authentication for a client to use.

**Parameters**
- `token`: string
Expand Down Expand Up @@ -298,7 +298,7 @@ Set the parameters (host and port) of a proxy, to be used by a client.

## http:client:setProxyBasicAuth

Set the basic proxy authentification username and password for a client to use.
Set the basic proxy authentication username and password for a client to use.

**Parameters**
- `username`: string
Expand All @@ -311,7 +311,7 @@ Set the basic proxy authentification username and password for a client to use.

## http:client:setProxyBearerTokenAuth

Set the basic proxy bearer token authentification for a client to use.
Set the basic proxy bearer token authentication for a client to use.

**Parameters**
- `token`: string
Expand Down
54 changes: 27 additions & 27 deletions draft/http/documentation/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Important note related to the routes: in case the given content argument doesn't

## http:server:create

Create the server (only one per VM may be instanciated).
Create the server (only one per VM may be instanced).

**Parameters**
- None.
Expand All @@ -16,7 +16,7 @@ Create the server (only one per VM may be instanciated).

**Example**
~~~~{.lisp}
(import "http.arkm")
(import http)
(http:server:create)
~~~~

Expand All @@ -30,7 +30,7 @@ Create the server (only one per VM may be instanciated).
Create a route to answer the specified request type.

**Parameters**
- `route`: a string representing the route to handle. The route can receive matches with the regex syntax, eg `/(\\d+)` to match on numbers
- `route`: a string representing the route to handle. The route can receive matches with the regex syntax, e.g. `/(\\d+)` to match on numbers
- `handler`: a function returning a list `[status-code content type]`
- `status-code`: number, representing an HTTP code
- `content`: string
Expand All @@ -48,7 +48,7 @@ The typical `handler` function looks like this: `(fun (matches body params) ...)

**Example**
~~~~{.lisp}
(import "http.arkm")
(import http)
(http:server:create)
(http:server:get "/hi" "this is my fabulous content" "text/plain")
Expand Down Expand Up @@ -79,7 +79,7 @@ Stop a server.

**Example**
~~~~{.lisp}
(import "http.arkm")
(import http)
(http:server:create)
...
Expand All @@ -94,7 +94,7 @@ Stop a server.

## http:server:listen

Setup the server to listen forever. Should only be called once after having setup all the routes.
Set up the server to listen forever. Should only be called once after having setup all the routes.

**Parameters**
- `host`: a string ; an IP address or `localhost`
Expand All @@ -107,7 +107,7 @@ Setup the server to listen forever. Should only be called once after having setu

**Example**
~~~~{.lisp}
(import "http.arkm")
(import http)
(http:server:create)
Expand All @@ -132,7 +132,7 @@ Mount a given directory to a specific location. You can mount a directory to mul

**Example**
~~~~{.lisp}
(import "http.arkm")
(import http)
(http:server:create)
Expand All @@ -149,7 +149,7 @@ Mount a given directory to a specific location. You can mount a directory to mul
Remove a mount point.

**Parameters**
- `mountpoint`: string, a mountpoint name
- `mountpoint`: string, a mount point name

**Return value** `bool`, false if the mount point can't be found, true otherwise.

Expand All @@ -158,7 +158,7 @@ Remove a mount point.

**Example**
~~~~{.lisp}
(import "http.arkm")
(import http)
(http:server:create)
Expand All @@ -185,22 +185,22 @@ Map a file extension to a mimetype.

Built-in mappings:

Extension | MIME Type
--------- | ---------
txt | text/plain
html, htm | text/html
css | text/css
jpeg, jpg | image/jpg
png | image/png
gif | image/gif
svg | image/svg+xml
ico | image/x-icon
json | application/json
pdf | application/pdf
js | application/javascript
wasm | application/wasm
xml | application/xml
xhtml | application/xhtml+xml
| Extension | MIME Type |
|-----------|------------------------|
| txt | text/plain |
| html, htm | text/html |
| css | text/css |
| jpeg, jpg | image/jpg |
| png | image/png |
| gif | image/gif |
| svg | image/svg+xml |
| ico | image/x-icon |
| json | application/json |
| pdf | application/pdf |
| js | application/javascript |
| wasm | application/wasm |
| xml | application/xml |
| xhtml | application/xhtml+xml |

**Author**
- [@SuperFola](https://github.com/SuperFola)
Expand All @@ -227,7 +227,7 @@ Level 2 will add the request body as well.

**Example**
~~~~{.lisp}
(import "http.arkm")
(import http)
(http:server:create)
Expand Down
2 changes: 1 addition & 1 deletion draft/json/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} PRIVATE ArkReactor)

target_compile_features(ArkReactor PRIVATE cxx_std_20)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)

add_custom_command(TARGET ${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy
Expand Down
2 changes: 1 addition & 1 deletion draft/json/tests/main.ark
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(import "json.arkm")
(import json)

(let json (json:open "test.json"))
(let jsonString "{\"hello\":\"world\",\"key\":12}")
Expand Down
2 changes: 1 addition & 1 deletion draft/msgpack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} PRIVATE ArkReactor)

target_compile_features(ArkReactor PRIVATE cxx_std_20)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)

add_custom_command(TARGET ${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy
Expand Down
2 changes: 1 addition & 1 deletion draft/msgpack/documentation/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A module for **msgpack**, an efficient binary serialization format like JSON, bu
### Example

``` clojure
(import "msgpack.arkm")
(import msgpack)

# buffer
(let sbuf (msgpack:sbuffer))
Expand Down
2 changes: 1 addition & 1 deletion draft/msgpack/tests/main.ark
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(import "msgpack.arkm")
(import msgpack)

# buffer
(let sbuf (msgpack:sbuffer))
Expand Down
2 changes: 1 addition & 1 deletion src/bitwise/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} PRIVATE ArkReactor)

target_compile_features(ArkReactor PRIVATE cxx_std_20)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)

add_custom_command(TARGET ${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy
Expand Down
10 changes: 5 additions & 5 deletions src/bitwise/documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Right shifts a given number.

**Example**
~~~~{.lisp}
(import "bitwise.arkm")
(import bitwise)
(print (bitwise:rshift 4096 3)) # 512
~~~~

Expand All @@ -36,7 +36,7 @@ Left shifts a given number.

**Example**
~~~~{.lisp}
(import "bitwise.arkm")
(import bitwise)
(print (bitwise:lshift 512 3)) # 4096
~~~~

Expand All @@ -55,7 +55,7 @@ Xor a number given a mask.

**Example**
~~~~{.lisp}
(import "bitwise.arkm")
(import bitwise)
(print (bitwise:xor 99 13)) # 110
~~~~

Expand All @@ -74,7 +74,7 @@ Compute the bitwise `a OR b` operation.

**Example**
~~~~{.lisp}
(import "bitwise.arkm")
(import bitwise)
(print (bitwise:or 89 13)) # 93
~~~~

Expand All @@ -93,6 +93,6 @@ Compute the bitwise `a AND b` operation.

**Example**
~~~~{.lisp}
(import "bitwise.arkm")
(import bitwise)
(print (bitwise:and 89 13)) # 9
~~~~
2 changes: 1 addition & 1 deletion src/bitwise/tests/main.ark
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(import "bitwise.arkm")
(import bitwise)

(assert (= 4 (bitwise:rshift 140 5)) "140 >> 5")
(assert (= 8 (bitwise:rshift 140 4)) "140 >> 4")
Expand Down
2 changes: 1 addition & 1 deletion src/console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} PRIVATE ArkReactor)

target_compile_features(ArkReactor PRIVATE cxx_std_20)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)

add_custom_command(TARGET ${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy
Expand Down
4 changes: 2 additions & 2 deletions src/console/documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Clear the terminal on Windows and Posix.

**Example**
~~~~{.lisp}
(import "console.arkm")
(import console)
(print "hello world") # hello world is printed
(console:clear) # now the whole terminal is empty and nothing is printed
~~~~
Expand Down Expand Up @@ -61,7 +61,7 @@ on_white

**Example**
~~~~{.lisp}
(import "console.arkm")
(import console)
(print "hello world") # this is using the default color of the terminal
(console:color "red")
(print "this is in red")
Expand Down
2 changes: 1 addition & 1 deletion src/console/tests/main.ark
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(import "console.arkm")
(import console)

# no tests to do as this is only visual and cosmetics

Expand Down
2 changes: 1 addition & 1 deletion src/hash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} PRIVATE ArkReactor)

target_compile_features(ArkReactor PRIVATE cxx_std_20)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)

add_custom_command(TARGET ${PROJECT_NAME}
COMMAND ${CMAKE_COMMAND} -E copy
Expand Down
4 changes: 2 additions & 2 deletions src/hash/documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Generates a SHA256 of a given string.

**Example**
~~~~{.lisp}
(import "hash.arkm")
(import hash)
(print (hash:sha256 "arkscript")) # c56d0bb03e9e03e7000f7b596cdb333c315523af7e4781f02610c690441c43dd
~~~~

Expand All @@ -32,6 +32,6 @@ Generates a MD5 of a given string.

**Example**
~~~~{.lisp}
(import "hash.arkm")
(import hash)
(print (hash:md5 "arkscript")) # a27ee01c49b7552b8d69a631b7bb23c9
~~~~
2 changes: 1 addition & 1 deletion src/hash/tests/main.ark
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(import "hash.arkm")
(import hash)

(assert (= "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" (hash:sha256 "")) "sha256 ''")
(assert (= "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824" (hash:sha256 "hello")) "sha256 'hello'")
Expand Down
Loading

0 comments on commit 0aff6bd

Please sign in to comment.