mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 23:36:20 +00:00
chore: rebrand remaining Logseq references to Synapse
Describe Synapse's own Markdown dialect, export format and editor behaviour as Synapse's, rename Logseq-named history test identifiers, and set the app label/window titles to Synapse. The importer keeps its Logseq naming. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c4e9b79fa6
commit
adbbc45a56
24 files changed
+31
-31
No files matched your search
@@ -366,7 +366,7 @@ pub struct TaskSuggestion {
|
||||
}
|
||||
|
||||
impl TaskSuggestion {
|
||||
/// Logseq block content: `TODO [#A] text` plus a `DEADLINE:` line when there is a due date.
|
||||
/// Synapse block content: `TODO [#A] text` plus a `DEADLINE:` line when there is a due date.
|
||||
pub fn to_block_content(&self) -> String {
|
||||
let mut s = String::from("TODO ");
|
||||
if let Some(p) = self.priority {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Logseq task syntax <-> VTODO fields.
|
||||
//! Synapse task syntax <-> VTODO fields.
|
||||
//!
|
||||
//! ```text
|
||||
//! TODO [#A] Pay rent
|
||||
|
||||
@@ -4,7 +4,7 @@ use uuid::Uuid;
|
||||
|
||||
pub type PageId = Uuid;
|
||||
pub type BlockId = Uuid;
|
||||
/// Free-form properties (`key:: value` in Logseq).
|
||||
/// Free-form properties (`key:: value` in block Markdown).
|
||||
pub type Properties = serde_json::Map<String, serde_json::Value>;
|
||||
|
||||
pub fn new_id() -> Uuid {
|
||||
@@ -97,7 +97,7 @@ pub struct Block {
|
||||
pub parent_id: Option<BlockId>,
|
||||
/// Fractional index among siblings (see [`crate::position`]).
|
||||
pub position: String,
|
||||
/// Logseq-flavoured Markdown (rich text source of truth).
|
||||
/// Synapse outline Markdown (rich text source of truth).
|
||||
pub content: String,
|
||||
pub properties: Properties,
|
||||
pub collapsed: bool,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Extracts references from Logseq-flavoured Markdown block content.
|
||||
//! Extracts references from Synapse outline Markdown block content.
|
||||
|
||||
use crate::model::RefKind;
|
||||
use uuid::Uuid;
|
||||
|
||||
@@ -67,7 +67,7 @@ impl SynapseGraph {
|
||||
}
|
||||
|
||||
/// Shift-Tab: the block moves right after its parent, adopting its following siblings as
|
||||
/// children so it keeps its visual place (Logseq's default outdenting).
|
||||
/// children so it keeps its visual place (direct outdenting).
|
||||
pub fn outdent_block(&self, id: String) -> Result<Vec<BlockDto>> {
|
||||
let g = self.lock();
|
||||
let b = get(&g, parse_id(&id)?)?;
|
||||
|
||||
@@ -45,7 +45,7 @@ fn indent_and_outdent_keep_visual_order() {
|
||||
assert_eq!(shape(&rows), vec![(0, "a"), (1, "b"), (1, "c"), (1, "d")]);
|
||||
assert!(rows[0].has_children);
|
||||
|
||||
// Outdenting `c` adopts `d` as its child (Logseq's direct outdenting).
|
||||
// Outdenting `c` adopts `d` as its child (direct outdenting).
|
||||
let rows = g.outdent_block(ids[2].clone()).unwrap();
|
||||
assert_eq!(shape(&rows), vec![(0, "a"), (1, "b"), (0, "c"), (1, "d")]);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Deterministic Logseq-compatible Markdown export of pages.
|
||||
//! Deterministic Markdown export of pages.
|
||||
//!
|
||||
//! Layout: `pages/<encoded title>.md`, `journals/YYYY_MM_DD.md`, `assets.json`.
|
||||
//! A page file starts with page properties (`key:: value`, aliases as `alias:: a, b`),
|
||||
@@ -26,7 +26,7 @@ pub const TAGS_PROP: &str = "synapse-tags";
|
||||
/// Page property with the type names (`synapse-types:: persona, lugar`).
|
||||
pub const TYPES_PROP: &str = "synapse-types";
|
||||
|
||||
/// Encodes a page title as a file name (Logseq "triple-lowbar" format: `/` becomes `___`,
|
||||
/// Encodes a page title as a file name ("triple-lowbar" format: `/` becomes `___`,
|
||||
/// characters illegal on Windows and `%` are percent-encoded).
|
||||
pub fn encode_title(title: &str) -> String {
|
||||
let mut out = String::with_capacity(title.len());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Parser for the Markdown files produced by [`crate::export`] (and plain Logseq pages).
|
||||
//! Parser for the Markdown files produced by [`crate::export`] (and plain outline pages).
|
||||
|
||||
use crate::export::{DESCRIPTION_PROP, HUBS_PROP, KIND_PROP, TAGS_PROP, TYPES_PROP, parse_value};
|
||||
use serde_json::Value;
|
||||
@@ -224,7 +224,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn logseq_space_indent() {
|
||||
fn space_indent() {
|
||||
let p = parse_page("- a\n - b\n - c\n - d\n");
|
||||
let d: Vec<_> = p.blocks.iter().map(|b| b.depth).collect();
|
||||
assert_eq!(d, [0, 1, 2, 1]);
|
||||
|
||||
@@ -26,7 +26,7 @@ fn at(g: &Graph, ms: i64) {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn export_is_deterministic_and_logseq_shaped() {
|
||||
fn export_is_deterministic_and_outline_shaped() {
|
||||
let (_d, g, _h) = setup();
|
||||
let p = add(&g, "Project/Alpha", &["first", "second"]);
|
||||
let first = g.page_tree(p.id).unwrap()[0].1.clone();
|
||||
|
||||
Reference in new issue
Block a user