presets for some startingpoints added
This commit is contained in:
189
PRESETS.md
Normal file
189
PRESETS.md
Normal file
@@ -0,0 +1,189 @@
|
||||
# Rogue Agenda presets
|
||||
|
||||
Presets create complete example `.agnd` workspaces. They are intended both as
|
||||
useful starting points and as inspectable examples of how categories, hierarchy,
|
||||
saved views, sections, columns, rules, notes, dates, numeric values, and macros
|
||||
fit together.
|
||||
|
||||
All bundled records, organizations, people, routes, recipes, and wording are
|
||||
original fictional demonstration content. The presets reimagine documented
|
||||
Agenda workflows without copying or requiring legacy `.AG` files.
|
||||
|
||||
## Creating a preset document
|
||||
|
||||
Pass one preset name when creating a document:
|
||||
|
||||
```sh
|
||||
rogue-agenda sales.agnd --preset accounts
|
||||
rogue-agenda course-notes.agnd --preset study
|
||||
rogue-agenda week.agnd --preset planner
|
||||
rogue-agenda kitchen.agnd --preset recipes
|
||||
rogue-agenda cycling.agnd --preset rides
|
||||
rogue-agenda team.agnd --preset people
|
||||
```
|
||||
|
||||
From the source tree, prefix the same arguments with `cargo run --`:
|
||||
|
||||
```sh
|
||||
cargo run -- learning.agnd --preset study
|
||||
```
|
||||
|
||||
A preset deliberately works only when the destination is new. Rogue Agenda
|
||||
refuses to replace an existing SQLite document, even if that document has no
|
||||
items. Choose a path that does not exist if you want a fresh copy. `--preset`
|
||||
and the smaller `--demo` initializer cannot be used together.
|
||||
|
||||
Dates in sample records are relative to the day the document is created, so
|
||||
upcoming, overdue, Datebook, and review views are immediately meaningful. Preset
|
||||
documents remain ordinary editable `.agnd` files: rename or remove categories,
|
||||
rewrite rules and macros, delete all sample records, and evolve the workspace as
|
||||
you would any other Rogue Agenda document.
|
||||
|
||||
## `accounts`
|
||||
|
||||
Account Desk is a broad relationship and sales-support workspace. It is the most
|
||||
complete general demonstration of Agenda's single-copy information model: an
|
||||
issue or activity can appear under an account, workflow stage, status report,
|
||||
and time-based view without being duplicated.
|
||||
|
||||
It provides:
|
||||
|
||||
- Account and contact records, with fictional Northstar Labs and Harbor Books
|
||||
examples.
|
||||
- A mutually exclusive opportunity pipeline: Prospect, Qualified, Proposal,
|
||||
and Customer.
|
||||
- Calls, meetings, and follow-ups under an Activities hierarchy.
|
||||
- Open, waiting, and resolved issue states.
|
||||
- Numeric expense records with a summed Amount column.
|
||||
- A sectioned status report divided into urgent and routine material.
|
||||
- Filing rules that collect priority-one work into the status report and detect
|
||||
follow-up wording.
|
||||
- `captureaccount` and `capturecall` prompt-driven macros.
|
||||
|
||||
The principal views are Accounts, Pipeline, Open Issues, Calls and Meetings,
|
||||
Expenses, and Status Report. This preset is a good foundation for lightweight
|
||||
CRM, client service, fundraising, vendor management, or case tracking.
|
||||
|
||||
## `study`
|
||||
|
||||
Study Deck is inspired by the idea of using Agenda items and notes as a learning
|
||||
system. The item text is a question, its multiline note is the answer, `When` is
|
||||
the next review date, and the numeric value is a visible learning-cycle number.
|
||||
|
||||
It provides:
|
||||
|
||||
- Computing, Languages, and History example decks.
|
||||
- Mutually exclusive New, Learning, and Review stages.
|
||||
- Due Review, New Cards, All Cards, Deck Browser, and Datebook views.
|
||||
- A sectioned deck browser that shows the same cards by subject.
|
||||
- Cycle values and relative review dates on the included cards.
|
||||
- A `capturecard` macro that asks for a question and answer, creates the card,
|
||||
and writes the answer into its note.
|
||||
- A `revealanswer` macro that presents the selected question and then opens its
|
||||
note. Run it from the Macro Manager while a card is selected.
|
||||
|
||||
Rogue Agenda does not silently grade a response. Move cards between learning
|
||||
stages and set their next review dates according to the method you prefer. The
|
||||
preset intentionally exposes those mechanics so they can be customized.
|
||||
|
||||
## `planner`
|
||||
|
||||
Activities Planner expands the small default document into a worked example of
|
||||
personal planning. It demonstrates how users can grow Rogue Agenda gradually
|
||||
instead of adopting a rigid methodology.
|
||||
|
||||
It provides:
|
||||
|
||||
- Next Actions with Calls, Meetings, and Errands beneath the activity hierarchy.
|
||||
- Website Refresh and Studio Move example projects.
|
||||
- Work, Home, and Personal areas.
|
||||
- At Computer, On Phone, and Out and About contexts.
|
||||
- Today, This Week, Next Actions, Projects, Calls and Meetings, Ideas, and
|
||||
Datebook views.
|
||||
- Rules that promote priority-one and priority-two open work to Next Actions and
|
||||
recognize dated calls or meetings as scheduled activities.
|
||||
- A recurring weekly meeting and a completed action to demonstrate lifecycle
|
||||
views.
|
||||
- `quickcapture` and `captureidea` macros.
|
||||
|
||||
This is the best preset for learning how the ordinary default setup can be
|
||||
extended while preserving free-form capture.
|
||||
|
||||
## `recipes`
|
||||
|
||||
Recipe Box treats each recipe as a single item with ingredients and method in
|
||||
its note. Categories provide multiple browsing paths without maintaining
|
||||
separate copies of a recipe.
|
||||
|
||||
It provides:
|
||||
|
||||
- Course categories for Breakfast, Main Dishes, Desserts, and Drinks.
|
||||
- Cuisine, dietary, ingredient, Quick, and Favorites classifications.
|
||||
- A numeric Servings value shown alongside each recipe.
|
||||
- Recipe Box, Favorites, Main Dishes, Quick Meals, Vegetarian, and sectioned By
|
||||
Course views.
|
||||
- Five small original recipes covering different courses and dietary tags.
|
||||
- A rule that notices cooking-time wording in notes and files recipes as Quick.
|
||||
- A `newrecipe` macro that creates a recipe and lays out an Ingredients, Method,
|
||||
and Notes template in the note editor.
|
||||
- A `cookingnote` macro for capturing observations that do not yet belong to a
|
||||
formal recipe.
|
||||
|
||||
The ingredient categories are intentionally small. Add frequently used
|
||||
ingredients as children of Ingredients to turn the preset into a deeper index.
|
||||
|
||||
## `rides`
|
||||
|
||||
Bicycle Log demonstrates numeric reporting and several overlapping category
|
||||
dimensions. Ride distance is stored as the item's numeric value in kilometres.
|
||||
|
||||
It provides:
|
||||
|
||||
- Commute, Training, and Leisure ride types.
|
||||
- Road, Touring, and City bicycles.
|
||||
- Clear, Cloudy, and Rain conditions plus named Routes.
|
||||
- Ride Log and Training totals, a Long Rides filter, and a sectioned By Bicycle
|
||||
report.
|
||||
- Past and upcoming rides with original notes, route details, and distances.
|
||||
- A separate Maintenance view with dated bicycle service tasks.
|
||||
- Rules that recognize ride and maintenance wording.
|
||||
- `logride` and `servicereminder` capture macros.
|
||||
|
||||
Use `F6` on a newly captured ride to record its numeric distance and date, then
|
||||
assign bicycle, ride type, route, and weather with `F3`.
|
||||
|
||||
## `people`
|
||||
|
||||
People Manager is a lightweight development and team-information workspace. It
|
||||
is meant for supportive planning and review preparation, not confidential HR
|
||||
records or formal performance scoring.
|
||||
|
||||
It provides:
|
||||
|
||||
- People profiles organized by Product, Operations, and Community teams.
|
||||
- Mutually exclusive Active, Candidate, and Alumni states.
|
||||
- Separate records for goals, reviews, development actions, achievements, and
|
||||
hiring activity.
|
||||
- People Directory, Upcoming Reviews, Goals, Development, Candidates, and
|
||||
Achievements views.
|
||||
- A numeric Progress example on a dated goal.
|
||||
- Filing rules for `Person:`, `Review:`, and `Goal:` capture conventions.
|
||||
- `addperson` and `addgoal` prompt-driven macros.
|
||||
|
||||
The sample content is deliberately non-sensitive. Before using this preset for
|
||||
real people, decide what information is appropriate to store and who can access
|
||||
the `.agnd` file and its backups.
|
||||
|
||||
## Presets versus `--demo`
|
||||
|
||||
`--demo` adds only a handful of representative items to an otherwise default
|
||||
document. It remains useful for a quick interface check:
|
||||
|
||||
```sh
|
||||
rogue-agenda scratch.agnd --demo
|
||||
```
|
||||
|
||||
Presets replace the default category and view definitions in a new document with
|
||||
a coherent domain-specific workspace and include tailored macros, rules, and
|
||||
sample records. Use a preset when you want to explore how a substantial Agenda
|
||||
application is assembled.
|
||||
@@ -112,6 +112,10 @@ Research URLs:
|
||||
syntax highlighting for commands, labels, variables, values, comments,
|
||||
delimiters, and malformed source.
|
||||
- [x] Demo data, CLI help, README, MIT license, and unit/integration tests.
|
||||
- [x] Six clean-room, version-tagged preset workspaces selected with `--preset`:
|
||||
Accounts, Study, Planner, Recipes, Rides, and People. Each safely initializes
|
||||
only a new document and supplies tailored categories, views, sections, rules,
|
||||
macros, relative-date sample records, and user documentation in `PRESETS.md`.
|
||||
|
||||
## Supported with a modern interpretation
|
||||
|
||||
|
||||
16
README.md
16
README.md
@@ -44,6 +44,9 @@ database with the `.agnd` extension.
|
||||
persistent variables, branches, loops, calls, prompts and menus, AUTOEXEC,
|
||||
key bindings, and a Learn recorder. The responsive macro editor adds syntax
|
||||
highlighting and key capture without sanding away the unusual original language.
|
||||
- Six complete clean-room presets for account work, study cards, personal
|
||||
planning, recipes, bicycle logs, and people development. Each combines its own
|
||||
categories, views, rules, macros, and original sample records.
|
||||
|
||||
## Build and run
|
||||
|
||||
@@ -60,6 +63,18 @@ initialized with useful categories and saved views. To explore a populated file:
|
||||
cargo run -- demo.agnd --demo
|
||||
```
|
||||
|
||||
For a richer example, initialize a new document with one of the six presets:
|
||||
|
||||
```sh
|
||||
cargo run -- sales.agnd --preset accounts
|
||||
cargo run -- learning.agnd --preset study
|
||||
```
|
||||
|
||||
The available names are `accounts`, `study`, `planner`, `recipes`, `rides`, and
|
||||
`people`. Presets only initialize new document paths and never replace an existing
|
||||
file. See [PRESETS.md](PRESETS.md) for the supplied views, rules, macros, and demo
|
||||
content in every workspace.
|
||||
|
||||
### Install for use from any directory
|
||||
|
||||
From the Rogue Agenda source directory, install the release binary under your
|
||||
@@ -82,6 +97,7 @@ After opening a new shell, Rogue Agenda can be launched from anywhere:
|
||||
```sh
|
||||
rogue-agenda notes.agnd
|
||||
rogue-agenda demo.agnd --demo
|
||||
rogue-agenda week.agnd --preset planner
|
||||
```
|
||||
|
||||
Noninteractive transfer commands are also available:
|
||||
|
||||
@@ -14,9 +14,14 @@ use crate::model::{
|
||||
};
|
||||
use crate::parser::{extract_when_configured, next_occurrence};
|
||||
|
||||
mod presets;
|
||||
|
||||
pub use presets::Preset;
|
||||
|
||||
pub struct Database {
|
||||
conn: Connection,
|
||||
path: PathBuf,
|
||||
new_document: bool,
|
||||
}
|
||||
|
||||
impl Database {
|
||||
@@ -30,6 +35,7 @@ impl Database {
|
||||
let mut db = Self {
|
||||
conn,
|
||||
path: path.to_owned(),
|
||||
new_document: !existed,
|
||||
};
|
||||
db.migrate()?;
|
||||
db.seed_defaults()?;
|
||||
|
||||
1381
src/db/presets.rs
Normal file
1381
src/db/presets.rs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@ use crossterm::{
|
||||
execute,
|
||||
terminal::{EnterAlternateScreen, LeaveAlternateScreen, disable_raw_mode, enable_raw_mode},
|
||||
};
|
||||
use db::Database;
|
||||
use db::{Database, Preset};
|
||||
use ratatui::{Terminal, backend::CrosstermBackend};
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
@@ -34,6 +34,9 @@ struct Args {
|
||||
/// Populate a new document with representative items
|
||||
#[arg(long)]
|
||||
demo: bool,
|
||||
/// Initialize a new document with a complete example workspace
|
||||
#[arg(long, value_enum, conflicts_with = "demo")]
|
||||
preset: Option<Preset>,
|
||||
/// Import a text or iCalendar (.ics) file, then exit
|
||||
#[arg(long)]
|
||||
import: Option<PathBuf>,
|
||||
@@ -58,6 +61,9 @@ fn main() -> Result<()> {
|
||||
if args.demo {
|
||||
db.seed_demo()?;
|
||||
}
|
||||
if let Some(preset) = args.preset {
|
||||
db.apply_preset(preset)?;
|
||||
}
|
||||
if let Some(import) = args.import {
|
||||
let count = db.import_path(&import)?;
|
||||
println!("Imported {count} item(s) into {}", path.display());
|
||||
|
||||
Reference in New Issue
Block a user