Skip to content

Commit

Permalink
Cleanup whitespace from docs (md)
Browse files Browse the repository at this point in the history
  • Loading branch information
fliiiix authored and gittiver committed Sep 1, 2024
1 parent ed208af commit dfbce12
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 38 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Crow is a C++ framework for creating HTTP or Websocket web services. It uses rou
Available [here](https://crowcpp.org).

> **Warning**
>
>
> If you are using Crow v0.3, then you have to put `#define CROW_MAIN` at the top of one and only one source file.
## Examples
Expand Down Expand Up @@ -136,10 +136,10 @@ Crow has incorporated the following libraries into its source.
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
IN THE SOFTWARE.

---------------------------------------------------------------------------


qs_parse (used for reading query string parameters)

Expand All @@ -156,7 +156,7 @@ Crow has incorporated the following libraries into its source.
all copies or substantial portions of the Software.

---------------------------------------------------------------------------


TinySHA1 (used during the websocket handshake, not for security)

Expand All @@ -167,23 +167,23 @@ Crow has incorporated the following libraries into its source.

Copyright (c) 2012-22 SAURAV MOHAPATRA [email protected]
Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright
with or without fee is hereby granted, provided that the above copyright
notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

---------------------------------------------------------------------------


Catch2 (used only in unit tests, not part of the actual framework)

https://github.com/catchorg/Catch2

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
Expand Down
8 changes: 4 additions & 4 deletions docs/getting_started/a_simple_webpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ Once the code is done compiling, if we call `http://localhost:18080/` we get our

!!! note

Compilation instructions are available for
[Linux](setup/linux.md#compiling-your-project),
[MacOS](setup/macos.md#compiling-using-a-compiler-directly),
and
Compilation instructions are available for
[Linux](setup/linux.md#compiling-your-project),
[MacOS](setup/macos.md#compiling-using-a-compiler-directly),
and
[Windows](setup/windows.md#getting-and-compiling-crow)


Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/setup/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ From there CMake should handle compiling and linking your project.
!!! note

For optional features like HTTP Compression or HTTPS you can set

the `CROW_ENABLE_SSL` variable to enable the support for https
the `CROW_ENABLE_COMPRESSION` variable to enable the support for http compression

Expand Down
6 changes: 3 additions & 3 deletions docs/getting_started/setup/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ This will generate a `crow_all.h` file which you can use in the following steps
4. `make -j12`
!!! note

You can add options like `-DCROW_ENABLE_COMPRESSION=ON`
or `-DCROW_ENABLE_SSL=ON`
or `-DCROW_AMALGAMATE`
You can add options like `-DCROW_ENABLE_COMPRESSION=ON`
or `-DCROW_ENABLE_SSL=ON`
or `-DCROW_AMALGAMATE`
to `cmake ..` to build optional tests/examples for HTTP Compression or HTTPS.

## Compiling using a compiler directly
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started/setup/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ The following guide will use `example_with_all.cpp` as the Crow application for
8. Add `crow_all.h` to `Header Files` and `example_with_all.cpp` to `Source Files`.
9. In solution explorer, right click the name of your project then click `Properties`.
10. Under `vcpkg`, set `Use Vcpkg Manifest` to `Yes` and `Additional Options` to `--feature-flags="versions"`.
11. Set `Debug/Release` and `x64/x86`.
11. Set `Debug/Release` and `x64/x86`.
12. Run.
6 changes: 3 additions & 3 deletions docs/getting_started/your_first_application.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ int main()
}
```

You then need to compile your code on your
[Linux](setup/linux.md#compiling-your-project),
[MacOS](setup/macos.md#compiling-using-a-compiler-directly), or
You then need to compile your code on your
[Linux](setup/linux.md#compiling-your-project),
[MacOS](setup/macos.md#compiling-using-a-compiler-directly), or
[Windows](setup/windows.md#getting-and-compiling-crow) machine

After building your `.cpp` file and running the resulting executable, you should be able to access your endpoint at [http://localhost:18080](http://localhost:18080). Opening this URL in your browser will show a white screen with "Hello world" typed on it.
2 changes: 1 addition & 1 deletion docs/guides/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ app.bindaddr("192.168.1.2")
!!! note

The `run()` method is blocking. To run a Crow app asynchronously `run_async()` should be used instead.

!!! warning

When using `run_async()`, make sure to use a variable to save the function's output (such as `#!cpp auto _a = app.run_async()`). Otherwise the app will run synchronously.
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Basic HTTP authentication requires the client to send the Username and Password
We don't need to worry about creating the request, we only need to extract the credentials from the `Authorization` header and verify them.
!!! note

There are multiple ways to verify the credentials. Most involve checking the username in a database, then checking a hash of the password against the stored password hash for that username. This tutorial will not go over them
There are multiple ways to verify the credentials. Most involve checking the username in a database, then checking a hash of the password against the stored password hash for that username. This tutorial will not go over them

<br>

Expand Down
1 change: 0 additions & 1 deletion docs/guides/base64.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

## Encoding
Using `#!cpp crow::utility::base64encode(mystring, mystring.size())` will return a Base64 encoded string. For URL safe Base64 `#!cpp crow::utility::base64encode_urlsafe(mystring, mystring.size())` can be used. The key used in the encoding process can be changed, it is a string containing all 64 characters to be used.

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/included-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ session.mutex().lock(); // manually lock session
Expiration can happen either by the cookie expiring or the store deleting "old" data.
* By default, cookies expire after 30 days. This can be changed with the cookie option in the Session constructor.
* By default, cookies expire after 30 days. This can be changed with the cookie option in the Session constructor.
* `crow::FileStore` automatically supports deleting files that are expired (older than 30 days). The expiration age can also be changed in the constructor.
The session expiration can be postponed. This will make the Session issue a new cookie and make the store acknowledge the new expiration time.
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ A `wvalue` can be treated as an object or even a list (setting a value by using
Additionally, a `wvalue` can be initialized as an object using an initializer list, an example object would be `wvalue x = {{"a", 1}, {"b", 2}}`. Or as a list using `wvalue x = json::wvalue::list({1, 2, 3})`, lists can include any type that `wvalue` supports.<br><br>

An object type `wvalue` uses `std::unordered_map` by default, if you want to have your returned `wvalue` key value pairs be sorted (using `std::map`) you can add `#!cpp #define CROW_JSON_USE_MAP` to the top of your program.<br><br>

A JSON `wvalue` can be returned directly inside a route handler, this will cause the `content-type` header to automatically be set to `Application/json` and the JSON value will be converted to string and placed in the response body. For more information go to [Routes](routes.md).<br><br>

For more info on write values go [here](../reference/classcrow_1_1json_1_1wvalue.html).
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Any middleware requires the following 3 members:
* A `before_handle` method, which is called before the handler.
* A `after_handle` method, which is called after the handler.

!!! warning
!!! warning

As soon as `response.end()` is called, no other handlers and middleware is run, except for after_handlers of already visited middleware.

Expand Down Expand Up @@ -57,7 +57,7 @@ There are two possible signatures for before_handle and after_handle

``` cpp
template <typename AllContext>
void before_handle(request& req, response& res, context& ctx, AllContext& all_ctx)
void before_handle(request& req, response& res, context& ctx, AllContext& all_ctx)
{
auto other_ctx = all_ctx.template get<OtherMiddleware>();
}
Expand All @@ -68,7 +68,7 @@ There are two possible signatures for before_handle and after_handle
By default, every middleware is called for each request. If you want to enable middleware for specific handlers or blueprints, you have to extend it from `crow::ILocalMiddleware`

```cpp
struct LocalMiddleware : crow::ILocalMiddleware
struct LocalMiddleware : crow::ILocalMiddleware
{
```
Expand All @@ -90,6 +90,6 @@ bp.CROW_MIDDLEWARES(app, FistLocalMiddleware, SecondLocalMiddleware);
```
!!! warning
Local and global middleware are called separately. First all global middleware is run, then all enabled local middleware for the current handler is run. In both cases middleware is called strongly
in the order listed in the Crow application.
3 changes: 0 additions & 3 deletions docs/guides/proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ ProxyPassReverse / http://localhost:40080
If you want crow to run in a subdirectory (such as `domain.abc/crow`) you can use the `location` tag:
```
<Location "/crow">
ProxyPass http://localhost:40080
ProxyPassReverse http://localhost:40080
</Location>
```

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Please note that in order to return a response defined as a parameter you'll nee
Alternatively, you can define the response in the body and return it (`#!cpp ([](){return crow::response()})`).<br>
For more information on `crow::response` go [here](../reference/structcrow_1_1response.html).<br><br>
Crow defines the following status codes:
```
100 Continue
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/ssl.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Crow supports HTTPS though SSL or TLS.<br><br>
When mentioning SSL in this documentation, it is often a reference to openSSL, which includes TLS.<br><br>


To enable SSL, first your application needs to define either a `.crt` and `.key` files, or a `.pem` file.
To enable SSL, first your application needs to define either a `.crt` and `.key` files, or a `.pem` file.
Once you have your files, you can add them to your app like this:<br>
`#!cpp app.ssl_file("/path/to/cert.crt", "/path/to/keyfile.key")` or `#!cpp app.ssl_file("/path/to/pem_file.pem")`. Please note that this method can be part of the app method chain, which means it can be followed by `.run()` or any other method.<br><br>

Expand Down

0 comments on commit dfbce12

Please sign in to comment.