Struct kanorg::KanOrgBoard[][src]

pub struct KanOrgBoard { /* fields omitted */ }

Kanban organization workflows.

This utility will allow you create tasks, move them from one workspace to another, edit and delete them.

Implementations

impl KanOrgBoard[src]

pub fn new(current_working_dir: &PathBuf) -> Result<Self>[src]

Creates a new instance of KanOrgBoard loading a configuration file.

The config file is searched in the current directory or the default user folder. Checkout KanOrgBoard::search_config_file() to know more about how it is searched. Once the config file is located, it is read and the instance attributes populated. The module toml will be used to deserialize the file contents. Check the [Workflows] struct to know more about the config file format.

pub fn create(target_dir: &str) -> Result<()>[src]

Creates the base configuration in the chosen directory.

This function will create the following structure:

.kanorg.d/
|-- active.d
|-- archive.d
`-- config

Being:

  • .kanorg.d - the base directory where the configuration and tasks are contained.

  • .kanorg.d/config - configuration file. The file will have the contents:

    backlog = [<task1>, <task2>, ..., <taskn>]
    todo = [<task1>, <task2>, ..., <taskn>]
    doing = [<task1>, <task2>, ..., <taskn>]
    done = [<task1>, <task2>, ..., <taskn>]
    last_task = <last task ID>
    
  • .kanorg.d/active.d - directory in where the active task files (the ones found in backlog, todo, doing or done) are located.

  • .kanorg.d/archive.d - in this other directory, the popped task files from the done workflow will be found.

Arguments:

  • target_dir - the target thir you want to create the base configuration. If no target path is specified, the current directory will be used.

pub fn show<W: Write>(
    &self,
    workflow_name: Option<&str>,
    writer: &mut W
) -> Result<()>
[src]

Provides an organized view of the current tasks.

This method will print the three main workflows (todo, doing and done) in a table style output. Also after finishing the main tasks, the backlog will be printed alone with a maximun of 5 tasks.

This is an example output you can get:

|          TODO           |          DOING          |          DONE           |
|-------------------------|-------------------------|-------------------------|
|  15 Task fifteen title  |  13 Task thirteen title |  29 Esta es una mísera  |
|  12 Task twelve title   |  10 Task ten title      |  11 Task eleven title   |
|  14 Task fourteen title |                         |   9 Task nine title     |
|                         |                         |   6 Task six title      |
|                         |                         |   8 Task eight title    |

BACKLOG
  26 este es el nuevo titulo
  25 Task twenty-five title
  24 Task twnety-four title
  23 Task twenty-three title
  22 Task twenty-two title
WARNING: The backlog has been trimmed. Run `ko show backlog` to see all the backlog tasks.

The program will addapt to the terminal size and will print the columns in concordance.

Arguments:

  • workflow_name - name of the workflow to show. If this parameter is provided, the output will be similar to the previous backlog list:

    TODO
      15 Task fifteen title
      12 Task twelve title
      14 Task fourteen title
    

Example usage:

To show all the available workflows:

ko show

To show only one specific workflow:

ko show todo

pub fn add(&mut self, title: &str, workflow_name: Option<&str>) -> Result<()>[src]

Adds a new task to the choosen workflow.

This method will add a new task to the desired workflow. Moreover, a file will be created with the title as the first line. After the creation, the default editor will be used to edit the task description

Note that when adding a new task to the done workflow, if there are already 5 tasks, the oldest one will be phisically moved to the archive and removed from the mentioned workflow.

Arguments:

  • title - summary of the new task. It will be placed in the first line of the task file.

  • workflow_name - initial column to put the new task. If no workflow is specified, it will be placed in backlog (default workflow).

Errors:

  • If the workflow does not exist.

  • If the moving caused by the done workflow overflow have an error.

  • If an error ocurrs when opening or writing the new task file.

  • If an there is a problem saving the config changes.

Example usage:

To add a new task into the backlog introducing:

ko add "new task fancy title"

To add a new task to the workflow todo:

ko add "new task fancy title" todo

pub fn relocate(
    &mut self,
    task: &str,
    workflow_name: Option<&str>
) -> Result<()>
[src]

Moves a task from one it’s workspace to a new one.

When moving a task, the task and workflow are checked. If no workflow are passed, backlog would be used.

Arguments:

  • task - task string we want to move.

  • workflow_name - the target workflow.

Errors:

  • If the task is not a number.

  • If the task could not be found in any active workflow.

  • If there was a problem moving the task.

  • If there was a problem saving the settings.

pub fn edit(&self, task: &str) -> Result<()>[src]

Edits a task form any active workflow.

Arguments:

  • task - task string we want to move.

Errors:

  • If the task is not a number.

  • If the task could not be found in any active workflow.

  • If there was a problem editing the task.

pub fn delete(&mut self, task: &str) -> Result<()>[src]

Deletes a task from one active directory.

Arguments:

  • task - task string we want to move.

Errors:

  • If the task is not a number.

  • If the task could not be found in any active workflow.

  • If there was a problem moving the task.

  • If there was a problem saving the settings.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.