-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loremization #270
Comments
I added this as a "good first issue". It is pretty simple, but not THAT simple. What is needed:
There are probably lots of small details to be covered, but basically we map() the document through a loremizer, and all the text nodes (inside blocks) we go through and replace the content with suitable lorem sequence. If the sequence feels too hard, all the text blocks can be replaced e.g. sequences of some letter or "test" word (separated by space). The main thing is that the word count function returns the exact same number of the words (text, missing), and that the structure of the document is maintained. If you are interested, you can ask me more details about the buffer format, how to go through the buffer, and how to make it a new file. |
To be clear on this, the sequence of functionality/use case would look like the following:
How does this sound? I wouldn't mind any supporting information regarding buffer format and the new file functionality. I can figure it out myself, but any help is appreciated. Thanks! |
Task DescriptionUser StoryAs a writer, I want to be able to "anonymize" my document to avoid risking publication and to use actual stories as test files. Acceptance Criteria
|
Yes, that's the general plan. I update the issue description, but the general purpose for this feature is this:
This is entirely a "support" feature which is not needed for daily work. It could be good just to produce example files from WIP projects. Quick reference: Element types: https://github.com/mkoskim/mawejs/blob/master/src/document/elements.js The buffer structure is following: doc.body - Body of the story
Headers are not necessary for the first act, chapter or scene, but they are mandatory to separate those blocks from each other. Scenes have content type, and the content type is determined by the header type:
Paragraphs are elements editable with SlateJS. They have children, which are text with marks:
All the headers are paragraphs, and there are also some other paragraph types. All paragraph types:
|
I haven't think this too much, but I think that generally the feature would work bit similar way as creating new file (selecting New from menu) or importing file (selecting Import from menu). This feature creates entirely new file, but it does it by using the previous file (file in the editor) as input. It is good, that when "loremizing" the file it forgets the file name and other things, so you don't accidentially save the loremized file over the original file. New file menu item: https://github.com/mkoskim/mawejs/blob/master/src/gui/app/app.js#L400 New file creation: https://github.com/mkoskim/mawejs/blob/master/src/gui/app/context.js#L44 We might need "cmdCreateFromBuffer" so that we don't need to first convert the loremized tree to buffer, but we could set it as doc. |
Aaaand one more thing. Maybe create file "src/document/loremize.js". There could be function which takes doc as parameter, and returns a new loremized doc. That could be then tied to UI. |
@ZacharyHandel BTW, I can do those command interface things myself, and put loremize.js in the folder, if you want. That command interface (giving access from lower tree to higher parts) is bit cryptic, and I need to replace it with Redux at some point. |
For generating files for testing purposes, I could implement "loremization" feature. What this does is that it replaces all text blocks with equal amount of "Lorem ipsum", but preserves the structure and statistical info. This sort of "anonymizes" the story, so that I could put actual stories as example & test files, without risking their publicication (most writing competitions and publishers take only previously unpublished stories).
Reason: I would like to put some of my WIP (Work In Progress) stories as an examples to the repo. They can enlight people who to use different features in real world scenarios.
The problem is that writing competiotions and publishers only allow unpublished stories. If I put my actual stories to repo, I can't send them to competitions or publishers anymore (there are some exceptions, thought).
Solution: "Loremize" the story. That is, maintain its structure, but replace all the words with some nonsense. It would be good, if all the other features (like word counts) still give the same result.
This is entirely a "support" feature which is not needed for daily work. It could be good just to produce example files from WIP projects.
The text was updated successfully, but these errors were encountered: