diff --git a/docs/getting_started/a_simple_webpage.md b/docs/getting_started/a_simple_webpage.md index e0839f37f..5c017f7a5 100644 --- a/docs/getting_started/a_simple_webpage.md +++ b/docs/getting_started/a_simple_webpage.md @@ -1,7 +1,7 @@ Hello World is a good start, but what if you want something a bit more fancy.. Something like an HTML document saying "Hello World". If that's what you want, follow along: ## Basic Webpage -Let's start our webpage with.. well.. a webpage. But before we create a webpage we need to place it somewhere Crow recognizes, for now this directory is going to be called `templates`, but we can [change it later](../../guides/templating/#page). +Let's start our webpage with.. well.. a webpage. But before we create a webpage we need to place it somewhere Crow recognizes, for now this directory is going to be called `templates`, but we can [change it later](../guides/templating.md#page). Once our `templates` folder is created, we can create our HTML document inside it, let's call it `fancypage.html`. @@ -80,13 +80,17 @@ Once the code is done compiling, if we call `http://localhost:18080/` we get our !!! note - Compilation instructions are available for [Linux](../setup/linux#compiling-your-project), [MacOS](../setup/macos#compiling-using-a-compiler-directly), and [Windows](../setup/windows#getting-and-compiling-crow) + 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) ## Template Webpage with a variable But we can make things even more exciting, we can greet a user by their name instead!! -Let's start with our webpage, and modify it with a little bit of [mustache](../../guides/templating) syntax: +Let's start with our webpage, and modify it with a little bit of [mustache](../guides/templating.md) syntax: ``` html title="templates/fancypage.html" hl_lines="4" @@ -121,9 +125,9 @@ int main() 1. We are adding a `string` variable to the URL and a counterpart (`std::string name`) to our route - this can be anything the user wants. 2. We are using `load()` instead of `load_text()` since we have an actual variable now. -3. We are creating a new [context](../../guides/templating/#context) containing the `person` variable from our template and the `name` we got from the URL. +3. We are creating a new [context](../guides/templating.md#context) containing the `person` variable from our template and the `name` we got from the URL. 4. We are using `render(ctx)` to apply our context to the template. Now (after compiling the code and running the executable a second time) calling `http://localhost:18080/Bob` should return a webpage containing "Hello Bob!". **We did it!** -For more details on templates and HTML pages in Crow please go [here](../../guides/templating/) +For more details on templates and HTML pages in Crow please go [here](../guides/templating.md) diff --git a/docs/getting_started/your_first_application.md b/docs/getting_started/your_first_application.md index 6292773a3..41c9a455c 100644 --- a/docs/getting_started/your_first_application.md +++ b/docs/getting_started/your_first_application.md @@ -16,7 +16,7 @@ int main() } ``` The App (or SimpleApp) class organizes all the different parts of Crow and provides the developer (you) a simple interface to interact with these parts. -For more information, please go [here](../../guides/app). +For more information, please go [here](../guides/app.md). ## 3. Adding routes Once you have your app, the next step is to add routes (or endpoints). You can do so with the `CROW_ROUTE` macro. @@ -25,7 +25,7 @@ CROW_ROUTE(app, "/")([](){ return "Hello world"; }); ``` -For more details on routes, please go [here](../../guides/routes). +For more details on routes, please go [here](../guides/routes.md). ## 4. Running the app Once you're happy with how you defined all your routes, you're going to want to instruct Crow to run your app. This is done using the `run()` method. @@ -56,6 +56,9 @@ int main() } ``` -You then need to compile your code on your [Linux](../setup/linux#compiling-your-project), [MacOS](../setup/macos#compiling-using-a-compiler-directly), or [Windows](../setup/windows#getting-and-compiling-crow) machine +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. diff --git a/docs/guides/app.md b/docs/guides/app.md index 8009abf45..bbfd0d49f 100644 --- a/docs/guides/app.md +++ b/docs/guides/app.md @@ -34,5 +34,5 @@ app.bindaddr("192.168.1.2")

-For more info on middlewares, check out [this page](../middleware).

+For more info on middlewares, check out [this page](middleware.md).

For more info on what functions are available to a Crow app, go [here](../reference/classcrow_1_1_crow.html). diff --git a/docs/guides/included-middleware.md b/docs/guides/included-middleware.md index 5fa060094..1dd1bce2c 100644 --- a/docs/guides/included-middleware.md +++ b/docs/guides/included-middleware.md @@ -1,6 +1,6 @@ Crow contains some middlewares that are ready to be used in your application.
-Make sure you understand how to enable and use [middleware](../middleware/). +Make sure you understand how to enable and use [middleware](middleware.md). ## Sessions Include: `crow/middlewares/session.h`
diff --git a/docs/guides/json.md b/docs/guides/json.md index 02444e89f..a0be3a1be 100644 --- a/docs/guides/json.md +++ b/docs/guides/json.md @@ -41,7 +41,7 @@ Additionally, a `wvalue` can be initialized as an object using an initializer li 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.

-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).

+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).

For more info on write values go [here](../reference/classcrow_1_1json_1_1wvalue.html). diff --git a/docs/guides/templating.md b/docs/guides/templating.md index 647c363c6..15b3cac1b 100644 --- a/docs/guides/templating.md +++ b/docs/guides/templating.md @@ -16,12 +16,12 @@ There are 2 components of a mustache template implementation: ### Page The HTML page (including the mustache tags). It is usually loaded into `crow::mustache::template_t`. It needs to be placed in the *templates directory* which should be directly inside the current working directory of the crow executable.

-The templates directory is usually called `templates`, but can be adjusted per Route (via `crow::mustache::set_base("new_templates_directory")`), per [Blueprint](../blueprints), or globally (via `crow::mustache::set_global_base("new_templates_directory"")`).

+The templates directory is usually called `templates`, but can be adjusted per Route (via `crow::mustache::set_base("new_templates_directory")`), per [Blueprint](blueprints.md), or globally (via `crow::mustache::set_global_base("new_templates_directory"")`).

For more information on how to formulate a template, see [this mustache manual](http://mustache.github.io/mustache.5.html). ### Context -A JSON object containing the tags as keys and their values. `crow::mustache::context` is actually a [crow::json::wvalue](../json#wvalue).

+A JSON object containing the tags as keys and their values. `crow::mustache::context` is actually a [crow::json::wvalue](json.md#wvalue).

!!! note diff --git a/mkdocs.yml b/mkdocs.yml index 2755c3348..1fcdf02a1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -43,8 +43,8 @@ markdown_extensions: - pymdownx.keys - attr_list - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg nav: