-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
Restructuring Rules.json #463
Comments
I assume that I've also been wondering in the back of my mind about the distinction between the two tables. |
I really like this proposed structure, and I think breaking the rules sections down into smaller, bitesize pieces makes a lot of sense. I think bidirectional relationships would be a good idea - both a As for human-readability, we've talked a lot in the past about choosing a Markdown standard and sticking to it, applying it across the whole database. This could be a good chance to make sure the rules sections are using well-formed Markdown in their longtext fields. |
However, the top level rendering gets a bit weird if we only have subsections. Do we have a root "SRD" entity that contains all top-level sections? Do we assume that all sections that are not subsections of other sections appear at the top level? |
I think we can assume that sections with no parent are top-level. Though I see no issue with creating a single root "SRD" section containing all the true "top-level" sections, if only to preserve their order for those wanting to render the entire tree of rules sections.
I think it'd be good to include full APIReferences for the parent, to keep consistency with the rest of the API. All internal document references, same collection or otherwise, are made using APIReferences. |
All of this ^^^ |
I think a single root "SRD" sections is a good idea. It should probably be the first one as well. |
Okay, so if I understand correctly, it sounds like we're converging on: [
{
"name": "The Order of Combat",
"index": "the-order-of-combat",
"desc": "...", // optional, body text only (no headings)
"children": [ // optional
{
"name": "Combat Step by Step",
"index": "combat-step-by-step",
"url": "/api/rules/combat-step-by-step"
}
],
"parent": { // optional -- absent for root node, of which there can be only one
"name": "Combat",
"index": "combat",
"url": "/api/rules/combat"
},
"url": "/api/rule/the-order-of-combat"
},
// ...
] |
Good point. |
You know. I can't remember if we ever came to a consensus on this. It would be nice to be consistent for all |
No. Actually, Rules seems to be a better example than other I only mentioned it because Rules means lots of longtext, but it would appear you needn't worry about that, as it's already been done right. |
My preference would be to converge behind a single Markdown string for all fields including |
The consensus is indeed to leave it as-is, in this case. I had forgotten that the Rules documents had already been brought up to standard. |
Okay, I'll add this to my to-do list, unless someone else is feeling bored. |
Summary
Combines
Rules.json
andRule-Sections.json
into a single file with self-referential links according to the following format:Original text follows.
Currently the rules are spread across two files, as follows:
However, the current situation doesn't do a particularly good job of representing the data in either a human- or machine-readable format. For my own use case, I'd like to have much smaller text snippets for reference purposes, so that a user could search for "Bonus Actions" and see only the snippet . Most of the data from the SRD is digested into bite-sized pieces, so it's rather out of place to have these giant blobs of text in
5e-SRD-Rule-Sections.json
.I suggest consolidating the rules down into a single file, with each heading getting its own entry.
Alternatively, a
parent_url
field could be added to the child rather than thesubsections
field on the parent. Either way, it would have to be associated with tests ensuring that there are no circular dependencies, there is only one root node, and there are no orphaned nodes. A bidirectional association is also possible for easier reading, but that would require extra test coverage to maintain consistency.The text was updated successfully, but these errors were encountered: