Skip to content

Commit

Permalink
docs: 📝 added crate documentation for perseus-cli and fixed doc typos
Browse files Browse the repository at this point in the history
Also changed CLI library name from `lib` to `perseus_cli`.
  • Loading branch information
arctic-hen7 committed Sep 3, 2021
1 parent f5036e7 commit b3ec9ac
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/perseus-actix-web/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Perseus is a blazingly fast frontend web development framework built in Rust with support for major rendering strategies,
* reactivity without a virtual DOM, and extreme customizability. It wraps the lower-level capabilities of[Sycamore](https://github.com/sycamore-rs/sycamore)
* reactivity without a virtual DOM, and extreme customizability. It wraps the lower-level capabilities of [Sycamore](https://github.com/sycamore-rs/sycamore)
* and provides a NextJS-like API!
*
* - ✨ Supports static generation (serving only static resources)
Expand All @@ -11,7 +11,7 @@
* - ✨ CLI harness that lets you build apps with ease and confidence
*
* This is the documentation for the Perseus Actix Web integration, but there's also [a CLI](https://arctic-hen7.github.io/perseus/cli.html),
* [the core package](https://crates.io/crates/perseus), and other integrations [integrations](https://arctic-hen7.github.io/perseus/serving.html)
* [the core package](https://crates.io/crates/perseus), and other [integrations](https://arctic-hen7.github.io/perseus/serving.html)
* to make serving apps on other platforms easier!
*
* # Resources
Expand Down
4 changes: 2 additions & 2 deletions packages/perseus-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = ["arctic_hen7 <arctic_hen7@pm.me>"]
license = "MIT"
repository = "https://github.com/arctic-hen7/perseus"
homepage = "https://arctic-hen7.github.io/perseus"
readme = "../../README.md"
readme = "./README.md"
keywords = ["wasm", "cli", "webdev", "ssg", "ssr"]
categories = ["wasm", "development-tools", "asynchronous", "gui", "command-line-utilities"]
include = [
Expand All @@ -28,7 +28,7 @@ serde = "1"
serde_json = "1"

[lib]
name = "lib"
name = "perseus_cli"

[[bin]]
name = "perseus"
Expand Down
11 changes: 11 additions & 0 deletions packages/perseus-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Perseus CLI

This is the official [Perseus](https://github.com/arctic-hen7/perseus) CLI for making building and sevring apps significantly easier! You can install it like so:

```
cargo install perseus-cli
```

And you'll then have an executable called `perseus` on your system!

If you're new to Perseus, you should check out [the core package](https://github.com/arctic-hen7/perseus) first.
4 changes: 2 additions & 2 deletions packages/perseus-cli/src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use lib::errors::*;
use lib::{build, check_env, delete_bad_dir, help, prepare, serve, PERSEUS_VERSION};
use perseus_cli::errors::*;
use perseus_cli::{build, check_env, delete_bad_dir, help, prepare, serve, PERSEUS_VERSION};
use std::env;
use std::io::Write;
use std::path::PathBuf;
Expand Down
1 change: 1 addition & 0 deletions packages/perseus-cli/src/help.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::PERSEUS_VERSION;

/// Prints the help page.
pub fn help(output: &mut impl std::io::Write) {
writeln!(
output,
Expand Down
30 changes: 30 additions & 0 deletions packages/perseus-cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
/*!
* Perseus is a blazingly fast frontend web development framework built in Rust with support for major rendering strategies,
* reactivity without a virtual DOM, and extreme customizability. It wraps the lower-level capabilities of[Sycamore](https://github.com/sycamore-rs/sycamore)
* and provides a NextJS-like API!
*
* - ✨ Supports static generation (serving only static resources)
* - ✨ Supports server-side rendering (serving dynamic resources)
* - ✨ Supports revalidation after time and/or with custom logic (updating rendered pages)
* - ✨ Supports incremental regeneration (build on demand)
* - ✨ Open build matrix (use any rendering strategy with anything else, mostly)
* - ✨ CLI harness that lets you build apps with ease and confidence
*
* This is the documentation for the Perseus CLI, but there's also [the core package](https://crates.io/crates/perseus) and [integrations](https://arctic-hen7.github.io/perseus/serving.html)
* to make serving apps on other platforms easier!
*
* # Resources
*
* These docs will help you as a reference, but [the book](https://arctic-hen7.github.io/perseus/cli.html) should
* be your first port of call for learning about how to use Perseus and how it works.
*
* - [The Book](https://arctic-hen7.github.io/perseus)
* - [GitHub repository](https://github.com/arctic-hen7/perseus)
* - [Crate page](https://crates.io/crates/perseus)
* - [Gitter chat](https://gitter.im/perseus-framework/community)
* - [Discord server channel](https://discord.com/channels/820400041332179004/883168134331256892) (for Sycamore-related stuff)
*/

#![deny(missing_docs)]

mod build;
mod cmd;
pub mod errors;
Expand All @@ -11,6 +40,7 @@ use errors::*;
use std::fs;
use std::path::PathBuf;

/// The current version of the CLI, extracted from the crate version.
pub const PERSEUS_VERSION: &str = env!("CARGO_PKG_VERSION");
pub use build::build;
pub use help::help;
Expand Down
2 changes: 1 addition & 1 deletion packages/perseus/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Perseus is a blazingly fast frontend web development framework built in Rust with support for major rendering strategies,
* reactivity without a virtual DOM, and extreme customizability. It wraps the lower-level capabilities of[Sycamore](https://github.com/sycamore-rs/sycamore)
* reactivity without a virtual DOM, and extreme customizability. It wraps the lower-level capabilities of [Sycamore](https://github.com/sycamore-rs/sycamore)
* and provides a NextJS-like API!
*
* - ✨ Supports static generation (serving only static resources)
Expand Down

0 comments on commit b3ec9ac

Please sign in to comment.