Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,18 @@ The first stage of the project is to create a simple file browser like applicati
- [ ] View Mode: Hides placeholder grids and no interaction
- [ ] View Mode: Hide autocomplete
- [ ] View Mode: Fix: Link should be clickable
- [ ] Remote URL
- [ ] Local Files/ Relative Paths
- [x] View Mode: Fix layout/ spacing when image or banner is gone.
- [ ] Fix: Control + click for local file links not working.
- [ ] Remove: Control + click.
- [ ] Implement Rust path normalization in workspace and record
- [ ] Autocomplete should fill encoded paths (e.g. space should become `%20`)
- [x] Refactor workspaces to scale more easily

### `v0.0.0-dev10`

- [ ] Client Documentationn (Types, Github CI)
- [ ] Client Documentation (Types, Github CI)
- [ ] [clean-jsdoc-theme](https://www.npmjs.com/package/@clean-jsdoc-theme/typedoc)
- [ ] Remove Naive UI dependency and implement custom vue components
- [ ] Expand Footer with Source mode.
- [ ] Source Mode: Raw source of the file, only when MIME type is not a binary.
Expand All @@ -124,6 +129,9 @@ The first stage of the project is to create a simple file browser like applicati

- [ ] Define CSS variables, modularize CSS
- [ ] Add UX to move banner offset in edit mode. (scroll, zoom)
- [ ] Add infoboxes
- [ ] Infobox Definition Component: Table, Attributes, Types
- [ ] Values stored `config.json`, as well as relative component definition path.

### `v0.0.0-dev13`

Expand Down
80 changes: 45 additions & 35 deletions torii-desktop/src/recent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::{fs::File, io::ErrorKind, path::PathBuf};
use tauri::{AppHandle, Manager, path::BaseDirectory};
use tauri::{AppHandle, Manager};

/// The path to the file where recent projects are stored. This is a JSON file
/// that contains an array of `RecentProjectMetadata` objects. The parent is
Expand Down Expand Up @@ -34,6 +34,14 @@ pub struct RecentProjectMetadata {
pub last_opened: u64,
}

/// This is used for example workspaces.
#[derive(Serialize, Deserialize, Debug)]
struct ExampleWorkspace {
pub name: String,
pub path: PathBuf,
pub release: bool,
}

/// Gets the current time in milliseconds since the Unix epoch. This is used to
/// set the `last_opened` field of the `RecentProjectMetadata` struct when a project
/// is added to the list of recent projects.
Expand Down Expand Up @@ -79,45 +87,47 @@ impl RecentProjectMetadata {
pub async fn get_extended(app: AppHandle) -> Result<Vec<Self>, String> {
let mut projects = Self::get(app.clone()).await?;

if cfg!(dev) {
// If we are in development mode, link the `torii-example` demo workspace. This
// Torii project is version tracked in this repository and shared with collaborators.
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
// Parse the definition of example workspaces
const WORKSPACE_CONFIGURATION: &str = include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../torii-workspaces/workspaces.json"
));
let example_projects: Vec<ExampleWorkspace> = serde_json::from_str(WORKSPACE_CONFIGURATION)
.expect("configuration file `workspaces.json` should be valid JSON");

// If we are in development mode, link the `torii-example` demo workspace. This
// Torii project is version tracked in this repository and shared with collaborators.
#[cfg(dev)]
let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();

// If we are in production mode, we want to link only the "Torii Welcome" workspace,
// by adding it to the list of recent projects. The welcome workspace is stored in
// resources.
#[cfg(not(dev))]
let release_example_workspace =
match app.path().resolve("workspaces", BaseDirectory::Resource) {
Ok(o) => o,
_ => return Ok(projects),
};

for p in example_projects.iter() {
if cfg!(not(dev)) && !p.release {
continue;
}

#[cfg(dev)]
let full_path = PathBuf::from(&manifest_dir)
.join("../torii-workspaces")
.join(&p.path);
#[cfg(not(dev))]
let full_path = release_example_workspace.join(&p.path);

// Link demo workspaces for development purposes.
projects.push(RecentProjectMetadata {
name: "Torii Welcome".to_string(),
path: PathBuf::from(&manifest_dir).join("../torii-workspace-welcome"),
is_system: true,
last_opened: 0,
});
projects.push(RecentProjectMetadata {
name: "Torii Contributors".to_string(),
path: PathBuf::from(&manifest_dir).join("../torii-workspace-contrib"),
is_system: true,
last_opened: 0,
});
projects.push(RecentProjectMetadata {
name: "Torii Dev Tests".to_string(),
path: PathBuf::from(&manifest_dir).join("../torii-workspace-dev"),
name: p.name.to_string(),
path: full_path,
is_system: true,
last_opened: 0,
});
} else {
// If we are in production mode, we want to link only the "Torii Welcome" workspace,
// by adding it to the list of recent projects. The welcome workspace is stored in
// resources.
app.path()
.resolve("workspace-welcome", BaseDirectory::Resource)
.map(|welcome_dir| {
projects.push(RecentProjectMetadata {
name: "Torii Welcome".to_string(),
path: welcome_dir,
is_system: true,
last_opened: 0,
});
})
.unwrap_or(());
}

Ok(projects)
Expand Down
4 changes: 3 additions & 1 deletion torii-desktop/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"debugApplicationIdSuffix": ".debug"
},
"resources": {
"../torii-workspace-welcome/": "workspace-welcome/"
"../torii-workspaces/welcome": "workspaces/welcome/",
"../torii-workspaces/writing-theory": "workspaces/writing-theory/",
"../torii-workspaces/workspaces.json": "workspaces/workspaces.json"
}
}
}
15 changes: 15 additions & 0 deletions torii-workspaces/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Torii Workspaces

