Useless commit message

This commit is contained in:
MeowcaTheoRange 2023-01-11 19:18:47 -06:00
parent 8d9e4b1a94
commit f676378e9a
13 changed files with 271 additions and 66 deletions

25
.github/ISSUE_TEMPLATE/dau-error.md vendored Normal file
View file

@ -0,0 +1,25 @@
---
name: DAU error
about: "Since this is both a DAU and Dizzy Rewrite repository, DAU troubleshooting also goes here."
title: "[GTC] Excerpt from..."
labels: Grammar/Typo Correction
assignees: MeowcaTheoRange
---
## DAU parser command run
`
node code/filer.js master Markdown
`
## Terminal output <!-- if any -->
```
[me@computer Dizzy-Rewrite]$ node code/filer.js master Markdown
[me@computer Dizzy-Rewrite]$
```
## Operating System <!-- Windows, Mac, Linux, Github Hosted Agent, Replit.com... -->
Linux

View file

@ -12,7 +12,7 @@ assignees: MeowcaTheoRange
You can use the GitHub browser or download as ZIP to locate the path You can use the GitHub browser or download as ZIP to locate the path
--> -->
Dizzy-AU/**story/human-readable/...** Dizzy-Rewrite/**format/source/...**
## Affected excerpt <!--with typo emphasized in Markdown--> ## Affected excerpt <!--with typo emphasized in Markdown-->

4
.gitignore vendored
View file

@ -1 +1,3 @@
database.json database.json
/format/converted/
/format/source/json/

21
checklist.md Normal file
View file

@ -0,0 +1,21 @@
[x] Create formatting guide
[x] Create MD parser
[x] Create README
[] Create HTML parser (basic)
[x] Create EJS/JSON parser (automatic)
[x] Separate sentences by quotes (dialogue) and sent/recieved reciept formatting (messaging)
[x] Publish to GitHub
[] Finish rewriting the Dizzy AU story
[x] Open-source DAU so other people can use it for their stories!
[] Wattpad/AooO API? I'll have to check. Possible.
[x] Support for multiple files + command arguments?

View file

@ -51,7 +51,49 @@ var DAUConverters = {
x x
).join("") + "\n\n"; ).join("") + "\n\n";
else plctext = text + "\n\n"; else plctext = text + "\n\n";
currentExport.data[i].data += plctext.replace(/(:\/)|(\/:)/gi, "*"); currentExport.data[i].data += plctext
.replace(/((?<!\\):\/)|(\/:)/gi, "*")
.replace(/((?<!\\):\[)|(\]:)/gi, "**")
.replace(/((?<!\\):')|(':)/gi, "`")
.replace(/(\\:)/gi, ":");
});
});
});
return currentExport;
},
Plaintext (js) {
currentExport = new Export("text", ".txt");
js.forEach((chapter, i) => {
currentExport.data[i] = {
data: "",
name: chapter.name
};
currentExport.data[i].data += `${chapter.name}\n`;
if (chapter.info) {
currentExport.data[i].data += `\t`;
if (chapter.info.location) currentExport.data[i].data += `${chapter.info.location}`;
if (chapter.info.time) currentExport.data[i].data += `@${chapter.info.time}`;
if (chapter.info.time && chapter.info.location) currentExport.data[i].data += `\n`;
}
currentExport.data[i].data += `\n`;
currentExport.data[i].data += `Characters:\n`;
Object.entries(chapter.characters).forEach(([_, character]) => {
currentExport.data[i].data += `- ${character.name.join(" ")}\n`;
});
chapter.characters["%"] = narrator;
chapter.dialogue.forEach((dialogue) => {
currentExport.data[i].data += `\n${chapter.characters[dialogue.speaker].name.join(" ")}\n`;
dialogue.dialogue.forEach((text) => {
var plctext;
if (Array.isArray(text))
plctext = "\t" + text.join("") + "\n";
else plctext = "\t" + text + "\n";
currentExport.data[i].data += plctext
.replace(/((?<!\\):\/)|(\/:)/gi, "")
.replace(/((?<!\\):\[)|(\]:)/gi, "")
.replace(/((?<!\\):')|(':)/gi, "")
.replace(/(\\:)/gi, ":");
}); });
}); });
}); });

View file

@ -15,13 +15,12 @@ function TokenizeFiles(name, output) {
var folder = path.join("format", "converted", convop.folder); var folder = path.join("format", "converted", convop.folder);
var namefolder = path.join("format", "converted", convop.folder, name); var namefolder = path.join("format", "converted", convop.folder, name);
if (!fs.existsSync(folder)) fs.mkdirSync(folder); if (!fs.existsSync(folder)) fs.mkdirSync(folder);
if (!fs.existsSync(namefolder)) fs.mkdirSync(namefolder); if (!fs.existsSync(namefolder) && convop.data.length > 1) fs.mkdirSync(namefolder);
var allFileData = convop.data.map(x=>x.data); var allFileData = convop.data.map(x=>x.data);
fs.writeFileSync(path.join(folder, name + convop.extension), allFileData.join("")); fs.writeFileSync(path.join(folder, name + convop.extension), allFileData.join(""));
convop.data.forEach((data) => { if (convop.data.length > 1) convop.data.forEach((data) => {
fs.writeFileSync(path.join(namefolder, data.name.replace(/[/\\?%*:|"<> ]/g, '_') + convop.extension), data.data); fs.writeFileSync(path.join(namefolder, data.name.replace(/[/\\?%*:|"<> ]/g, '_') + convop.extension), data.data);
}) })
} }
TokenizeFiles(process.argv[2], process.argv[3]); TokenizeFiles(process.argv[2], process.argv[3]);

View file

@ -42,13 +42,13 @@ function DAUTokenizer(string) {
var temp = (string.includes("\r\n") ? string.split("\r\n") : string.split("\n")); var temp = (string.includes("\r\n") ? string.split("\r\n") : string.split("\n"));
var linearray = []; var linearray = [];
temp.forEach((v) => { temp.forEach((v) => {
if (/^\t*\S+/.test(v)) linearray.push(v.replace(/\s*$/, "")); if (/^(\t|\s\s)*\S+/.test(v)) linearray.push(v.replace(/\s*$/, ""));
}); });
for (line of linearray) { for (line of linearray) {
if (/^\? /.test(line)) { if (/^\? /.test(line)) {
var ine = line.replace(/^\? /, "").split(" :: "); var ine = line.replace(/^\? /, "").split(" :: ");
if (ine[1]) { if (ine[1]) {
ine[1] = ine[1].split(" @ "); ine[1] = ine[1].split("@");
ine[1] = {location: ine[1][0], time: ine[1][1]}; ine[1] = {location: ine[1][0], time: ine[1][1]};
} }
TokenizerCtx.currentChapter = new Chapter(...ine); TokenizerCtx.currentChapter = new Chapter(...ine);
@ -56,13 +56,13 @@ function DAUTokenizer(string) {
} else if (/^\- /.test(line)) { } else if (/^\- /.test(line)) {
var ine = line.replace(/^\- /, "").split(" :: "); var ine = line.replace(/^\- /, "").split(" :: ");
TokenizerCtx.currentChapter.characters[ine[0]] = new Character(...ine); TokenizerCtx.currentChapter.characters[ine[0]] = new Character(...ine);
} else if (/^(\t\t)|( )/.test(line)){ } else if (/^(\t\t)|(\s\s\s\s)/.test(line)){
var ine = line.replace(/^(\t\t)|( )/, ""); var ine = line.replace(/^(\t\t)|(\s\s\s\s)/, "");
var sliced = sliceDialogue(ine); var sliced = sliceDialogue(ine);
TokenizerCtx.currentDialogueBlock.dialogue.push(sliced); TokenizerCtx.currentDialogueBlock.dialogue.push(sliced);
} else if (/^(\t)|( )/.test(line)){ } else if (/^(\t)|(\s\s)/.test(line)){
var ine = line.replace(/^(\t)|( )/, ""); var ine = line.replace(/^(\t)|(\s\s)/, "");
TokenizerCtx.currentDialogueBlock = new Dialogue(ine); TokenizerCtx.currentDialogueBlock = new Dialogue(ine);
TokenizerCtx.currentChapter.dialogue.push(TokenizerCtx.currentDialogueBlock); TokenizerCtx.currentChapter.dialogue.push(TokenizerCtx.currentDialogueBlock);
} }

View file

@ -45,5 +45,5 @@ In fact, this README page you're reading was originally made in DAU. Don't belie
Anyway, you're free to use DAU to start your fictonal endeavors today. Check out [the reuse guide](/format/converted/markdown/reuse.md) for more info. Anyway, you're free to use DAU to start your fictonal endeavors today. Check out [the reuse guide](/format/converted/markdown/reuse.md) for more info.
-- By the way, DAU is licensed under the [GNU GPL v3](https*/www.gnu.org/licenses/gpl-3.0.html), but the *original contents* of the Dizzy Rewrite repository are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http*/creativecommons.org/licenses/by-nc-sa/4.0/). -- By the way, DAU is licensed under the [GNU GPL v3](https*/www.gnu.org/licenses/gpl-3.0.html), but the *original contents* of the Dizzy Rewrite repository are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http*/creativecommons.org/licenses/by-nc-sa/4.0/). What a mouthful! I hate these licenses. CC BY-NC-SA.

