diff --git a/lib/tcmd/TokenIdentifiers.tsx b/lib/tcmd/TokenIdentifiers.tsx index 6bdaf69..1e2848d 100644 --- a/lib/tcmd/TokenIdentifiers.tsx +++ b/lib/tcmd/TokenIdentifiers.tsx @@ -104,7 +104,7 @@ export const buildOnlyDefaultElements = () => { debugger; return ( - {t.content.replaceAll("\\n", "\n")} + {t.content.replaceAll(/\\n ?/g, "\n")} ); }); @@ -509,9 +509,9 @@ export const buildOnlyDefaultElements = () => { }, ); - registerIdentifier("p", /(?<=\n\n)([\s\S]*?)(?=\n\n)/g, (s, rx) => { + registerIdentifier("p", /(?<=\n\n)([\s\S]*?)(?=\n\n)/g, (s) => { return { - content: s, + content: s.replace("\n", " "), raw: s, metadata: {}, uuid: crypto.randomUUID(), diff --git a/lib/tcmd/index.ts b/lib/tcmd/index.ts index ccb1ba8..7d6f869 100644 --- a/lib/tcmd/index.ts +++ b/lib/tcmd/index.ts @@ -11,6 +11,8 @@ export const createElements = (body: string): Token[] => { const tokenize = (body: string) => { const tokenizedBody: TokenMarker[] = []; + body = body.replaceAll(/[ \t]+\n/g, "\n"); + const addToken = (thing: TokenMarker) => { tokenizedBody.push(thing); }; @@ -154,7 +156,7 @@ const contentToChildren = (token: Token) => { token.children = zipArrays( content.split(splitMarker).map((c): Token => ({ - content: c.replaceAll("\n", ""), + content: c.replaceAll("\n", " "), metadata: {}, raw: c, type: token.rendersChildrenOnly ? "p" : "text", @@ -164,7 +166,7 @@ const contentToChildren = (token: Token) => { children: token.rendersChildrenOnly && c.replaceAll("\n", "") ? [ { - content: c.replaceAll("\n", ""), + content: c.replaceAll("\n", " "), metadata: {}, raw: c, type: "text", diff --git a/md/home.md b/md/home.md index 413a4e9..9075922 100644 --- a/md/home.md +++ b/md/home.md @@ -1,11 +1,14 @@ [[ -Tabletop Commander (TC) is a rules-and-tools app for tabletop games - board, card, war, role-playing, you name it! It is the spiritual successor of Chapter Master by Emmaline Autumn, a Warhammer 40,000 9th Edition rules reference and game helper. +Tabletop Commander (TTC) is a rules-and-tools app for tabletop games - board, card, war, role-playing, you name it! It is the spiritual successor of Chapter Master by Emmaline Autumn, a Warhammer 40,000 9th Edition rules reference and game helper. Emma decided to move on from Chapter Master as her interest in 40k was supplanted by the greater wargaming hobby after the release of 10th edition made clear that Chapter Master was too inflexible and tedious to work on. -See, Emma had a vision that anyone could contribute to making rules corrections so that anyone could have all of the rules as they currently exist. This ballooned into the idea that you could have all the rules as they existed at *any time* -]] +See, Emma had a vision that anyone could contribute to making rules corrections so that anyone could have all of the rules as they currently exist. This ballooned into the idea that you could have all the rules as they existed at *any point in time.* As soon as she realized that every code change either needed to keep that backward compatibility in mind or would cause the data to no longer be usable, she decided to drop Chapter Master entirely. + +It didn't sit right with her. A big project no longer being worked on and a dead dream. Enter Tabletop Commander. Inspired by the flexibility of Battlescribe and disappointed in its features and lack of updates, Emma started designing a new system, from the ground up, that can be used to build almost anything. + +]] [][][] @@ -13,7 +16,7 @@ See, Emma had a vision that anyone could contribute to making rules corrections ### Game Systems -The basis of TC is called a Game System Package. This package +The basis of TTC is called a Game System Package. This package includes everything needed for a game system, including schemas, publications, and tools. Players can follow a Game System to get consistently updated content publications, or fork it to @@ -41,18 +44,18 @@ enough approvals, you can even be the one to merge it in! ### Schemas Those who have studied English or databases, you would know that -a schema is a structural pattern. TC aims to provide a simple, +a schema is a structural pattern. TTC aims to provide a simple, user-edited and maintained schema system for *any* game. -If that flew over your head, don't worry. Others can share -the schemas they've made with everyone, which come as part +If that flew over your head, don't worry. Others can share +the schemas they've made with everyone, which come as part of a Game System package that you can fork or follow to get both content and schemas ready to use. **For the techies:** - + The schema system makes use of a powerful custom query language -(tcQuery) I designed. By writing queries directly into the +(ttcQuery) I designed. By writing queries directly into the schema, we can reduce the amount of re-written content, while maintaining the presence of data anywhere we need it. @@ -65,7 +68,7 @@ maintaining the presence of data anywhere we need it. ### Publications Publications are the actual content of the rules. They -don't just contain the content, but also the style in which +don't just contain the content, but also the style in which the content is shown. Content can include text, images, and even video (through @@ -75,7 +78,7 @@ parts of the publication through context based pop-overs. **For the techies (again):** Publications use an enhanced markdown syntax (ttcMD) that -implements tcQuery, and adds a bit of custom syntax for things +implements ttcQuery, and adds a bit of custom syntax for things like pop-overs and styling hints for rendering. The styling aspect is similar to a very trimmed down CSS, but