diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index f5b700cd..78c5179d 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -2,7 +2,7 @@
Thank you for taking the time to contribute to Taskbook!
-For more info on how to contribute to the project, please read the [contributing guidelines](https://github.com/klauscfhq/taskbook/blob/master/contributing.md).
+For more info on how to contribute to the project, please read the [contributing guidelines](https://github.com/klaussinani/taskbook/blob/master/contributing.md).
We are always excited about pull requests!
diff --git a/cli.js b/cli.js
index 24b119b8..253e82f6 100755
--- a/cli.js
+++ b/cli.js
@@ -2,7 +2,7 @@
'use strict';
const meow = require('meow');
const updateNotifier = require('update-notifier');
-const help = require('./lib/help');
+const help = require('./src/help');
const pkg = require('./package.json');
const taskbook = require('.');
@@ -40,6 +40,10 @@ const cli = meow(help, {
type: 'boolean',
alias: 'c'
},
+ begin: {
+ type: 'boolean',
+ alias: 'b'
+ },
star: {
type: 'boolean',
alias: 's'
diff --git a/code-of-conduct.md b/code-of-conduct.md
index 980b7708..43c8ab2a 100644
--- a/code-of-conduct.md
+++ b/code-of-conduct.md
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported by contacting the project team at klauscfhq@protonmail.com. All
+reported by contacting the project team at klaussinani@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
diff --git a/contributing.md b/contributing.md
index 9d417880..077527f2 100644
--- a/contributing.md
+++ b/contributing.md
@@ -8,7 +8,7 @@ Please note that this project is released with a [Contributor Code of Conduct](c
### Improve documentation
-Typo corrections, error fixes, better explanations, more examples etc. Open an issue regarding anything that you think it could be improved! You can use the [`docs` label](https://github.com/klauscfhq/taskbook/labels/docs) to find out what others have suggested!
+Typo corrections, error fixes, better explanations, more examples etc. Open an issue regarding anything that you think it could be improved! You can use the [`docs` label](https://github.com/klaussinani/taskbook/labels/docs) to find out what others have suggested!
### Improve issues
@@ -18,36 +18,36 @@ Sometimes reported issues lack information, are not reproducible, or are even pl
We're always looking for more opinions on discussions in the issue tracker. It's a good opportunity to influence the future direction of the project.
-The [`question` label](https://github.com/klauscfhq/taskbook/labels/question) is a good place to find ongoing discussions.
+The [`question` label](https://github.com/klaussinani/taskbook/labels/question) is a good place to find ongoing discussions.
### Write code
You can use issue labels to discover issues you could help us out with!
-- [`feature request` issues](https://github.com/klauscfhq/taskbook/labels/feature%20request) are features we are open to including
-- [`bug` issues](https://github.com/klauscfhq/taskbook/labels/bug) are known bugs we would like to fix
-- [`future` issues](https://github.com/klauscfhq/taskbook/labels/future) are those that we'd like to get to, but not anytime soon. Please check before working on these since we may not yet want to take on the burden of supporting those features
-- on the [`help wanted`](https://github.com/klauscfhq/taskbook/labels/help%20wanted) label you can always find something exciting going on
+- [`feature request` issues](https://github.com/klaussinani/taskbook/labels/feature%20request) are features we are open to including
+- [`bug` issues](https://github.com/klaussinani/taskbook/labels/bug) are known bugs we would like to fix
+- [`future` issues](https://github.com/klaussinani/taskbook/labels/future) are those that we'd like to get to, but not anytime soon. Please check before working on these since we may not yet want to take on the burden of supporting those features
+- on the [`help wanted`](https://github.com/klaussinani/taskbook/labels/help%20wanted) label you can always find something exciting going on
-You may find an issue is assigned, or has the [`assigned` label](https://github.com/klauscfhq/taskbook/labels/assigned). Please double-check before starting on this issue because somebody else is likely already working on it
+You may find an issue is assigned, or has the [`assigned` label](https://github.com/klaussinani/taskbook/labels/assigned). Please double-check before starting on this issue because somebody else is likely already working on it
### Say hi
-Come over and say hi anytime you feel like on [Gitter](https://gitter.im/klauscfhq/taskbook).
+Come over and say hi anytime you feel like on [Gitter](https://gitter.im/klaussinani/taskbook).
### Translating Documentation
#### Create a Translation
-- Check the [`index`](https://github.com/klauscfhq/taskbook/tree/master/docs/readme.md) file to ensure that the document is not already translated in your target language.
+- Check the [`index`](https://github.com/klaussinani/taskbook/tree/master/docs/readme.md) file to ensure that the document is not already translated in your target language.
- Add the name of the language to the document as an extension, e.g: `readme.JP.md`
-- Place the translated document inside the [`docs`](https://github.com/klauscfhq/taskbook/tree/master/docs) directory.
-- Add your github profile and the translated document to the [`index`](https://github.com/klauscfhq/taskbook/tree/master/docs/readme.md) file.
+- Place the translated document inside the [`docs`](https://github.com/klaussinani/taskbook/tree/master/docs) directory.
+- Add your github profile and the translated document to the [`index`](https://github.com/klaussinani/taskbook/tree/master/docs/readme.md) file.
- Create a Pull Request including the language in the title, e.g: `Readme: Japanese Translation`
#### Improve a Translation
-- Include your github profile next to the translation you improved at the [`index`](https://github.com/klauscfhq/taskbook/tree/master/docs/readme.md) file.
+- Include your github profile next to the translation you improved at the [`index`](https://github.com/klaussinani/taskbook/tree/master/docs/readme.md) file.
- Create a Pull Request that delivers the improvements and include the language in the title, e.g: `Readme: Improvements for the Japanese Translation`
### Submitting an issue
diff --git a/docs/readme.FR.md b/docs/readme.FR.md
new file mode 100644
index 00000000..c8a398e4
--- /dev/null
+++ b/docs/readme.FR.md
@@ -0,0 +1,356 @@
+
+ Taskbook
+
+
+
+ 📓 Tâches, tableaux et notes utilisables dans un invité de commande.
+
+
+
+

+
+
+
+
+
+
+
+
+## Présentation
+
+En utilisant une syntaxe simple et minimaliste, rendant son apprentissage plus efficace, taskbook vous permet de gérer efficacement vos tâches et vos notes via plusieurs tableaux dans le terminal. Toutes les données sont automatiquement écrites dans un fichier de stockage afin d'éviter toutes corruptions de celles-ci. Elles ne sont jamais partagées à qui que ce soit. Toutes les tâches et notes sont automatiquement archivées et peuvent être consultées ou restaurées à tout moment.
+
+Lire la documentation en : [简体中文](https://github.com/klaussinani/taskbook/blob/master/docs/readme.ZH.md), [Русский](https://github.com/klaussinani/taskbook/blob/master/docs/readme.RU.md), [Français](https://github.com/klaussinani/taskbook/blob/master/docs/readme.FR.md).
+
+Vous pouvez visiter le [guide de contribution](https://github.com/klaussinani/taskbook/blob/master/contributing.md#translating-documentation) pour en savoir plus sur la traduction de ce document dans d'autres langages.
+
+Venez sur [Gitter](https://gitter.im/klaussinani/taskbook) ou [Twitter](https://twitter.com/klaussinani) pour partager vos idées sur le projet.
+
+## Points forts
+
+- Organiser des tâches & des notes sur des tableaux
+- Vues tableau & frise chronologique
+- Fonctionnalités de priorité & de favori
+- Recherche & filtre de tâches et de notes
+- Archivage & restauration des tâches et des notes supprimées
+- Léger & rapide
+- Données écrites automatiquement dans l'emplacement de stockage
+- Emplacement de stockage personnalisable
+- Vue d'ensemble sur les progrés
+- Syntaxe simple & minimaliste
+- Notifications de mise à jour
+- Configurable via `~/.taskbook.json`
+- Données stockées dans le fichier JSON `~/.taskbook/storage`
+
+Image des points forts dans [tableau taskbook](https://raw.githubusercontent.com/klaussinani/taskbook/master/media/highlights.png) en anglais.
+
+## Sommaire
+
+- [Présentation](#présentation)
+- [Points forts](#points-forts)
+- [Installation](#installation)
+- [Utilisation](#utilisation)
+- [Vues](#vues)
+- [Configuration](#configuration)
+- [Manuel de vol](#manuel-de-vol)
+- [Développement](#développement)
+- [Applications associées](#applications-associées)
+- [Équipe](#équipe)
+- [License](#license)
+
+## Installation
+
+### NPM
+
+```bash
+npm install --global taskbook
+```
+
+### Snapcraft
+
+```bash
+snap install taskbook
+snap alias taskbook tb # set alias
+```
+
+**Note:** À cause du confinement naturel de snap, les fichiers de stockage et de configuration seront sauvegardés sous la variable d'environnement [`$SNAP_USER_DATA`](https://docs.snapcraft.io/reference/env) à la place du `$HOME` habituel.
+
+## Utilisation
+
+```
+$ tb --help
+
+ Usage
+ $ tb [ ...]
+
+ Options
+ none Affiche la vue tableau
+ --task, -t Créé une tâche
+ --note, -n Créé une note
+ --timeline, -i Affiche la vue frise chronologique
+ --delete, -d Supprime une tâche ou une note
+ --check, -c Coche/décoche une tâche
+ --star, -s Ajoute aux favoris/Supprime des favoris une tâche ou une note
+ --copy, -y Copie la description d'une tâche ou d'une note
+ --list, -l Liste les tâches et les notes par attributs
+ --find, -f Cherche une tâche ou une note
+ --edit, -e Modifie la description d'une tâche ou d'une note
+ --move, -m Déplace une tâche ou une note entre des tableaux
+ --priority, -p Met à jour la priorité d'une tâche
+ --archive, -a Affiche les tâches et les notes qui sont archivées
+ --restore, -r Restaure les tâches et notes qui sont dans l'archive
+ --clear Supprime toutes les tâches et notes cochées
+ --help, -h Affiche le message d'aide
+ --version, -v Affiche la version de taskbook
+
+ Examples
+ $ tb
+ $ tb --task Preparer de la creme glacee
+ $ tb --task @coding Ameliorer la documentation
+ $ tb --task @coding @reviews Revue PR #42
+ $ tb --note @coding Trie avec fusion est dans le pire cas de complexite O(nlogn)
+ $ tb --check 1 2
+ $ tb --delete 4
+ $ tb --star 2
+ $ tb --copy 1 2 3
+ $ tb --priority @3 2
+ $ tb --timeline
+ $ tb --edit @3 Fusionner PR #42
+ $ tb --move @1 cuisinner
+ $ tb --find documentation
+ $ tb --list pending coding
+ $ tb --archive
+ $ tb --restore 4
+ $ tb --clear
+```
+
+## Vues
+
+### Vue Tableau
+
+Appeler taskbook sans option affichera toutes les tâches et notes sauvegardées dans leurs tableaux respectifs.
+
+
+

+
+
+### Vue Frise Chronologique
+
+Afin d'afficher toutes les tâches et notes dans la vue Frise Chronologique, en se basant sur leurs date de création, utilisez l'option `--timeline`/`-i`.
+
+
+

+
+
+## Configuration
+
+Pour configurer taskbook, il faut se rendre dans le fichier `~/.taskbook.json` et modifier les options afin de s'adapater au mieux à vos préférences. Pour restaurer la configuration par défaut, il suffit de supprimer le fichier de configuration de votre répertoire personnel (home).
+
+Le JSON suivant illustre l'ensemble des options existantes avec leurs valeurs par défaut respectives.
+
+```json
+{
+ "taskbookDirectory": "~",
+ "displayCompleteTasks": true,
+ "displayProgressOverview": true
+}
+```
+
+### En détail
+
+##### `taskbookDirectory`
+
+- Type: `String`
+- Par défaut: `~`
+
+Le chemin dans l'arborescence des fichiers où le stockage sera initialisé sera `/home/username/the-cloud` ou `~/the-cloud`
+
+S'il n'est pas défini, le répertoire personnel (home) `~` sera utilisé et taskbook sera installé sous `~/.taskbook/`.
+
+##### `displayCompleteTasks`
+
+- Type: `Boolean`
+- Par défaut: `true`
+
+Affiche les tâches qui sont marquées comme completées.
+
+##### `displayProgressOverview`
+
+- Type: `Boolean`
+- Par défaut: `true`
+
+Affiche la vue d'ensemble sur la progression en dessous des vues de frise chronologiques et de tableaux.
+
+## Manuel de vol
+
+Ce qui va suivre est un guide d'exemple permettant de mieux comprendre comment utiliser taskbook.
+Dans le cas où vous auriez remarqué une erreur ou que vous pensez que les exemples ne sont pas assez clair, qu'ils devraient être améliorés, alors n'hésitez pas à ouvrir une [issue](https://github.com/klaussinani/taskbook/issues/new/choose) ou une [pull request](https://github.com/klaussinani/taskbook/compare).
+
+### Créer une tâche
+
+Pour créer une nouvelle tâche, utilisez l'option `--task`/`-t` suivi de la description de la tâche.
+
+```
+$ tb -t Ameliorer la documentation
+```
+
+### Créer une note
+
+Pour créer une nouvelle note, utilisez l'option `--note`/`-n` suivi du contenu de la note.
+
+```
+$ tb -n Tri par fusion pire cas O(nlogn)
+```
+
+### Créer un tableau
+
+Les tableaux sont automatiquement initialisés lorsque l'on créé une nouvelle tâche ou une nouvelle note. Pour créer un ou plusieurs tableaux, ajoutez leurs noms préfixé du symbole `@`, dans la description de la tâche ou de la note qui va être créée. Par conséquent, la nouvelle tâche ou la nouvelle note appartiendra à l'ensemble des tableaux mentionnés. Par défaut, les tâches ou les notes qui ne possèdent pas de tableau dans leurs descriptions sont automatiquements ajoutés au tableau général `My Board`.
+
+```
+$ tb -t @coding @docs Mettre à jour le guide de contribution
+```
+
+### Valider une tâche
+
+Pour passer une tâche à complété ou non complété, utilisez l'option `--check`/`-c` suivi par les identifiants des tâches sélectionnées. Il est à noter que l'option va inverser le statut actuel de complétion de la tâche, ainsi une tâche incomplète sera passé à complète et une tâche complète à incomplète. S'il existe des duplicatas d'identifiants, ils seront automatiquement filtrés.
+
+```
+$ tb -c 1 3
+```
+
+### Ajouter une tâche ou une note aux favoris
+
+Pour ajouter une ou plusieurs tâches/notes aux favoris, utilisez l'option `--star`/`-s` suivi des identifiants des tâches/notes sélectionnées. Les fonctionnalités de cette option sont les mêmes que celles décrites au dessus pour l'option `--check`.
+
+```
+$ tb -s 1 2 3
+```
+
+### Copier la description d'une tâche ou d'une note
+
+Afin de copier dans le presse-papier de votre système d'une ou plusieurs tâches et/ou notes, utilisez l'option `--copy`/`-y` suivi des identifiants des tâches/notes. Il est important de noter que l'option inclut aussi les caractères de retour à la ligne comme séparateurs pour chaque paire de description adjacente, créant ainsi une pile de phrases claire et lisible au moment de coller.
+
+```
+$ tb -y 1 2 3
+```
+
+### Afficher les tableaux
+
+Appeler la commande taskbook sans option affichera toutes les tâches et notes sauvegardés dans leurs tableaux respectifs.
+
+```
+$ tb
+```
+
+### Afficher la Frise Chronologique
+
+Pour afficher toutes les tâches et notes de la vue frise chronologique, en se basant sur leurs dates de création, il faut utiliser l'option `--timeline`/`-i`.
+
+```
+$ tb -i
+```
+
+### Choisir un niveau de priorité
+
+Afin de donner un niveau de priorité à une tâche lors de son initialisation, ajoutez la syntaxe suivante dans la description de la tâche `p:x`, avec `x` pouvant prendre comme valeurs `1`,`2` ou `3`. Les tâches créées par défaut prennent la priorité `1`.
+
+- `1` - Priorité normale
+- `2` - Priorité moyenne
+- `3` - Priorité élevée
+
+```
+$ tb -t @coding Fix issue `#42` p:3
+```
+
+Pour mettre à jour le niveau de priorété d'un tâche après sa création, utilisez l'option `--priority`/`-p` suivi de l'identifiant de la tâche choisie, préfixé du symbole `@` et un chiffre parmis `1`, `2` ou `3`. Notez que l'ordre entre l'identifiant ou le niveau de priorité n'a pas d'importance.
+
+```
+$ tb -p @1 2
+```
+
+### Déplacer une tâche ou une note
+
+Pour déplacer une tâche ou une note sur un ou plusieurs tableaux, utilisez l'option `--move`/`-m` suivi de l'identifiant de la tâche ou de la note sélectionnée, préfixé du symbole `@` et du nom du/des tableau/x de destination. Le tableau par défaut `My board` peut être accédé via le mot clef `myboard`. L'ordre entre l'identifiant de la cible et les noms des tableaux n'a pas d'importance.
+
+```
+$ tb -m @1 myboard reviews
+```
+
+### Supprimer une ou plusieurs tâches ou notes
+
+Pour supprimer une ou plusieurs tâches ou notes, utilisez l'option `--delete`/`-d` suivi des identifiants des éléments ciblés. Les éléments supprimés sont automatiquement archivés et peuvent être inspéctés ou restaurés à n'importe quel moment. Les duplicatas d'identifiants sont automatiquement filtrés.
+
+```
+$ tb -d 1 2
+```
+
+### Supprimer toutes les tâches validées
+
+Afin de supprimer toutes les tâches que vous avez validées au moins une fois sur l'ensemble des tableaux, utilisez l'option `--clear`. Toutes les tâches supprimées sont automatiquement archivées et peuvent être consultées ou restaurées à n'importe quel moment. Afin d'éviter tout accident de suppression, l'option `--clear` n'existe pas dans une forme plus courte.
+
+```
+$ tb --clear
+```
+
+### Afficher l'archive
+
+Pour afficher toutes les tâches et notes archivées, utilisez l'option `--archive`/`-a`. Toutes les éléments sont affichés en vue frise chronologique en se basant sur leur date de création.
+
+```
+$ tb -a
+```
+
+### Restaurer une tâche ou une note
+
+Pour restaurer une ou plusieurs tâches/notes, utilisez l'option `--restore`/`-r` suivi des identifiants des tâches ou notes selectionnées. Les identifiants des éléments archivés peuvent être affichés en appelant l'option `--archive`/`-a`. Les duplicatas d'identifiants sont automatiquement filtrés.
+
+```
+$ tb -r 1 2
+```
+
+### Liste de tâches ou de notes
+
+Pour lister un groupe d'éléments qui correspondent chacun à un certain nombre d'attributs, utilisez l'option `--list`/`-l` suivi des attributs souhaités. Les noms des tableaux et les caractéristiques d'une tâche ou d'une note sont des attributs valides. Par exemple, pour lister tous les éléments qui correspondent au tableau par défaut `myboard` et qui sont des tâches qui ne sont pas encore validées, le code suivant peut être utilisé.
+
+```
+$ tb -l myboard pending
+```
+
+La liste des attributs supportés par défaut, avec leurs alias respectifs, est la suivante :
+
+- `myboard` - Tâches et notes appartenant à `My board`
+- `task`, `tasks`, `todo` - Éléments qui sont des tâches.
+- `note`, `notes` - Éléments qui sont des notes.
+- `pending`, `unchecked`, `incomplete` - Éléments qui sont des tâches non validées.
+- `done`, `checked`, `complete` - Éléments qui sont des tâches validées.
+- `star`, `starred` - Éléments qui sont des favoris.
+
+### Recherche de tâches ou notes
+
+Pour chercher un éléments parmis plusieurs, utilisez l'option `--find`/`-f`, suivi par vos mots clés de recherche.
+
+```
+$ tb -f documentation
+```
+
+## Développement
+
+Pour avoir plus d'informations sur la méthode à respecter pour contribuer au projet, merci de lire le [guide de contribution](https://github.com/klaussinani/taskbook/blob/master/contributing.md).
+
+- Fork le répertoire et clone le sur ta machine.
+- Déplacez vous dans votre fork local: `cd taskbook`
+- Installez les dépendances du projet: `npm install` ou `yarn install`
+- Vérifiez que le code ne contient pas d'erreurs : `npm test` ou `yarn test`
+
+## Applications associées
+
+- [chalk](https://github.com/chalk/chalk) - Coloration des chaînes de caractères dans le terminal
+- [signale](https://github.com/klaussinani/signale) - Affichage console hackable
+
+## Equipe
+
+- Klaus Sinani [(@klaussinani)](https://github.com/klaussinani)
+
+## License
+
+[MIT](https://github.com/klaussinani/taskbook/blob/master/license.md)
diff --git a/docs/readme.RU.md b/docs/readme.RU.md
index 80b2b08d..16693220 100644
--- a/docs/readme.RU.md
+++ b/docs/readme.RU.md
@@ -11,8 +11,8 @@
-
-
+
+
@@ -20,11 +20,11 @@
Используя простой и минимальный синтаксис, taskbook позволяет эффективно управлять задачами и заметками через несколько разделов в терминале. Все данные атомарно записываются в хранилище для предотвращения повреждений и ни с чем и ни с кем не распространяется. Удаленные записи автоматически сохраняются в архиве и могут быть просмотрены, либо восстановлены в любой момент.
-Можете прочитать этот документ на [简体中文](https://github.com/klauscfhq/taskbook/blob/master/docs/readme.ZH.md).
+Можете прочитать этот документ на [简体中文](https://github.com/klaussinani/taskbook/blob/master/docs/readme.ZH.md).
-Зайдите на [contributing guidelines](https://github.com/klauscfhq/taskbook/blob/master/contributing.md#translating-documentation) для того, чтобы больше узнать о том, как перевести этот документ на другие языки.
+Зайдите на [contributing guidelines](https://github.com/klaussinani/taskbook/blob/master/contributing.md#translating-documentation) для того, чтобы больше узнать о том, как перевести этот документ на другие языки.
-Присоединяйтесь к [Gitter](https://gitter.im/klauscfhq/taskbook), или [Twitter](https://twitter.com/klauscfhq), чтобы поделиться своим мнением об этом проекте.
+Присоединяйтесь к [Gitter](https://gitter.im/klaussinani/taskbook), или [Twitter](https://twitter.com/klaussinani), чтобы поделиться своим мнением об этом проекте.
## Особенности
@@ -42,7 +42,7 @@
- Конфигурируемый через `~/.taskbook.json`
- Данные хранятся в формате JSON в `~/.taskbook/storage`
-Просмторите особенности в [разделе taskbook](https://raw.githubusercontent.com/klauscfhq/taskbook/master/media/highlights.png).
+Просмторите особенности в [разделе taskbook](https://raw.githubusercontent.com/klaussinani/taskbook/master/media/highlights.png).
## Содержание
@@ -169,7 +169,7 @@ $ tb --help
## Руководство по полетам
Ниже приведено небольшое руководство с примерами по использованию taskbook.
-В случаи, если вы обнаружили ошибку или считаете, что пример недостаточно понятен и может быть обьяснено лучше, не стесняйтесь заводить [issue](https://github.com/klauscfhq/taskbook/issues/new/choose), либо [pull request](https://github.com/klauscfhq/taskbook/compare).
+В случаи, если вы обнаружили ошибку или считаете, что пример недостаточно понятен и может быть обьяснено лучше, не стесняйтесь заводить [issue](https://github.com/klaussinani/taskbook/issues/new/choose), либо [pull request](https://github.com/klaussinani/taskbook/compare).
### Создать задачу
@@ -304,7 +304,7 @@ $ tb -f документация
## Разработка
-Для большей информации о том, как можно способствовать этому проекту, пожалуйста, прочитайте [contributing guidelines](https://github.com/klauscfhq/taskbook/blob/master/contributing.md).
+Для большей информации о том, как можно способствовать этому проекту, пожалуйста, прочитайте [contributing guidelines](https://github.com/klaussinani/taskbook/blob/master/contributing.md).
- Форкните данную репозиторию и склонируйте на вашу машину
- Перейдите на ваш склонированный проект: `cd taskbook`
@@ -314,12 +314,12 @@ $ tb -f документация
## Относится
- [chalk](https://github.com/chalk/chalk) - Стилизация строк в терминале
-- [signale](https://github.com/klauscfhq/signale) - Автономный консольный логгер
+- [signale](https://github.com/klaussinani/signale) - Автономный консольный логгер
## Команда
-- Klaus Sinani [(@klauscfhq)](https://github.com/klauscfhq)
+- Klaus Sinani [(@klaussinani)](https://github.com/klaussinani)
## Лицензия
-[MIT](https://github.com/klauscfhq/taskbook/blob/master/license.md)
+[MIT](https://github.com/klaussinani/taskbook/blob/master/license.md)
diff --git a/docs/readme.ZH.md b/docs/readme.ZH.md
index 0ccd74ab..2cbddc07 100644
--- a/docs/readme.ZH.md
+++ b/docs/readme.ZH.md
@@ -12,8 +12,8 @@
-
-
+
+
@@ -21,9 +21,9 @@
本应用通过使用简单且最小化的语法,以及平坦的学习曲线,使您可以在终端内跨多个板块,有效地管理任务和笔记。所有数据都以原子方式写入存储,以防止损坏,并且永远不会与任何第三方共享。已删除的条目会自动存档,并且可以随时被检查或恢复。
-访问[贡献指南](https://github.com/klauscfhq/taskbook/blob/master/contributing.md#translating-documentation)了解有关如何将此文档翻译成更多语言的更多信息.
+访问[贡献指南](https://github.com/klaussinani/taskbook/blob/master/contributing.md#translating-documentation)了解有关如何将此文档翻译成更多语言的更多信息.
-来[Gitter](https://gitter.im/klauscfhq/taskbook)或[推特](https://twitter.com/klauscfhq)分享您对条目的看法.
+来[Gitter](https://gitter.im/klaussinani/taskbook)或[推特](https://twitter.com/klaussinani)分享您对条目的看法.
## 亮点
@@ -41,7 +41,7 @@
- 可通过`~/.taskbook.json`实现配置化
- 数据存储在JSON文件中`~/.taskbook/storage`
-查看亮点[taskbook 黑板报](https://raw.githubusercontent.com/klauscfhq/taskbook/master/media/highlights.png).
+查看亮点[taskbook 黑板报](https://raw.githubusercontent.com/klaussinani/taskbook/master/media/highlights.png).
### 目录
@@ -172,7 +172,7 @@ npm install --global taskbook
## 飞行手册
-以下是一个小练习,其中包含一组有关如何使用 taskbook 的示例。如果您发现错误或认为某个示例不够清晰并且应该进一步改进,请随时打开[issue](https://github.com/klauscfhq/taskbook/issues/new/choose)或[Pull 请求](https://github.com/klauscfhq/taskbook/compare)。
+以下是一个小练习,其中包含一组有关如何使用 taskbook 的示例。如果您发现错误或认为某个示例不够清晰并且应该进一步改进,请随时打开[issue](https://github.com/klaussinani/taskbook/issues/new/choose)或[Pull 请求](https://github.com/klaussinani/taskbook/compare)。
### 创建任务
@@ -287,7 +287,7 @@ npm install --global taskbook
## 开发
-有关如何为此项目做出贡献的更多信息,请阅读[贡献指南](https://github.com/klauscfhq/taskbook/blob/master/contributing.md)。
+有关如何为此项目做出贡献的更多信息,请阅读[贡献指南](https://github.com/klaussinani/taskbook/blob/master/contributing.md)。
- Fork 此仓库库并将其克隆到您的计算机
- 定位到您的本地 Fork: `cd taskbook`
@@ -297,12 +297,12 @@ npm install --global taskbook
## 相关
- [chalk](https://github.com/chalk/chalk)- Terminal string styling done right
-- [signale](https://github.com/klauscfhq/signale)- Hackable console logger
+- [signale](https://github.com/klaussinani/signale)- Hackable console logger
## 团队
-- Klaus Sinani[ (@klauscfhq) ](https://github.com/klauscfhq)
+- Klaus Sinani[ (@klaussinani) ](https://github.com/klaussinani)
## 授权协议
-[MIT](https://github.com/klauscfhq/taskbook/blob/master/license.md)
+[MIT](https://github.com/klaussinani/taskbook/blob/master/license.md)
diff --git a/docs/readme.md b/docs/readme.md
index af32dc1b..a477145d 100644
--- a/docs/readme.md
+++ b/docs/readme.md
@@ -1,12 +1,14 @@
## Taskbook Translated Documentation
-- [简体中文 - Simplified Chinese](https://github.com/klauscfhq/taskbook/blob/master/docs/readme.ZH.md) by [@chinanf-boy](https://github.com/chinanf-boy), [@rosuH](https://github.com/rosuH)
+- [简体中文 - Simplified Chinese](https://github.com/klaussinani/taskbook/blob/master/docs/readme.ZH.md) by [@chinanf-boy](https://github.com/chinanf-boy), [@rosuH](https://github.com/rosuH)
-- [Русский - Russian](https://github.com/klauscfhq/taskbook/blob/master/docs/readme.RU.md) by [@zhadyrassyn](https://github.com/zhadyrassyn), [@gebeto](https://github.com/gebeto)
+- [Русский - Russian](https://github.com/klaussinani/taskbook/blob/master/docs/readme.RU.md) by [@zhadyrassyn](https://github.com/zhadyrassyn), [@gebeto](https://github.com/gebeto)
+
+- [Français - French](https://github.com/klaussinani/taskbook/blob/master/docs/readme.FR.md) by [@Maltemo](https://github.com/Maltemo)
## Contributing
-Visit the [contributing guidelines](https://github.com/klauscfhq/taskbook/blob/master/contributing.md#translating-documentation) to learn more on how to get involved in the translating process.
+Visit the [contributing guidelines](https://github.com/klaussinani/taskbook/blob/master/contributing.md#translating-documentation) to learn more on how to get involved in the translating process.
## Thanks
diff --git a/index.js b/index.js
index 245e6247..52041e1e 100644
--- a/index.js
+++ b/index.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
'use strict';
-const taskbook = require('./lib/taskbook');
+const taskbook = require('./src/taskbook');
const taskbookCLI = (input, flags) => {
if (flags.archive) {
@@ -27,6 +27,10 @@ const taskbookCLI = (input, flags) => {
return taskbook.checkTasks(input);
}
+ if (flags.begin) {
+ return taskbook.beginTasks(input);
+ }
+
if (flags.star) {
return taskbook.starItems(input);
}
diff --git a/license.md b/license.md
index fa018a06..6bb6a851 100644
--- a/license.md
+++ b/license.md
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) Klaus Sinani Mario Sinani
+Copyright (c) Klaus Sinani (klaussinani.github.io) Mario Sinani (mariocfhq.github.io)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/package.json b/package.json
index 75ba4547..d70153a3 100644
--- a/package.json
+++ b/package.json
@@ -1,14 +1,14 @@
{
"name": "taskbook",
"productName": "Taskbook",
- "version": "0.2.0",
+ "version": "0.3.0",
"description": "📓 Tasks, boards & notes for the command-line habitat",
- "repository": "klauscfhq/taskbook",
+ "repository": "klaussinani/taskbook",
"license": "MIT",
"author": {
"name": "Klaus Sinani",
- "email": "klauscfhq@protonmail.com",
- "url": "https://klauscfhq.github.io"
+ "email": "klaussinani@gmail.com",
+ "url": "https://klaussinani.github.io"
},
"bin": {
"tb": "cli.js"
@@ -17,7 +17,7 @@
"node": ">=6"
},
"files": [
- "lib",
+ "src",
"cli.js",
"index.js"
],
diff --git a/readme.md b/readme.md
index a4985b07..edb98b45 100644
--- a/readme.md
+++ b/readme.md
@@ -11,8 +11,8 @@
-
-
+
+
@@ -20,11 +20,11 @@
By utilizing a simple and minimal usage syntax, that requires a flat learning curve, taskbook enables you to effectively manage your tasks and notes across multiple boards from within your terminal. All data are written atomically to the storage in order to prevent corruptions, and are never shared with anyone or anything. Deleted items are automatically archived and can be inspected or restored at any moment.
-Read this document in: [简体中文](https://github.com/klauscfhq/taskbook/blob/master/docs/readme.ZH.md), [Русский](https://github.com/klauscfhq/taskbook/blob/master/docs/readme.RU.md).
+Read this document in: [简体中文](https://github.com/klaussinani/taskbook/blob/master/docs/readme.ZH.md), [Русский](https://github.com/klaussinani/taskbook/blob/master/docs/readme.RU.md), [Français](https://github.com/klaussinani/taskbook/blob/master/docs/readme.FR.md).
-Visit the [contributing guidelines](https://github.com/klauscfhq/taskbook/blob/master/contributing.md#translating-documentation) to learn more on how to translate this document into more languages.
+Visit the [contributing guidelines](https://github.com/klaussinani/taskbook/blob/master/contributing.md#translating-documentation) to learn more on how to translate this document into more languages.
-Come over to [Gitter](https://gitter.im/klauscfhq/taskbook) or [Twitter](https://twitter.com/klauscfhq) to share your thoughts on the project.
+Come over to [Gitter](https://gitter.im/klaussinani/taskbook) or [Twitter](https://twitter.com/klaussinani) to share your thoughts on the project.
## Highlights
@@ -42,7 +42,7 @@ Come over to [Gitter](https://gitter.im/klauscfhq/taskbook) or [Twitter](https:/
- Configurable through `~/.taskbook.json`
- Data stored in JSON file at `~/.taskbook/storage`
-View highlights in a [taskbook board](https://raw.githubusercontent.com/klauscfhq/taskbook/master/media/highlights.png).
+View highlights in a [taskbook board](https://raw.githubusercontent.com/klaussinani/taskbook/master/media/highlights.png).
## Contents
@@ -85,43 +85,45 @@ $ tb --help
Options
none Display board view
- --task, -t Create task
- --note, -n Create note
- --timeline, -i Display timeline view
- --delete, -d Delete item
+ --archive, -a Display archived items
+ --begin, -b Start/pause task
--check, -c Check/uncheck task
- --star, -s Star/unstar item
+ --clear Delete all checked items
--copy, -y Copy item description
- --list, -l List items by attributes
- --find, -f Search for items
+ --delete, -d Delete item
--edit, -e Edit item description
+ --find, -f Search for items
+ --help, -h Display help message
+ --list, -l List items by attributes
--move, -m Move item between boards
+ --note, -n Create note
--priority, -p Update priority of task
- --archive, -a Display archived items
--restore, -r Restore items from archive
- --clear Delete all checked items
- --help, -h Display help message
+ --star, -s Star/unstar item
+ --task, -t Create task
+ --timeline, -i Display timeline view
--version, -v Display installed version
Examples
$ tb
- $ tb --task Make some buttercream
- $ tb --task @coding Improve documentation
- $ tb --task @coding @reviews Review PR #42
- $ tb --note @coding Mergesort worse-case O(nlogn)
+ $ tb --archive
+ $ tb --begin 2 3
$ tb --check 1 2
- $ tb --delete 4
- $ tb --star 2
+ $ tb --clear
$ tb --copy 1 2 3
- $ tb --priority @3 2
- $ tb --timeline
+ $ tb --delete 4
$ tb --edit @3 Merge PR #42
- $ tb --move @1 cooking
$ tb --find documentation
$ tb --list pending coding
- $ tb --archive
+ $ tb --move @1 cooking
+ $ tb --note @coding Mergesort worse-case O(nlogn)
+ $ tb --priority @3 2
$ tb --restore 4
- $ tb --clear
+ $ tb --star 2
+ $ tb --task @coding @reviews Review PR #42
+ $ tb --task @coding Improve documentation
+ $ tb --task Make some buttercream
+ $ tb --timeline
```
## Views
@@ -184,7 +186,7 @@ Display progress overview below the timeline and board views.
## Flight Manual
The following is a minor walkthrough containing a set of examples on how to use taskbook.
-In case you spotted an error or think that an example is not to clear enough and should be further improved, please feel free to open an [issue](https://github.com/klauscfhq/taskbook/issues/new/choose) or [pull request](https://github.com/klauscfhq/taskbook/compare).
+In case you spotted an error or think that an example is not to clear enough and should be further improved, please feel free to open an [issue](https://github.com/klaussinani/taskbook/issues/new/choose) or [pull request](https://github.com/klaussinani/taskbook/compare).
### Create Task
@@ -218,6 +220,14 @@ To mark a task as complete/incomplete, use the `--check`/`-c` option followed by
$ tb -c 1 3
```
+### Begin Task
+
+To mark a task as started/paused, use the `--begin`/`-b` option followed by the ids of the target tasks. The functionality of this option is the same as the one of the above described `--check` option.
+
+```
+$ tb -b 2 3
+```
+
### Star Item
To mark one or more items as favorite, use the `--star`/`-s` option followed by the ids of the target items. The functionality of this option is the same as the one of the above described `--check` option.
@@ -310,7 +320,7 @@ $ tb -r 1 2
### List Items
-To list a group of items where each item complies with a specif number of attributes, use the `--list`/`-l` option followed by the desired attributes. Board names along with item traits can be considered valid listing attributes. For example to list all items that belong to the default `myboard` and are pending tasks, the following could be used;
+To list a group of items where each item complies with a specific set of attributes, use the `--list`/`-l` option followed by the desired attributes. Board names along with item traits can be considered valid listing attributes. For example to list all items that belong to the default `myboard` and are pending tasks, the following could be used;
```
$ tb -l myboard pending
@@ -322,6 +332,7 @@ The by default supported listing attributes, together with their respective alia
- `task`, `tasks`, `todo` - Items that are tasks.
- `note`, `notes` - Items that are notes.
- `pending`, `unchecked`, `incomplete` - Items that are pending tasks.
+- `progress`, `started`, `begun` - Items that are in-progress tasks.
- `done`, `checked`, `complete` - Items that complete tasks.
- `star`, `starred` - Items that are starred.
@@ -335,7 +346,7 @@ $ tb -f documentation
## Development
-For more info on how to contribute to the project, please read the [contributing guidelines](https://github.com/klauscfhq/taskbook/blob/master/contributing.md).
+For more info on how to contribute to the project, please read the [contributing guidelines](https://github.com/klaussinani/taskbook/blob/master/contributing.md).
- Fork the repository and clone it to your machine
- Navigate to your local fork: `cd taskbook`
@@ -344,13 +355,13 @@ For more info on how to contribute to the project, please read the [contributing
## Related
-- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
-- [signale](https://github.com/klauscfhq/signale) - Hackable console logger
+- [signale](https://github.com/klaussinani/signale) - Hackable console logger
+- [qoa](https://github.com/klaussinani/qoa) - Minimal interactive command-line prompts
## Team
-- Klaus Sinani [(@klauscfhq)](https://github.com/klauscfhq)
+- Klaus Sinani [(@klaussinani)](https://github.com/klaussinani)
## License
-[MIT](https://github.com/klauscfhq/taskbook/blob/master/license.md)
+[MIT](https://github.com/klaussinani/taskbook/blob/master/license.md)
diff --git a/snapcraft.yaml b/snapcraft.yaml
index 604b84c1..3791eb6b 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -1,5 +1,6 @@
name: taskbook
-version: git
+version: '0.0.0'
+version-script: git describe --always | cut -c 2-
summary: Tasks, boards & notes for the command-line habitat
description: |
By utilizing a simple and minimal usage syntax, that requires a flat learning curve,
@@ -20,10 +21,11 @@ apps:
- home
- network
- network-control
+ - x11
parts:
taskbook:
plugin: nodejs
- node-engine: 8.11.3
+ node-engine: 10.15.0
node-package-manager: yarn
source: .
diff --git a/lib/config.js b/src/config.js
similarity index 100%
rename from lib/config.js
rename to src/config.js
diff --git a/lib/help.js b/src/help.js
similarity index 95%
rename from lib/help.js
rename to src/help.js
index 451442c1..a9b4f344 100644
--- a/lib/help.js
+++ b/src/help.js
@@ -6,41 +6,43 @@ module.exports = `
Options
none Display board view
- --task, -t Create task
- --note, -n Create note
- --timeline, -i Display timeline view
- --delete, -d Delete item
+ --archive, -a Display archived items
+ --begin, -b Start/pause task
--check, -c Check/uncheck task
- --star, -s Star/unstar item
+ --clear Delete all checked items
--copy, -y Copy item description
- --list, -l List items by attributes
- --find, -f Search for items
+ --delete, -d Delete item
--edit, -e Edit item description
+ --find, -f Search for items
+ --help, -h Display help message
+ --list, -l List items by attributes
--move, -m Move item between boards
+ --note, -n Create note
--priority, -p Update priority of task
- --archive, -a Display archived items
--restore, -r Restore items from archive
- --clear Delete all checked items
- --help, -h Display help message
+ --star, -s Star/unstar item
+ --task, -t Create task
+ --timeline, -i Display timeline view
--version, -v Display installed version
Examples
$ tb
- $ tb --task Make some buttercream
- $ tb --task @coding Improve documentation
- $ tb --task @coding @reviews Review PR #42
- $ tb --note @coding Mergesort worse-case O(nlogn)
+ $ tb --archive
+ $ tb --begin 2 3
$ tb --check 1 2
- $ tb --delete 4
- $ tb --star 2
+ $ tb --clear
$ tb --copy 1 2 3
- $ tb --priority @3 2
- $ tb --timeline
+ $ tb --delete 4
$ tb --edit @3 Merge PR #42
- $ tb --move @1 cooking
$ tb --find documentation
$ tb --list pending coding
- $ tb --archive
+ $ tb --move @1 cooking
+ $ tb --note @coding Mergesort worse-case O(nlogn)
+ $ tb --priority @3 2
$ tb --restore 4
- $ tb --clear
+ $ tb --star 2
+ $ tb --task @coding @reviews Review PR #42
+ $ tb --task @coding Improve documentation
+ $ tb --task Make some buttercream
+ $ tb --timeline
`;
diff --git a/lib/item.js b/src/item.js
similarity index 100%
rename from lib/item.js
rename to src/item.js
diff --git a/lib/note.js b/src/note.js
similarity index 100%
rename from lib/note.js
rename to src/note.js
diff --git a/lib/render.js b/src/render.js
similarity index 87%
rename from lib/render.js
rename to src/render.js
index f6402d7c..75db161b 100644
--- a/lib/render.js
+++ b/src/render.js
@@ -5,7 +5,7 @@ const config = require('./config');
signale.config({displayLabel: false});
-const {error, log, note, pending, success} = signale;
+const {await: wait, error, log, note, pending, success} = signale;
const {blue, green, grey, magenta, red, underline, yellow} = chalk;
const priorities = {2: 'yellow', 3: 'red'};
@@ -45,6 +45,7 @@ class Render {
return complete++;
}
}
+
return notes++;
});
@@ -98,7 +99,7 @@ class Render {
}
_displayItemByBoard(item) {
- const {_isTask, isComplete} = item;
+ const {_isTask, isComplete, inProgress} = item;
const age = this._getAge(item._timestamp);
const star = this._getStar(item);
@@ -109,14 +110,14 @@ class Render {
const msgObj = {prefix, message, suffix};
if (_isTask) {
- return isComplete ? success(msgObj) : pending(msgObj);
+ return isComplete ? success(msgObj) : inProgress ? wait(msgObj) : pending(msgObj);
}
return note(msgObj);
}
_displayItemByDate(item) {
- const {_isTask, isComplete} = item;
+ const {_isTask, isComplete, inProgress} = item;
const boards = item.boards.filter(x => x !== 'My Board');
const star = this._getStar(item);
@@ -127,7 +128,7 @@ class Render {
const msgObj = {prefix, message, suffix};
if (_isTask) {
- return isComplete ? success(msgObj) : pending(msgObj);
+ return isComplete ? success(msgObj) : inProgress ? wait(msgObj) : pending(msgObj);
}
return note(msgObj);
@@ -138,11 +139,13 @@ class Render {
if (this._isBoardComplete(data[board]) && !this._configuration.displayCompleteTasks) {
return;
}
+
this._displayTitle(board, data[board]);
data[board].forEach(item => {
if (item._isTask && item.isComplete && !this._configuration.displayCompleteTasks) {
return;
}
+
this._displayItemByBoard(item);
});
});
@@ -153,17 +156,19 @@ class Render {
if (this._isBoardComplete(data[date]) && !this._configuration.displayCompleteTasks) {
return;
}
+
this._displayTitle(date, data[date]);
data[date].forEach(item => {
if (item._isTask && item.isComplete && !this._configuration.displayCompleteTasks) {
return;
}
+
this._displayItemByDate(item);
});
});
}
- displayStats({percent, complete, pending, notes}) {
+ displayStats({percent, complete, inProgress, pending, notes}) {
if (!this._configuration.displayProgressOverview) {
return;
}
@@ -172,15 +177,16 @@ class Render {
const status = [
`${green(complete)} ${grey('done')}`,
+ `${blue(inProgress)} ${grey('in-progress')}`,
`${magenta(pending)} ${grey('pending')}`,
- `${blue(notes)} ${grey('notes')}`
+ `${blue(notes)} ${grey(notes === 1 ? 'note' : 'notes')}`
];
- if (complete !== 0 && pending === 0 && notes === 0) {
+ if (complete !== 0 && inProgress === 0 && pending === 0 && notes === 0) {
log({prefix: '\n ', message: 'All done!', suffix: yellow('★')});
}
- if (pending + complete + notes === 0) {
+ if (pending + inProgress + complete + notes === 0) {
log({prefix: '\n ', message: 'Type `tb --help` to get started!', suffix: yellow('★')});
}
@@ -216,6 +222,7 @@ class Render {
if (ids.length === 0) {
return;
}
+
const [prefix, suffix] = ['\n', grey(ids.join(', '))];
const message = `Checked ${ids.length > 1 ? 'tasks' : 'task'}:`;
success({prefix, message, suffix});
@@ -225,15 +232,37 @@ class Render {
if (ids.length === 0) {
return;
}
+
const [prefix, suffix] = ['\n', grey(ids.join(', '))];
const message = `Unchecked ${ids.length > 1 ? 'tasks' : 'task'}:`;
success({prefix, message, suffix});
}
+ markStarted(ids) {
+ if (ids.length === 0) {
+ return;
+ }
+
+ const [prefix, suffix] = ['\n', grey(ids.join(', '))];
+ const message = `Started ${ids.length > 1 ? 'tasks' : 'task'}:`;
+ success({prefix, message, suffix});
+ }
+
+ markPaused(ids) {
+ if (ids.length === 0) {
+ return;
+ }
+
+ const [prefix, suffix] = ['\n', grey(ids.join(', '))];
+ const message = `Paused ${ids.length > 1 ? 'tasks' : 'task'}:`;
+ success({prefix, message, suffix});
+ }
+
markStarred(ids) {
if (ids.length === 0) {
return;
}
+
const [prefix, suffix] = ['\n', grey(ids.join(', '))];
const message = `Starred ${ids.length > 1 ? 'items' : 'item'}:`;
success({prefix, message, suffix});
@@ -243,6 +272,7 @@ class Render {
if (ids.length === 0) {
return;
}
+
const [prefix, suffix] = ['\n', grey(ids.join(', '))];
const message = `Unstarred ${ids.length > 1 ? 'items' : 'item'}:`;
success({prefix, message, suffix});
diff --git a/lib/storage.js b/src/storage.js
similarity index 100%
rename from lib/storage.js
rename to src/storage.js
diff --git a/lib/task.js b/src/task.js
similarity index 86%
rename from lib/task.js
rename to src/task.js
index a64046c2..2b429388 100644
--- a/lib/task.js
+++ b/src/task.js
@@ -6,6 +6,7 @@ class Task extends Item {
super(options);
this._isTask = true;
this.isComplete = options.isComplete || false;
+ this.inProgress = options.inProgress || false;
this.isStarred = options.isStarred || false;
this.priority = options.priority || 1;
}
diff --git a/lib/taskbook.js b/src/taskbook.js
similarity index 89%
rename from lib/taskbook.js
rename to src/taskbook.js
index 14003d55..d01e61ee 100644
--- a/lib/taskbook.js
+++ b/src/taskbook.js
@@ -123,31 +123,28 @@ class Taskbook {
_getStats() {
const {_data} = this;
- let [complete, pending, notes] = [0, 0, 0];
+ let [complete, inProgress, pending, notes] = [0, 0, 0, 0];
Object.keys(_data).forEach(id => {
if (_data[id]._isTask) {
- return _data[id].isComplete ? complete++ : pending++;
+ return _data[id].isComplete ? complete++ : _data[id].inProgress ? inProgress++ : pending++;
}
+
return notes++;
});
const total = complete + pending;
const percent = (total === 0) ? 0 : Math.floor(complete * 100 / total);
- return {percent, complete, pending, notes};
+ return {percent, complete, inProgress, pending, notes};
}
_hasTerms(string, terms) {
- let result;
-
- terms.forEach((term, key, arr) => {
- if (string.toLowerCase().indexOf(term) > -1) {
- result = (key === arr.length - 1) ? string : '';
+ for (const term of terms) {
+ if (string.toLocaleLowerCase().indexOf(term.toLocaleLowerCase()) > -1) {
+ return string;
}
- });
-
- return result;
+ }
}
_filterTask(data) {
@@ -168,6 +165,15 @@ class Taskbook {
return data;
}
+ _filterInProgress(data) {
+ Object.keys(data).forEach(id => {
+ if (!data[id]._isTask || !data[id].inProgress) {
+ delete data[id];
+ }
+ });
+ return data;
+ }
+
_filterComplete(data) {
Object.keys(data).forEach(id => {
if (!data[id]._isTask || !data[id].isComplete) {
@@ -213,6 +219,12 @@ class Taskbook {
data = this._filterComplete(data);
break;
+ case 'progress':
+ case 'started':
+ case 'begun':
+ data = this._filterInProgress(data);
+ break;
+
case 'pending':
case 'unchecked':
case 'incomplete':
@@ -251,6 +263,7 @@ class Taskbook {
if (Array.isArray(grouped[board])) {
return grouped[board].push(data[id]);
}
+
grouped[board] = [data[id]];
return grouped[board];
}
@@ -269,6 +282,7 @@ class Taskbook {
if (Array.isArray(grouped[date])) {
return grouped[date].push(data[id]);
}
+
grouped[date] = [data[id]];
return grouped[date];
}
@@ -324,8 +338,11 @@ class Taskbook {
const [checked, unchecked] = [[], []];
ids.forEach(id => {
- _data[id].isComplete = !_data[id].isComplete;
- return _data[id].isComplete ? checked.push(id) : unchecked.push(id);
+ if (_data[id]._isTask) {
+ _data[id].inProgress = false;
+ _data[id].isComplete = !_data[id].isComplete;
+ return _data[id].isComplete ? checked.push(id) : unchecked.push(id);
+ }
});
this._save(_data);
@@ -333,6 +350,24 @@ class Taskbook {
render.markIncomplete(unchecked);
}
+ beginTasks(ids) {
+ ids = this._validateIDs(ids);
+ const {_data} = this;
+ const [started, paused] = [[], []];
+
+ ids.forEach(id => {
+ if (_data[id]._isTask) {
+ _data[id].isComplete = false;
+ _data[id].inProgress = !_data[id].inProgress;
+ return _data[id].inProgress ? started.push(id) : paused.push(id);
+ }
+ });
+
+ this._save(_data);
+ render.markStarted(started);
+ render.markPaused(paused);
+ }
+
createTask(desc) {
const {boards, description, id, priority} = this._getOptions(desc);
const task = new Task({id, description, boards, priority});
@@ -407,6 +442,7 @@ class Taskbook {
if (!this._hasTerms(_data[id].description, terms)) {
return;
}
+
result[id] = _data[id];
});
@@ -421,6 +457,7 @@ class Taskbook {
if (storedBoards.indexOf(`@${x}`) === -1) {
return x === 'myboard' ? boards.push('My Board') : attributes.push(x);
}
+
return boards.push(`@${x}`);
});