naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.08k stars 326 forks source link

Add a "Lorem Ipsum" brew generator for development purposes #1916

Open Gazook89 opened 2 years ago

Gazook89 commented 2 years ago

Just a sliver of an idea here: When doing development stuff for HB, whether that is changes to the actual program or just making themes, it is common to need a basic brew to test changes against. For myself I just quickly type some junk into a brew, add a few pages, throw some snippets in, etc. However, because of the haphazardness of this approach it is easy to miss cases. Also, it still does take a little time to keep making those test documents.

I thought it'd be nice to have a "filler brew" generator that would streamline this process. Initially right now I am imagining a browser extension(?) that looks similar to OpenLorem. You'd be able to choose what types of elements you want (lists, headers, stat blocks, etc), if it should have a cover page and table of contents, etc. And how many pages you needed up to some max like 10.

Further, a 'default' option that is standardized and includes an example of each element which is useful for creating and comparing themes.

G-Ambatte commented 2 years ago

Word has a =lorem() function; as I understand it, lorem : function(paragraphs, sentences) {} will create paragraphs number of paragraphs, each containing sentences number of sentences.

This seems like it would be a very sensible format to follow.

calculuschild commented 2 years ago

What about instead a standard "test" document? We could give it a special link and have it operate similar to the homepage or v3_preview, and just have pages pre-populated with a few pages and several combinations of paragraphs and snippets?

Gazook89 commented 2 years ago

I think that is good enough for the scope of the site. Anything further can be made as a third party tool

G-Ambatte commented 2 years ago

If I have transcribed it correctly, the following text is the original Lorem Ipsum, according to Wikipedia:

Lorem ipsum dolor sit amet consectetur adipiscing elit, sed do eius modi tempora incididunt, ut labore et dolore magnam aliqua. Ut enim ad minima veniam, quis nostrumd exercitation ullam co laboris, nisi ut aliquid ex ea commodi consequat? Duis aute iure reprehenderit, in voluptate velit esse, cillum, dolore eu fugiat nulla pariatur? Excepturi sint, obcaecati cupiditate non provident, sunt in culpa, qui officia deserunt mollitia animi, id est laborum.

Alternatively, we could add an additional dependency and just incorporate the NPM package lorem-ipsum.

ericscheid commented 2 years ago

I can imagine two alternative solutions here:

  1. a snippet or two that can be selected from the editor menus ("Insert Lorem Ipsum ¶", "Insert Lorem Bullets", etc)
  2. some special markup code that can be typed (or inserted via a snippet) that gets intepreted at render time. Something like [[=lorem(p,5,20)]] or similar. The exact syntax to be argued later [1].

Here's a mockup of item-2 above: image

[1] The exact syntax should tie in with how variables #1400 are done, and likely won't use [[double-bracket-syntax]] as that collides with markdown links.


Do The Simplest Thing That Could Possibly Work ..

  1. a snippet that inserts a stock text, no variability
  2. a snippet that inserts lorem text, the exact text being randomised (like we do with some other snippets)
  3. a snippet that pops a dialog asking how many words, how many paragraphs, then inserts as above (cv #1870)
  4. variation snippets that insert bullet lists or number lists (or options in thing#3 above)
  5. overload a (future implemented) insert-variable syntax to include a =lorem(type, *qty, *length, *max-length) function
Gazook89 commented 1 year ago

I'm going to close this because ideally most users aren't swinging to the HB to generate gibberish documents. For someone like me, who is just creating demonstration documents to help others, there are many lorem ipsum browser/OS plugins to do this with (OpenLorem is a FF extension, and if on mac, there is a Raycast extension for lorem ipsum.

ericscheid commented 1 year ago

It's more a helpful tool in the early drafting stages, where an author is blocking out the shape of a page and testing the formatting. I agree that publishing blocks of lorem ipsum text would rarely be the ultimate end intention.

As precedent, many of our various snippet generators also use nonsensical dummy text. We don't expect those to be intentionally published.

There are indeed 3rd party tools for generating lorem ipsum. I use them. Switching to a 3rd-party tool to generate is however counter to the point of quickly blocking out shapes of text and is a nuisance.

Re-opening as P3: Low Priority.

Gazook89 commented 1 year ago

Switching to a 3rd-party tool to generate is however counter to the point of quickly blocking out shapes of text and is a nuisance.

Ah, but on mac you should get raycast! cmd + spacebar, type "L", "10", "Enter" and you have 10 paragraphs of lorem ready to go on your clipboard.

5e-Cleric commented 1 year ago

I would go with what Calculuschild suggested, a test page, maybe /test/new, saved the same way as the new brew is, and be purged after a few days, just for testing CSS with a reference brew.

ericscheid commented 1 year ago

There are two issues here:

  1. a test brew for testing css & dev changes
  2. a lorem ipsum tool for authors