diff --git a/docs/guides/base64.md b/docs/guides/base64.md index 88cde715a..eddf94b08 100644 --- a/docs/guides/base64.md +++ b/docs/guides/base64.md @@ -3,6 +3,7 @@ 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. ## Decoding -**Introduced in: `v1.0`**

+[:octicons-feed-tag-16: v1.0](https://github.com/CrowCpp/Crow/releases/v1.0) + Using `#!cpp crow::utility::base64decode(mystring, mystring.size())` with `mystring` being a Base64 encoded string will return a plain-text string. The function works with both normal and URL safe Base64. However it cannot decode a Base64 string encoded with a custom key. diff --git a/docs/guides/blueprints.md b/docs/guides/blueprints.md index 92b64874b..18c8fc71c 100644 --- a/docs/guides/blueprints.md +++ b/docs/guides/blueprints.md @@ -1,5 +1,6 @@ -**Introduced in: `v1.0`**

- +[:octicons-feed-tag-16: v1.0](https://github.com/CrowCpp/Crow/releases/v1.0) + + Crow supports flask style blueprints.
A blueprint is a limited app. It cannot handle networking. But it can handle routes.
Blueprints allow developers to compartmentalize their Crow applications, making them a lot more modular.

diff --git a/docs/guides/compression.md b/docs/guides/compression.md index abbe10d90..c56fb75e6 100644 --- a/docs/guides/compression.md +++ b/docs/guides/compression.md @@ -1,4 +1,6 @@ -**Introduced in: `v0.3`**

+[:octicons-feed-tag-16: v0.3](https://github.com/CrowCpp/Crow/releases/v0.3) + + Crow supports Zlib compression using Gzip or Deflate algorithms. ## HTTP Compression diff --git a/docs/guides/logging.md b/docs/guides/logging.md index c718c88b0..3f20688e8 100644 --- a/docs/guides/logging.md +++ b/docs/guides/logging.md @@ -31,7 +31,8 @@ Writing a log is as simple as `#!cpp CROW_LOG_ << "Hello";` (replace& Log times are reported in GMT timezone by default. This is because HTTP requires all reported times for requests and responses to be in GMT. This can be changed by using the macro `CROW_USE_LOCALTIMEZONE` which will set **only the log timezone** to the server's local timezone. ## Creating A custom logger -**Introduced in: `v1.0`**

+[:octicons-feed-tag-16: v1.0](https://github.com/CrowCpp/Crow/releases/v1.0) + Assuming you have an existing logger or Crow's default format just doesn't work for you. Crow allows you to use a custom logger for any log made using the `CROW_LOG_` macro.
All you need is a class extending `#!cpp crow::ILogHandler` containing the method `#!cpp void log(std::string, crow::LogLevel)`.
diff --git a/docs/guides/multipart.md b/docs/guides/multipart.md index a98026282..ebc32b853 100644 --- a/docs/guides/multipart.md +++ b/docs/guides/multipart.md @@ -1,4 +1,5 @@ -**Introduced in: `v0.2`**

+[:octicons-feed-tag-16: v0.2](https://github.com/CrowCpp/Crow/releases/0.2) + Multipart is a way of forming HTTP requests or responses to contain multiple distinct parts.
@@ -21,7 +22,8 @@ A message can be created either by defining the headers, boundary, and individua Once a multipart message has been made, the individual parts can be accessed throughout `msg.parts`, `parts` is an `std::vector`.

-**Introduced in: `v1.0`**

+[:octicons-feed-tag-16: v1.0](https://github.com/CrowCpp/Crow/releases/v1.0) + Part headers are organized in a similar way to request and response headers, and can be retrieved via `crow::multipart::get_header_object("header-key")`. This function returns a `crow::multipart::header` object.

diff --git a/docs/guides/query-string.md b/docs/guides/query-string.md index ffbdb350e..9b9e2cb82 100644 --- a/docs/guides/query-string.md +++ b/docs/guides/query-string.md @@ -5,7 +5,9 @@ Crow supports query strings through `crow::request::url_params`. The object is o ## get(name) Returns the value (as char*) based on the given key (or name). Returns `nullptr` if the key is not found. ## pop(name) -**Introduced in: `v0.3`**

+[:octicons-feed-tag-16: v0.3](https://github.com/CrowCpp/Crow/releases/v0.3) + + Works the same as `get`, but removes the returned value. !!! note @@ -16,13 +18,17 @@ A URL can be `http://example.com?key[]=value1&key[]=value2&key[]=value3`. Using `#!cpp get_list("key", false)` can be used to parse `http://example.com?key=value1&key=value2&key=value3` ## pop_list(name) -**Introduced in: `v0.3`**

+[:octicons-feed-tag-16: v0.3](https://github.com/CrowCpp/Crow/releases/v0.3) + + Works the same as `get_list` but removes all instances of values having the given key (`use_brackets` is also available here). ## get_dict(name) Returns an `std::unordered_map` from a query string such as `?key[sub_key1]=value1&key[sub_key2]=value2&key[sub_key3]=value3`.
The key in the map is what's in the brackets (`sub_key1` for example), and the value being what's after the `=` sign (`value1`). The name passed to the function is not part of the returned value. ## pop_dict(name) -**Introduced in: `v0.3`**

+[:octicons-feed-tag-16: v0.3](https://github.com/CrowCpp/Crow/releases/v0.3) + + Works the same as `get_dict` but removing the values from the query string. !!! warning diff --git a/docs/guides/routes.md b/docs/guides/routes.md index 10390ed9c..d3d22481a 100644 --- a/docs/guides/routes.md +++ b/docs/guides/routes.md @@ -52,7 +52,9 @@ The main return type is `std::string`, although you could also return a `crow::j For more information on the specific constructors for a `crow::response` go [here](../../reference/structcrow_1_1response.html). ## Returning custom classes -**Introduced in: `v0.3`**

+[:octicons-feed-tag-16: v0.3](https://github.com/CrowCpp/Crow/releases/v0.3) + + If you have your own class you want to return (without converting it to string and returning that), you can use the `crow::returnable` class.
to use the returnable class, you only need your class to publicly extend `crow::returnable`, add a `dump()` method that returns your class as an `std::string`, and add a constructor that has a `Content-Type` header as a string argument.

@@ -75,12 +77,15 @@ class a : public crow::returnable

## Response codes -**Introduced in: `v1.0`**

+[:octicons-feed-tag-16: v1.0](https://github.com/CrowCpp/Crow/releases/v1.0) + Instead of assigning a response code, you can use the `crow::status` enum, for example you can replace `crow::response(200)` with `crow::response(crow::status::OK)` ## Catchall routes -**Introduced in: `v0.3`**

+[:octicons-feed-tag-16: v0.3](https://github.com/CrowCpp/Crow/releases/v0.3) + + By default, any request that Crow can't find a route for will return a simple 404 response. You can change that to return a default route using the `CROW_CATCHALL_ROUTE(app)` macro. Defining it is identical to a normal route, even when it comes to the `const crow::request&` and `crow::response&` parameters being optional. !!! note diff --git a/docs/guides/static.md b/docs/guides/static.md index 2393ffb86..3a0ebf48a 100644 --- a/docs/guides/static.md +++ b/docs/guides/static.md @@ -1,4 +1,6 @@ -**Introduced in: `v0.2`**

+[:octicons-feed-tag-16: v0.2](https://github.com/CrowCpp/Crow/releases/0.2) + + A static file is any file that resides in the server's storage. Crow supports returning Static files as responses in 2 ways. diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index bf771fb40..24f4925db 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -7,6 +7,37 @@ border-radius: 5px; } +.tag +{ + background-color: var(--md-primary-fg-color); + color: var(--md-default-bg-color); + border-radius: 50px; + padding-left: 0.15em; + padding-right: 0.35em; + padding-top: 0.45em; + padding-bottom: 0.35em; +} + +.tag a +{ + color: var(--md-default-bg-color); +} + +.tag a:hover +{ + color: var(--md-default-bg-color); +} + +.md-typeset :is(.emojione, .twemoji, .gemoji) +{ + vertical-align: text-bottom; +} + +.md-typeset :is(.emojione, .twemoji, .gemoji) svg +{ + width: 1.25em; +} + [data-md-color-scheme="crow-dark"] img[src$="#only-dark"] { display: block; diff --git a/mkdocs.yml b/mkdocs.yml index 09f78a88a..469dfb224 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,6 +40,11 @@ markdown_extensions: - pymdownx.superfences - pymdownx.inlinehilite - pymdownx.keys + - attr_list + - pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg + nav: - Home: index.md