This folder contains all example workspaces, which will be visible when running the Torii application.

### Contributing (New Files)

If you want to contribute new records to existing workspaces, just run Torii in development mode and edit the files. Git will automatically track the file changes.

### Contributing (New Workspaces)

Usually there is no need to create new workspaces, but for the rare case when a new workspace is needed, please be aware to change the following:

- Create a new directory in this folder.
- In [workspaces.json](./workspaces.json), add a new entry for the workspace, giving it a name and the name of the newly created folder. If this repository should only be visible in dev builds, the `release` attribute should be `false`.
- If this workspace for some reason needs to end up in the release build, you need to link the newly created workspace in [tauri.conf.json](../torii-desktop/tauri.conf.json) as a resource. The repository is not copied to the workspace resources per default.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions torii-workspaces/workspaces.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"path": "welcome",
"name": "Torii Welcome",
"release": true
},
{
"path": "contributors",
"name": "Torii Contributors",
"release": false
},
{
"path": "writing-theory",
"name": "Writing Theory",
"release": true
},
{
"path": "dev-tests",
"name": "Torii Dev Tests",
"release": false
}
]
15 changes: 15 additions & 0 deletions torii-workspaces/writing-theory/Plot Structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Plot Structure

This section gives the analysis and some short summaries for different mainstream plot structures. They can be used strictly, as reference, de- and reconstructed or completely ignored. The subsections are divided by general theory/ guides and analysis of the plot structure of specific shows.

### Theory