View file

@ -1,49 +0,0 @@
# README
Characters:
- Content Warning
- Welcome
- What is the Dizzy AU/Dizzy Rewrite?
- Hold on, what's DAU?
## Content Warning
Mature content is ahead. Please, be wary of these themes:
- Mentions of suicide/suicidal thoughts
- Depression or mentions of self-harm
- Sexual themes
- Trauma and traumatic events
- Homosexual animals.
By reading the Dizzy Rewrite, you acknowledge these warnings.
[>> Read the Dizzy Rewrite](/STORY.md)
## Welcome
Hello, welcome to the DAU/Dizzy Rewrite repository!
## What is the Dizzy AU/Dizzy Rewrite?
The Dizzy Rewrite is a *revamped* version of the original Dizzy AU story.
It's written in DAU, a new markup language made specifically for the Dizzy Rewrite.
You can find the original Dizzy AU story at [MeowcaTheoRange/Dizzy-AU](https*/github.com/MeowcaTheoRange/Dizzy-AU).
## Hold on, what's DAU?
DAU is an acronym for **"Dizzy AU"**. Pretty obvious there.
It's a markup language made for creating fictional stories in an easy-to-transport manner.
If you want to quickly whip up an HTML document and a Markdown file at the same time, you can use DAU to do so.
In fact, this README page you're reading was originally made in DAU. Don't believe me? Check out [the source file](/format/source/readme.dau).
Anyway, you're free to use DAU to start your fictonal endeavors today. Check out [the reuse guide](/format/converted/markdown/reuse.md) for more info.
-- By the way, DAU is licensed under the [GNU GPL v3](https*/www.gnu.org/licenses/gpl-3.0.html), but the *original contents* of the Dizzy Rewrite repository are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http*/creativecommons.org/licenses/by-nc-sa/4.0/).

View file

@ -76,7 +76,7 @@
"If you want to quickly whip up an HTML document and a Markdown file at the same time, you can use DAU to do so.", "If you want to quickly whip up an HTML document and a Markdown file at the same time, you can use DAU to do so.",
"In fact, this README page you're reading was originally made in DAU. Don't believe me? Check out [the source file](/format/source/readme.dau).", "In fact, this README page you're reading was originally made in DAU. Don't believe me? Check out [the source file](/format/source/readme.dau).",
"Anyway, you're free to use DAU to start your fictonal endeavors today. Check out [the reuse guide](/format/converted/markdown/reuse.md) for more info.", "Anyway, you're free to use DAU to start your fictonal endeavors today. Check out [the reuse guide](/format/converted/markdown/reuse.md) for more info.",
"-- By the way, DAU is licensed under the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.html), but the :/original contents/: of the Dizzy Rewrite repository are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/)." "-- By the way, DAU is licensed under the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.html), but the :/original contents/: of the Dizzy Rewrite repository are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/). What a mouthful! I hate these licenses. CC BY-NC-SA."
] ]
} }
] ]

View file

@ -134,7 +134,7 @@
Its attempts are futile, and Miles stays asleep. Miles wanted to set an alarm tone, but he didn't like any of the ones the system came with, and he was too lazy to make his own. Its attempts are futile, and Miles stays asleep. Miles wanted to set an alarm tone, but he didn't like any of the ones the system came with, and he was too lazy to make his own.
Finally, a call comes through. It plays a loud ringtone, notifying Miles that someone is calling him - duh. Finally, a call comes through. It plays a loud ringtone, notifying Miles that someone is calling him - duh.
Miles writhes around, opening his eyes and looking around for his phone to hopefully deny the call and head back to sleep. Miles writhes around, opening his eyes and looking around for his phone to hopefully deny the call and head back to sleep.
It's not on the coffee table, or in his hand... He looks down. It's, of course, on the floor. Miles picks up his phone, rubbing his eyes to read the text. It's not on the coffee table, or in his hand... He looks down. It's, of course, on the floor. Miles picks up his phone, rubbing his eyes to read the screen.
% %
"Silver work is calling. Swipe up to answer - Swipe down to reject" "Silver work is calling. Swipe up to answer - Swipe down to reject"

View file

@ -29,4 +29,4 @@
In fact, this README page you're reading was originally made in DAU. Don't believe me? Check out [the source file](/format/source/readme.dau). In fact, this README page you're reading was originally made in DAU. Don't believe me? Check out [the source file](/format/source/readme.dau).
Anyway, you're free to use DAU to start your fictonal endeavors today. Check out [the reuse guide](/format/converted/markdown/reuse.md) for more info. Anyway, you're free to use DAU to start your fictonal endeavors today. Check out [the reuse guide](/format/converted/markdown/reuse.md) for more info.
-- By the way, DAU is licensed under the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.html), but the :/original contents/: of the Dizzy Rewrite repository are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/). -- By the way, DAU is licensed under the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.html), but the :/original contents/: of the Dizzy Rewrite repository are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/). What a mouthful! I hate these licenses. CC BY-NC-SA.

165
format/source/reuse.dau Normal file
View file

@ -0,0 +1,165 @@
? DAU Reuse Guide
- w :: Welcome
- cls :: Starting off - Cleanup
- ctd :: Starting off - Creating the document
- wr :: Writing DAU documents - Chapters
- dl :: Writing DAU documents - Dialogue
- etf :: Writing DAU documents - Extra text formatting
- par :: Parsing DAU documents
w
So, you've decided to use DAU for your next story, huh? Well, go ahead.
It's really simple to set up and compile DAU. You can make your own parser, but a parser + converter is included for you to use.
By the way, as of right now, this parser can only compile to DAUDJSON (DAU Descriptive JSON) and Markdown.
cls
First, you need to cleanup the place.
Simply remove the :'format': folder and its contents.
Then, recreate the :'format': folder, and add a :'source': folder within.
This is the easiest way to clean up the DAU working environment.
You can put your :'.dau': files inside of :'format/source':.
ctd
Now, you have to create the document.
Go to :'format/source':, and create a new file with the :'.dau': extension.
:':':'
format/
|- source/
|- |- NewDAUFileYay.dau
':':':
You're done! Now, open the :'.dau': file in your usual text editor.
wr
DAU syntax is kinda easy to grasp.
Each file has a set of "chapters", with their own titles, locations, and even times.
:':':'
? A chapter!
- jd :: Jane Doe
':':':
First, a :'?': for telling DAU that you want to make a new chapter.
Then, you put your chapter title there. For example, :'A chapter!':.
And, if that's all you want, then you're done!
But, there are options! You can add a location, or a date and time.
If you'd like one of these, add the General Information separator, :'\:\:':.
Also, add an :'@': after your location if you want time.
Make sure to space between.
:':':'
? A chapter! :: A location! @ A time!
- jd :: Jane Doe
':':':
But, if you'd want to :/only/: add a time, you can skip out completely on the location text and just have the formatting :'\:\: @ A time!':
:':':'
? A chapter! :: @ A time!
- jd :: Jane Doe
':':':
OK, great! We have a chapter! Now, you may have noticed that there's a :'-': operator down there, instead of a :'?':.
That's a :[character defintion]:. You can also use it to define chapter headers, like in this document, but we'll keep it simple.
OK, so basically, a character definition goes like this.
:':':'
- jn :: John Doe
- jd :: Jane Doe
- bts :: Brent The Stickfigure
':':':
First, a dash, for telling DAU that you want to make a new character. :'-':
Then, a special ID you can use to quickly refer to the character later on. :'bts':
After that, add the General Information separator, :'\:\:':
And finally, the name, :'Brent The Stickfigure':.
Also, names are technically separated by spaces. They get connected together when compiled, but this could possibly be used in the future to make the creation of DAU documents even easier.
dl
DIALOGUE??? IN MY STORY??? Pah.
OK, but seriously, dialogue.
You kinda need dialogue, otherwise making chapters is pointless.
First, press :[Tab]:, to make a tabular space.
Then, type the ID of the character - :'bts':
:':':'
bts
':':':
After that, start a new line and add :[two]: :[Tab]: presses.
Then, type in your dialogue!
:':':'
bts
YO SUP I'M BRENT THE STICK MAN!!!
':':':
You can also add multiple lines of dialogue, just make sure to have two tabular spaces before each line.
:':':'
bts
YO SUP I'M BRENT THE STICK MAN!!!
MY FAVOURITE FOODS ARE GREEN AND YELLOW!!!
':':':
Then, continue for multiple characters.
:':':'
bts
YO SUP I'M BRENT THE STICK MAN!!!
MY FAVOURITE FOODS ARE GREEN AND YELLOW!!!
jd
Brent, please leave. You are interrupting the peace.
bts
NO!!!!!!!!!!!!!!!!!!!!!!!!!!
':':':
Completed file:
:':':'
? A chapter! :: @ A time!
- jn :: John Doe
- jd :: Jane Doe
- bts :: Brent The Stickfigure
bts
YO SUP I'M BRENT THE STICK MAN!!!
MY FAVOURITE FOODS ARE GREEN AND YELLOW!!!
jd
Brent, please leave. You are interrupting the peace.
bts
NO!!!!!!!!!!!!!!!!!!!!!!!!!!
':':':
etf
Hey, by the way, if you'd like to make your documents fancy, you can add "extra text formatting".
-- Invisible formatting
:[Bold]: - :'\:[text]\:':
Makes your text visibly bolder.
Use this for emphasis, maybe?
:/Italic/: - :'\:/text/\:':
Makes your text italicized.
Use this for emphasis, too.
:'Code block': - :'\:'text'\:':
Makes your text monospace, if it isn't already.
Use this for contextual stuff, or actual code.
-- Visible formatting
Escaped formatting operator - :'\\:':
Prints a single colon. You don't have to use this to write a colon, but only to negate formatting with the operator.
The :'\': should be placed directly before the colon, always!
Dialouge - "text"
Tells DAU that this piece of text is spoken.
Recieved message - << "text"
Tells DAU that this piece of text has been recieved by the protagonist within the context of the story, by any means.
Sent message - "text" >>
Tells DAU that this piece of text has been sent by the protagonist within the context of the story, by any means.
par
Great! Now, you need to parse the DAU file.
The Dizzy-Rewrite repository comes with a built-in DAU parser for your needs.
Go to the :[root]: of the repository folder, and open a terminal.
Current formats you can export to with the built-in parser:
- Markdown
- Plaintext
...sorry for the lack of output languages. More coming soon!
Type :'node code/filer.js [FILENAME WITHOUT DAU EXTENSION] [OUTPUT LANGUAGE]':
:':':'
[BRENT@STICKMAN-COMPUTER MY-STORY]$ node code/filer.js NewDAUFileYay Markdown
':':':
This should create a new folder, and add contents.
:':':'
format/
|- converted/
|- |- markdown/
|- |- |- NewDAUFileYay/
|- |- |- |- A_Chapter_.md
|- |- |- NewDAUFileYay.md
|- source/
|- |- NewDAUFileYay.dau
':':':
Inside :'format/converted/[OUTPUT LANGUAGE]': will be your output file.