···33Task-level metadata requires Linux's xattr(7) API and a filesystem that supports
34it. Patches that implement this for other operating systems are welcome.
3500036Building
37--------
3839-```shell
40cargo install --path .
41```
42···154155Additionally, it should be similar enough to Markdown such that it is easy to
156export to other applications, as outlined above in the roadmap.
00000000000157158A core feature of the format is *linking*. That is, references to other tasks
159utilizing wiki-link style links: `[[]]`. The content within the link is mapped
···33Task-level metadata requires Linux's xattr(7) API and a filesystem that supports
34it. Patches that implement this for other operating systems are welcome.
3536+tsk expects to run on POSIX-like systems. Microsoft Windows and other
37+non-UNIX-ey operating systems will never be directly supported.
38+39Building
40--------
4142+```sh
43cargo install --path .
44```
45···157158Additionally, it should be similar enough to Markdown such that it is easy to
159export to other applications, as outlined above in the roadmap.
160+161+Meanwhile, both Markdown and scdoc have some limitations and make choices that,
162+while appropriate for their domain, are not appropriate for tsk. Some notable
163+differences from both:
164+165+- There is only one way to do any type of formatting
166+- Hard line breaks are real, not imaginary
167+- Most formatting does not cross line boundaries (literal blocks are an
168+ exception)
169+- Parseable with a context-free grammar
170+- Inline formatting control characters must be surrounded by white-space
171172A core feature of the format is *linking*. That is, references to other tasks
173utilizing wiki-link style links: `[[]]`. The content within the link is mapped
···1+#![allow(dead_code)]
2+use url::Url;
3+4+use crate::workspace::Id;
5+6+/// An AST node parsed from the plain-text representation of
7+enum TaskASTNode<'n> {
8+ /// Unmodified text
9+ Plain(&'n str),
10+ /// Text that has been highlighted using =test= syntax.
11+ Highlight(Box<TaskASTNode<'n>>),
12+ /// A standard Markdown-style link
13+ Link {
14+ text: Box<TaskASTNode<'n>>,
15+ to: Url,
16+ },
17+ /// An internal link to another task using custom [[tsk-id]] syntax
18+ InternalLink(Id),
19+ /// Italicized text using Markdown *text* syntax.
20+ Italics(Box<TaskASTNode<'n>>),
21+ /// Bolded text using !text! syntax.
22+ Bold(Box<TaskASTNode<'n>>),
23+ /// Underlined text using custom _text_ syntax.
24+ Underline(Box<TaskASTNode<'n>>),
25+ /// Strikethrough using -text- syntax
26+ Strikethrough(Box<TaskASTNode<'n>>),
27+ /// Unordered list using Markdown * list-item syntax
28+ UnorderedList(Vec<TaskASTNode<'n>>),
29+ /// Ordered list using Markdown 1. list-item syntax
30+ OrderedList(Vec<TaskASTNode<'n>>),
31+ /// Literal block using markdown triple-backtick syntax.
32+ Block {
33+ /// An optional syntax specifier. This *may* be used to apply syntax formatting to contents
34+ /// in the future
35+ syntax: Option<&'n str>,
36+ /// The verbatim content of the block
37+ content: &'n str,
38+ },
39+ /// Literal block using markdown single-backtick syntax.
40+ InlineBlock(&'n str),
41+ /// Blockquotes using Markdown > quote syntax
42+ Blockquote(&'n str),
43+}
44+45+impl<'i> TaskASTNode<'i> {
46+ fn parse(s: &'i String) -> Result<Vec<TaskASTNode<'i>>, String> {
47+ let i = 0;
48+ let mut roots: Vec<TaskASTNode<'i>> = Vec::new();
49+50+ todo!();
51+ }
52+}
···216 return Ok(());
217 }
218219+ // unwrap is ok here because we checked above
220 stack.push(second.unwrap());
221 stack.push(top.unwrap());
222 stack.push(third.unwrap());