- [40 Chapter Outline](./Plot%20Structure/40%20Chapter%20Outline.md) by [TheNerdyNovelist](https://www.youtube.com/@TheNerdyNovelist).

### Analysis

- TBA



&nbsp;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 40 Chapter Outline

This document summarizes the 40 chapter plot structure for stories as discussed in ["The Only Plot Structure You Will Ever Need"](https://www.youtube.com/watch?v=vAbMAzhFiGc) by [TheNerdyNovelist](https://www.youtube.com/@TheNerdyNovelist).

- [Act 1](./40%20Chapter%20Outline/Act%201.md) - **Introduce the protagonist and ordinary world** they live in, their goals, flaws and the inciting incident that makes them leave their ordinary world.
- [Act 2A](./40%20Chapter%20Outline/Act%202A.md) - First half of the middle section, showing a positive rising action as the **protagonist enters new world**, learns, grows and has more success than failure.
- [Act 2B](./40%20Chapter%20Outline/Act%202B.md) - Second half of the middle section, reversal of 2A with negative rising action as the **protagonist struggles and things start to fall apart**.
- [Act 3](./40%20Chapter%20Outline/Act%203.md) - Climax of the story where the **protagonist confonts their inner flaw** and overcomes it, allowing them to defeat the antagonist "despite all odds"

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Act 1

Introduce the protagonist and ordinary world they live in, their goals, flaws and the inciting incident that makes them leave their ordinary world.



**0. Prologue** (optional)
Starts with an **opening image setting the tone and genre of the story**, shows how the world we're in is in trouble. Represents central conflict. Doesn't have to be about protagonist.



**1. Really Bad Day** (protagonist general intro)
We get introduced to the protagonist and the "ordinary world", this should be done through a **lense which visually represents as much as possible about the protagonist**. The protagonist wants something, a "solution" (doesn't need to relate to plot), that will 'fix' their life, but there's an obstacle preventing it from happening (= really bad day). We learn the character's flaw, the thing that preventing them from getting to the "solution". The protagonist gets a "save the cat" moment to become likable (act of kindness, humor, competence, sympathy through oppression, etc.), despite being flawed.



**2. Mystery and Theme** (protagonist flaw intro)
Introduce an event foreshadowing future events and **"stating" the flaw of the protagonist** (e.g. character flaw: they don't take themself too serious, then the theme is stated by another person saying: you're too hard on yourself, the "theme" = "life lesson" is ignored by protagonist).
The protagonist is "stubborn" and has **distractions that prevent protagonist from understanding consequences** of the event, we learn more unresolved emotional struggles of protagonist that highlight source of their flaws.



**3. Link to Antagonist** (relation to antagonist discovery)
Protagonist discovers link to antagonist (more than regular citizen, **"unique" connection to antagonist which cannot be ignored**). Something happens to the protagonist, a challenge, threat or opportunity (e.g. treasure map, Aang learning his forsakening of the Avatar duty led to catastrophic results): The two become linked.



**4. Grasping the Straws** (**resisting** relation to antagonist)
The **urge for the protagonist to go on an "adventure" grows**, stronger glimpse at characters' flaw as they criticize the world they live in. They are **not yet fully honest about what they need**. (e.g. Zuko and his boyfriend Honour)



**5. Stasis is Death** (**motive to go for adventure**)
Here the protagonist realises that inaction is very bad (e.g. Frodo learns from Gandalf he has the One Ring). Here we learn that protagonist will die (literally, metaphorically, rhetorically, symbolically, theoretically) or never be happy (unfulfilled). This scene sums up what we learned in previous chapters.



**6. Inciting Incident** (drama)
Something dramatic happens to upset the status quo in the ordinary world, lots of conflict and the disruption is something that cannot be resolved on its' own. This should impact the protagonist deeply, but not enough for protagonist to willingly leave ordinary world yet.



**7. The Call to Adventure** (second motive to go for adventure)
The protagonist is forced into a situation where they have no choice but to focus on the new issueses arising and the immediate fallout of the inciting incident. The call to adventure should get in the way of protagonists previous plans and goals.

*With the characters and their flaws, how does protagonist react to the flaw? How do they begin to push back against it? What is the protagonists' emotional state in the light of the call? Are they mad or depressed over having their original plans foiled?*



**8. Meeting the Mentor** (understanding the journey)
A mentor enters protagonists' life (doesn't have to be a person, can be information, etc.) encouraging protagonist to take action and heed the call to adventure. The mentor gives protagonist the right tools, training, information or support that they will need. The mentor gives first hint of protagonists' fatal flaws, but protagonist doesn't realize or ignores it.



**9. Refusal of the Call** (emotional climax)
Protagonists' last refusal to deal with adventure and accepts reality (e.g. Bilbo understands he could die on the adventure). Intrigue, tension, mystery, maybe even supernatural events are building up, and protagonist tries their best to ignore. Protagonist begins to build regret and doubt and is increasingly unable to remain inactive.



**10. Pull Out the Rag** (negative)
Protagonist tries to fix issueses of ordinary world in order to resist call for adventure, something happens that pulls the rug out of them and sends them to a point of no return: They are forced to act (e.g. kidnapping, death, in JJBA III. Jotaro discovers his mother is ill and has to go for Dio). This scene should hook the reader showing that the stakes are high: The protagonist must take the mission or fall, as the event is personal, forcing the protagonist to get involved even if they do not want to (e.g. Frodo thinks he has to do the Quest alone, but is afraid to do so and he meditates at the Falls of Rauros).

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Act 2A

First half of the middle section, showing a positive rising action as the protagonist enters new world, learns grows and has more success than failure.



**11. First Plot Point** (decision to go for adventure)
Protagonist actively choses to enter new world and its' comfortable (it can literally be new environment, but also something like change of setting, eg. trying something new). This is a big turning point in the story. There's no going back at this point in the story. The protagonist still has flaws, but is trying to fight the challenges of the new world.



**12. Enemies &amp; Allies** (introduce cast remains)
We get a sense of the new life in the new world as the protagonist feels like a fish out of water and their new role is established. Any remaining characters should be introduced here, as well as character archetypes like love interest or ally, at least one of them representing the B story. Often there can be conflicts with these characters from whome protagonist faces antagonism.



**13. The B Story** (working on the flaw)
Protagonist spends time with B story character, where the B story character figuratively holds mirror to protagonist (e.g. Zuko to Zhao, Aang to Zuko, Strider to Nazgul, Frodo to Gollum). Explained why protagonist can't go back and given reasons to continue. (e.g. Frodo learning of what could happen in Galadriels' mirror). The theme is again restated here, but protagonist yet refuses to learn (e.g. Iroh repeatedly offering Zuko "calming" theme, to which he "angrily without thinking" responds)



**14. Games &amp; Trials**
Some of the more interesting things the new world offers are presented. The protagonist explores the new world and learns to navigate it, they receive some form of training and grow from it (e.g. as a form of a challenge, where even losing makes the protagonist understand new things = grow)



#to-do



**15. No More Games**
#to-do



**16. Earning Respect**
#to-do



**17. First Pinch Point**
#to-do



**18. Problem Revealed**
#to-do



**19. Truth &amp; Ultimatum**
#to-do



**20. Midpoint**
#to-do

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Act 2B

Second half of the middle section, reversal of 2A with negative rising action as the protagonist struggles and things start to fall apart.



**21. External Demons Close In**
#to-do



**22. Things Get Worse**
#to-do



**23. Internal Demons Close In**
#to-do



**24. Plan of Attack**
#to-do



**25. Crucial Role**
#to-do



**26. Second Pinch Point**
#to-do



**27. All Is Lost**
#to-do



**28. Shocking Revelation**
#to-do



**29. Giving Up**
#to-do



**30. Pep Talk**
#to-do

Loading
Loading