From bf6ac4d9d42aa59019777ea90437cf964dd824f9 Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Fri, 22 Oct 2021 21:44:25 +0200 Subject: [PATCH] docs: base dev server [skip ci] --- .gitignore | 2 +- Makefile | 4 ++++ docs/assets/rust_logo.svg | 10 ++++++++++ docs/index.md | 30 ++++++++++++++++++++++++++++++ mkdocs.yml | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 docs/assets/rust_logo.svg create mode 100644 docs/index.md create mode 100644 mkdocs.yml diff --git a/.gitignore b/.gitignore index 3da0fa4..5686bbd 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ **/*.gz **/.DS_Store **/*.env -**/*.svg **/*.data* **/*.zst **/*.out* @@ -23,3 +22,4 @@ release TODO !sample.env +!/docs diff --git a/Makefile b/Makefile index ce391b1..f1df13f 100644 --- a/Makefile +++ b/Makefile @@ -249,6 +249,10 @@ prod.release.version: git push .ONESHELL: prod.release.version +docs-dev: + @docker run --rm -it -p 8088:8000 -v $(PWD):/docs squidfunk/mkdocs-material +.PHONY: docs-dev + promote: @drone build promote joseluisq/static-web-server $(BUILD) $(ENV) .PHONY: promote diff --git a/docs/assets/rust_logo.svg b/docs/assets/rust_logo.svg new file mode 100644 index 0000000..281d2c4 --- /dev/null +++ b/docs/assets/rust_logo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..5615259 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,30 @@ +# Welcome to MkDocs + +For full documentation visit [mkdocs.org](https://www.mkdocs.org). + +## Commands + +* `mkdocs new [dir-name]` - Create a new project. +* `mkdocs serve` - Start the live-reloading docs server. +* `mkdocs build` - Build the documentation site. +* `mkdocs -h` - Print help message and exit. + +## Project layout + +```rust +#![deny(warnings)] +#![deny(rust_2018_idioms)] + +#[cfg(all(target_env = "musl", target_pointer_width = "64"))] +#[global_allocator] +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + +use static_web_server::{Result, Server}; + +fn main() -> Result { + Server::new().run()?; + + Ok(()) +} + +``` diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..6a61f5f --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,70 @@ +# Project information +site_name: Static Web Server +site_description: 'A blazing fast and asynchronous web server for static files-serving ⚡' +site_author: 'Jose Quintana' +site_url: https://joseluisq.github.io/static-web-server/ + +# Repository +repo_name: joseluisq/static-web-server +repo_url: https://github.com/joseluisq/static-web-server/ +edit_uri: "" + +# Copyright +copyright: Copyright © 2019-2021 Jose Quintana + +# Theme +theme: + name: 'material' + logo: assets/rust_logo.svg + palette: + - scheme: default + primary: black + accent: indigo + toggle: + icon: material/toggle-switch-off-outline + name: Switch to dark mode + - scheme: slate + primary: black + accent: grey + toggle: + icon: material/toggle-switch + name: Switch to light mode + font: + text: 'Fira Sans' + code: 'Droid Sans Mono' + favicon: https://camo.githubusercontent.com/a08032a2db94aea229991af8f73c45cc95174c8066dc7a6b1f88a79c94cf1093/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f642f64352f527573745f70726f6772616d6d696e675f6c616e67756167655f626c61636b5f6c6f676f2e7376672f3130323470782d527573745f70726f6772616d6d696e675f6c616e67756167655f626c61636b5f6c6f676f2e7376672e706e67 + +extra: + social: + - icon: 'fontawesome/brands/github' + link: 'https://github.com/joseluisq' + - icon: 'fontawesome/brands/twitter' + link: 'https://twitter.com/joseluis_q' + +markdown_extensions: + - codehilite + - admonition + - meta + - toc: + permalink: true + - markdown.extensions.tables + - pymdownx.arithmatex + - pymdownx.betterem + - pymdownx.caret + - pymdownx.critic + - pymdownx.details + - pymdownx.emoji: + emoji_generator: !!python/name:pymdownx.emoji.to_svg + - pymdownx.magiclink: + repo_url_shortener: true + repo_url_shorthand: true + provider: "github" + user: "facelessuser" + repo: "pymdown-extensions" + - pymdownx.tilde + - pymdownx.emoji + - pymdownx.superfences + - pymdownx.inlinehilite + - pymdownx.mark + - pymdownx.smartsymbols + - pymdownx.tasklist -- libgit2 1.7.2