summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTiffany Le-Nguyen <letiffany.nguyen@gmail.com>2019-07-19 16:18:52 -0400
committerMatan Kushner <hello@matchai.me>2019-07-19 16:18:52 -0400
commit08cf33522af2dde17de6645ce2015fa4e87a6a68 (patch)
tree0330aab2abf5ee9d22e28ac5179838b6bbc9a7b2 /src
parent025c0e5e8530ee1f53d2a45cd1d1de437cc2e819 (diff)
docs: Add vuepress with initial docs (#99)
Co-authored-by: Tiffany Le-Nguyen <tlenguyen@expedia.com> Co-authored-by: Matan Kushner <hello@matchai.me>
Diffstat (limited to 'src')
-rw-r--r--src/modules/battery.rs8
-rw-r--r--src/modules/character.rs6
-rw-r--r--src/modules/directory.rs2
-rw-r--r--src/modules/git_branch.rs6
-rw-r--r--src/modules/git_status.rs6
-rw-r--r--src/modules/golang.rs (renamed from src/modules/go.rs)4
-rw-r--r--src/modules/line_break.rs2
-rw-r--r--src/modules/mod.rs4
-rw-r--r--src/modules/nodejs.rs2
-rw-r--r--src/modules/package.rs2
-rw-r--r--src/modules/python.rs4
-rw-r--r--src/modules/rust.rs2
-rw-r--r--src/modules/username.rs2
13 files changed, 25 insertions, 25 deletions
diff --git a/src/modules/battery.rs b/src/modules/battery.rs
index 586153266..78ea1813d 100644
--- a/src/modules/battery.rs
+++ b/src/modules/battery.rs
@@ -2,7 +2,7 @@ use ansi_term::Color;
use super::{Context, Module};
-/// Creates a segment for the battery percentage and charging state
+/// Creates a module for the battery percentage and charging state
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
const BATTERY_FULL: &str = "•";
const BATTERY_CHARGING: &str = "⇡";
@@ -28,13 +28,13 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
match state {
battery::State::Full => {
- module.new_segment("full", BATTERY_FULL);
+ module.new_segment("full_symbol", BATTERY_FULL);
}
battery::State::Charging => {
- module.new_segment("charging", BATTERY_CHARGING);
+ module.new_segment("charging_symbol", BATTERY_CHARGING);
}
battery::State::Discharging => {
- module.new_segment("discharging", BATTERY_DISCHARGING);
+ module.new_segment("discharging_symbol", BATTERY_DISCHARGING);
}
_ => return None,
}
diff --git a/src/modules/character.rs b/src/modules/character.rs
index 447fd759e..6d6a4a1e1 100644
--- a/src/modules/character.rs
+++ b/src/modules/character.rs
@@ -1,9 +1,9 @@
use super::{Context, Module};
use ansi_term::Color;
-/// Creates a segment for the prompt character
+/// Creates a module for the prompt character
///
-/// The char segment prints an arrow character in a color dependant on the exit-
+/// The character segment prints an arrow character in a color dependant on the exit-
/// code of the last executed command:
/// - If the exit-code was "0", the arrow will be formatted with `COLOR_SUCCESS`
/// (green by default)
@@ -14,7 +14,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let color_success = Color::Green.bold();
let color_failure = Color::Red.bold();
- let mut module = context.new_module("char")?;
+ let mut module = context.new_module("character")?;
module.get_prefix().set_value("");
let symbol = module.new_segment("symbol", PROMPT_CHAR);
diff --git a/src/modules/directory.rs b/src/modules/directory.rs
index 793551591..bd9d8333b 100644
--- a/src/modules/directory.rs
+++ b/src/modules/directory.rs
@@ -3,7 +3,7 @@ use std::path::Path;
use super::{Context, Module};
-/// Creates a segment with the current directory
+/// Creates a module with the current directory
///
/// Will perform path contraction and truncation.
/// **Contraction**
diff --git a/src/modules/git_branch.rs b/src/modules/git_branch.rs
index 06aa6320d..fc5601c51 100644
--- a/src/modules/git_branch.rs
+++ b/src/modules/git_branch.rs
@@ -2,7 +2,7 @@ use ansi_term::Color;
use super::{Context, Module};
-/// Creates a segment with the Git branch in the current directory
+/// Creates a module with the Git branch in the current directory
///
/// Will display the branch name if the current directory is a git repo
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
@@ -15,8 +15,8 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
module.set_style(segment_color);
module.get_prefix().set_value("on ");
- module.new_segment("branch_char", GIT_BRANCH_CHAR);
- module.new_segment("branch_name", branch_name);
+ module.new_segment("symbol", GIT_BRANCH_CHAR);
+ module.new_segment("name", branch_name);
Some(module)
}
diff --git a/src/modules/git_status.rs b/src/modules/git_status.rs
index c5ec57e4d..912ce7d07 100644
--- a/src/modules/git_status.rs
+++ b/src/modules/git_status.rs
@@ -3,16 +3,16 @@ use git2::{Repository, Status};
use super::{Context, Module};
-/// Creates a segment with the Git branch in the current directory
+/// Creates a module with the Git branch in the current directory
///
/// Will display the branch name if the current directory is a git repo
/// By default, the following symbols will be used to represent the repo's status:
/// - `=` – This branch has merge conflicts
/// - `⇡` – This branch is ahead of the branch being tracked
-/// - `⇡` – This branch is behind of the branch being tracked
+/// - `⇣` – This branch is behind of the branch being tracked
/// - `⇕` – This branch has diverged from the branch being tracked
/// - `?` — There are untracked files in the working directory
-/// - `$` — A stash exists for the repository
+/// - `$` — A stash exists for the local repository
/// - `!` — There are file modifications in the working directory
/// - `+` — A new file has been added to the staging area
/// - `»` — A renamed file has been added to the staging area
diff --git a/src/modules/go.rs b/src/modules/golang.rs
index a50356d50..881c30150 100644
--- a/src/modules/go.rs
+++ b/src/modules/golang.rs
@@ -3,7 +3,7 @@ use std::process::Command;
use super::{Context, Module};
-/// Creates a segment with the current Go version
+/// Creates a module with the current Go version
///
/// Will display the Go version if any of the following criteria are met:
/// - Current directory contains a `go.mod` file
@@ -11,8 +11,8 @@ use super::{Context, Module};
/// - Current directory contains a `glide.yaml` file
/// - Current directory contains a `Gopkg.yml` file
/// - Current directory contains a `Gopkg.lock` file
-/// - Current directory contains a `.go` file
/// - Current directory contains a `Godeps` directory
+/// - Current directory contains a file with the `.go` extension
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let is_go_project = context
.new_scan_dir()
diff --git a/src/modules/line_break.rs b/src/modules/line_break.rs
index b86f85e38..5cbe3a1a9 100644
--- a/src/modules/line_break.rs
+++ b/src/modules/line_break.rs
@@ -1,6 +1,6 @@
use super::{Context, Module};
-/// Creates a segment for the line break
+/// Creates a module for the line break
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
const LINE_ENDING: &str = "\n";
diff --git a/src/modules/mod.rs b/src/modules/mod.rs
index 30a459ef1..ffa21a81f 100644
--- a/src/modules/mod.rs
+++ b/src/modules/mod.rs
@@ -3,7 +3,7 @@ mod character;
mod directory;
mod git_branch;
mod git_status;
-mod go;
+mod golang;
mod line_break;
mod nodejs;
mod package;
@@ -21,7 +21,7 @@ pub fn handle<'a>(module: &str, context: &'a Context) -> Option<Module<'a>> {
"node" | "nodejs" => nodejs::module(context),
"rust" | "rustlang" => rust::module(context),
"python" => python::module(context),
- "go" | "golang" => go::module(context),
+ "go" | "golang" => golang::module(context),
"line_break" => line_break::module(context),
"package" => package::module(context),
"git_branch" => git_branch::module(context),
diff --git a/src/modules/nodejs.rs b/src/modules/nodejs.rs
index 9aa5a4376..eddbc5a7e 100644
--- a/src/modules/nodejs.rs
+++ b/src/modules/nodejs.rs
@@ -3,7 +3,7 @@ use std::process::Command;
use super::{Context, Module};
-/// Creates a segment with the current Node.js version
+/// Creates a module with the current Node.js version
///
/// Will display the Node.js version if any of the following criteria are met:
/// - Current directory contains a `.js` file
diff --git a/src/modules/package.rs b/src/modules/package.rs
index 03d2b6d53..2912f2c02 100644
--- a/src/modules/package.rs
+++ b/src/modules/package.rs
@@ -5,7 +5,7 @@ use ansi_term::Color;
use serde_json as json;
use toml;
-/// Creates a segment with the current package version
+/// Creates a module with the current package version
///
/// Will display if a version is defined for your Node.js or Rust project (if one exists)
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
diff --git a/src/modules/python.rs b/src/modules/python.rs
index dbee151c8..740928a41 100644
--- a/src/modules/python.rs
+++ b/src/modules/python.rs
@@ -3,13 +3,13 @@ use std::process::Command;
use super::{Context, Module};
-/// Creates a segment with the current Python version
+/// Creates a module with the current Python version
///
/// Will display the Python version if any of the following criteria are met:
-/// - Current directory contains a `.py` file
/// - Current directory contains a `.python-version` file
/// - Current directory contains a `requirements.txt` file
/// - Current directory contains a `pyproject.toml` file
+/// - Current directory contains a file with the `.py` extension
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let is_py_project = context
.new_scan_dir()
diff --git a/src/modules/rust.rs b/src/modules/rust.rs
index ccb007a02..c94a34d8b 100644
--- a/src/modules/rust.rs
+++ b/src/modules/rust.rs
@@ -3,7 +3,7 @@ use std::process::Command;
use super::{Context, Module};
-/// Creates a segment with the current Rust version
+/// Creates a module with the current Rust version
///
/// Will display the Rust version if any of the following criteria are met:
/// - Current directory contains a file with a `.rs` extension
diff --git a/src/modules/username.rs b/src/modules/username.rs
index 745823fcb..5b59a24be 100644
--- a/src/modules/username.rs
+++ b/src/modules/username.rs
@@ -4,7 +4,7 @@ use std::process::Command;
use super::{Context, Module};
-/// Creates a segment with the current user's username
+/// Creates a module with the current user's username
///
/// Will display the usename if any of the following criteria are met:
/// - The current user isn't the same as the one that is logged in ($LOGNAME != $USER)