decide-mode
decide-mode copied to clipboard
Org-mode support
I think it would be really useful to be able to build named org-mode tables and then roll from them with decide-mode. I have been tinkering around with this idea. Currently I have a bit of elisp which can take a filename, and an olp list (which is basically just a list of headers as strings) and will parse an org-mode table immediately following the header into an elisp structure that can be used by decide-mode for table rolling. This is pretty cool but there remain some issues:
- There is no centralized table registry, so recursive interpolation is not possible
- The current syntax for referencing other tables in an entry is too simple for specifying a filename and olp path which is what we'd for recursive interpolation.
There are a couple solutions to this:
- Implement #8 which improves the syntax for interpolation tokens inside strings
- Support just a single org-file where tables are looked for
- Support a list of org-files which will be searched for olp paths
- Keep a similar system to what is current in place, by offering a defvar which a user specifies named tables, but instead of including the entries right there, instead a filename+olp is provided.
The last item is probably the most backwards compatible in that, we could probably retain support for existing decide-tables and introduce some kind of value which if it appears as the second value, we interpret it as an org-mode table:
(setq decide-tables '(
("foo-table" "foo" "bar" (3 . "baz"))
("org-table" :org "~/tables.org" "table collection 1" "some table"))
This also alleviates the need to implement #8 since the user is still required to give every table a simple name. However, it reduces the usefulness because you always need to swing back and add the table to this registry. If there was a solution such that the org-files themselves were the source of truth that would be ideal.
Yes! I had this idea as well, to use an org table as a decide table. My idea was that if the first cell in the first row can be parsed as a dice-spec then the first column is expected to be numbers/ranges to match that, to mak conversations to/from real rpgs for instance easier. But other variants could be supported as well depending on what is in the first row for instance
Org tables can have names, so it should be possible to refer to them and configure what files to use.
Another thing I never got around to, but would be happy to merge.
I am not sure I would use full specifiers with filenames much. Rather trust that tables all have unique names and have a list of files to search for giveb names. Unless filename+name is some standard thing in org that it would be good to stick to?
Integration with babel would be very useful as well, and make sure that integration with various template-systems works so it is possible to quickly insert larger chunks of text with some random content (see some more ramblings about that in #8 .