tiny gamemaking tool using the html details tag 💙 likely fragile, be nice to it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

  1. # details
  2. this is a tiny twine-like gamemaking tool using the html details tag.
  3. ## how to use
  4. to use this tool, you'll need rustc and cargo, which you can download [at the rustlang website](https://rust-lang.org). clone this repo, navigate to it, and run
  5. ```
  6. cargo run path/to/detail/file
  7. ```
  8. to generate an html file.
  9. (sorry you have to download a whole programming language to compile ~200 lines of code. tk: web tool to facilitate this?)
  10. ## markup
  11. `~title write the title of your game`: this will show up as the page title.
  12. `~detail start`: this is where your game will start. required.
  13. `~detail name of a detail`: starts a new detail passage. name can't include the characters `|` or `~`.
  14. `|name of a detail|`: inserts the text wrapped in `|` as the summary of a `<details>` tag, and the contents of the `~detail` passage of the same name as its contents.
  15. `|display text~name of a detail|`: the same as above, except the text before the `~` will be displayed as the summary instead of the passage name. display text can't contain the character `|` (but `~` is okay)
  16. you can use markdown in passage text---whatever's supported by [this markdown crate](https://crates.io/crates/comrak). this is meant to be a _simple_ way of marking up passages. raw html is supported.
  17. ## example
  18. a detail file with the following text:
  19. ```
  20. ~title cat story
  21. ~detail start
  22. the |cat| sat on the mat
  23. ~detail cat
  24. the cat was very |pretty~pet| and has green eyes
  25. ~detail pet
  26. you pet the cat! it _purred_ pleasantly
  27. ```
  28. will output this:
  29. <p>the</p>
  30. <details><summary>cat</summary><p>the cat was very</p>
  31. <details><summary>pretty</summary><p>you pet the cat! it <em>purred</em> pleasantly</p>
  32. </details><p>and has green eyes</p>
  33. </details><p>sat on the mat</p>
  34. ## inspirations/influences
  35. - [twine](https://twinery.org)
  36. - [tracery](http://tracery.io)
  37. - [soft corruptor](http://cordite.org.au/poetry/game/soft-corruptor/)