@@ -51,6 +51,9 @@ Each is available as a whole Markdown file, smaller segments broken up in a
5151 - Re-arranged the order of the Fantasy-Historical Pantheons so that the
5252 table of deities appears in the description of that pantheon
5353 - Subclass introduction headers added to Barbarian, Bard, Cleric & Druid
54+ - The monster ability tables have been reformatted to be in a different
55+ layout -- score/modifier/saving throw -- and the "Saving Throw" line
56+ underneath removed now it is incorporated into the table
5457
5558- D&D 5th edition 5.2.1 SRD (2024 rules)
5659
@@ -85,6 +88,8 @@ Each is available as a whole Markdown file, smaller segments broken up in a
8588 including rotating statblock tables to have the abilities in the
8689 first column
8790 - split tables using mid-table headers into multiple tables
91+ - monster ability tables have been reformatted to be in the format
92+ score/modifier/saving throw
8893
8994## Workflow for breaking the whole SRD into sections
9095
@@ -107,117 +112,110 @@ A draft breakdown is made with
107112```
108113
109114and then refined by hand (as either ` marker ` detects far too many lines as
110- headers, or the PDF was styled poorly). While refining the breakdown, this is
111- run repeatedly to spot mistakes:
115+ headers, or the PDF was styled poorly). While refining the breakdown, this
116+ can be run repeatedly to spot mistakes:
112117
113118``` bash
114119cp dnd/51/SRD_CC_v5.1.md dnd/51/breakdown.md \
115- && ./breakdown.sh -f dnd/51/breakdown.md \
120+ && ./breakdown.sh -fh dnd/51/breakdown.md \
116121 && diff -u dnd/51/SRD_CC_v5.1.md <( ./rebuild.sh dnd/51/breakdown.md)
117122```
118123
124+
119125### Clean the Markdown
120126
121- Run the cleaning script:
127+ Once the breakdown has been created, start looping over refinement and repair
128+ of the SRD Markdown using ` ./reprocess.sh ` :
122129
123130``` bash
124- python clean_srd.py --progress dnd/51/SRD_CC_v5.1.md
131+ ./reprocess.sh dnd/51/SRD_CC_v5.1.md
125132```
126133
127- If it detects any errors it cannot fix automatically, it will issue errors and
128- not process the file further. After reformatting the document, it will also
129- scan for problems that might need human intervention. Any automatic changes
130- will have updated the breakdown file as necessary.
134+ Without other arguments, it will:
131135
132- If warnings are emitted during cleaning that can be safely ignored, they
133- can be added to an ignore file. Similarly, if any source would be modified
134- in an unwanted manner, those lines can be added to a file declaring them
135- already cleaned:
136+ - ` git restore ` the files being cleaned, to always be working with a
137+ predictable starting base (this can be skipped with ` -b ` )
136138
137- ``` bash
138- python clean_srd.py \
139- --progress \
140- --ignore-warnings dnd/51/ignore_warnings.txt \
141- --clean-lines dnd/51/clean_lines.txt \
142- dnd/51/SRD_CC_v5.1.md
143- ```
139+ - run the clean script, which reformats the document to remove PDF decoding
140+ errors, change formatting to the preferred format, and scan for errors
141+ that are hard to fix programmatically (this can be skipped with ` -c ` )
142+
143+ ``` bash
144+ python clean_srd.py \
145+ --progress \
146+ $ignore_warnings \
147+ " $srd_path " " $breakdown_txt "
148+ ```
149+ - break down the content to individual files (this can be skipped with ` -b` )
150+
151+ - rebuild the SRD from the broken down content to compare with the original,
152+ to spot breakdown.txt problems, header level issues and more (this can
153+ be skipped with ` -d` )
154+
155+ - filter the content again to create a cross-linked Obsidian vault (which is
156+ also often the easiest way to examine individual sections in isolation to
157+ find problems; this can be skipped with ` -v` )
144158
145- When changing the source by hand and lines are added/removed, use
159+ If warnings are emitted during cleaning that can be safely ignored, they can
160+ be added to an ` ignore_warnings.txt` file. Similarly, if any source would be
161+ modified in an unwanted manner, those lines can be added to a
162+ ` clean_lines.txt` file.
163+
164+ When changing the original SRD Markdown by hand and lines are added/removed, use
146165` alter_lines.sh` to change the line numbers in ` breakdown.txt` and
147166` ignore_warnings.txt` from a specific point in the breakdown onwards:
148167
149168` ` ` bash
150169./alter_lines.sh -d dnd/51/ /black_tentacles -2
151170` ` `
152171
153- ### Fix header progression
172+ # ## Fixing header progression
154173
155174The broken down fragments of the SRD should start with a first level header.
156- To help this, ` breakdown.sh ` will fix easy segments, and warn on any where the
157- headers skip around too much. This can be suppressed with the ` -f ` argument.
175+ To help this, ` breakdown.sh` fixes easy segments, and warns on any where the
176+ headers skip around too much. Fixing can be turned off using the ` -h` option
177+ to ` reprocess.sh` , or ` -f` to ` breakdown.sh` if using it directly. Likewise,
178+ warnings can be supressed with ` -h` to ` reprocess.sh` , or ` -c` when using
179+ ` breakdown.sh` directly.
158180
159- To look for general problems in header progression, use:
181+ Any warnings can be piped to ` edit_warnings.sh` to open the file at the right
182+ line (in Sublime Text):
160183
161184` ` ` bash
162- ./check_headers.sh dnd/51/markdown
163- ```
164-
165- If there are warnings from ` check_headers.sh ` or ` breakdown.sh ` where they
166- can't fix things automatically, they can be piped to ` edit_warnings.sh ` to
167- open the file at the right line (in Sublime Text):
185+ ./breakdown.sh | ./edit_warnings.sh
168186
169- ``` bash
170- ./check_headers.sh dnd/51/markdown | ./edit_warnings.sh
187+ # or using the clipboard...
188+ pbpaste | ./edit_warnings.sh
171189` ` `
172190
173- ### Confirming the source
191+ # ## Patching content
174192
175- To check the SRD master file against the broken down fragments, use:
193+ It can be helpful to add/alter content from the SRD to improve the state of
194+ the vault content, by adding links etc. From a clean git state, edit the files
195+ then run
176196
177197` ` ` bash
178- diff -u dnd/51/SRD_CC_v5.1.md <( ./rebuild.sh dnd/51/breakdown.md)
179- ```
180-
181- ### Create an Obsidian vault
198+ # to patch the breakdown files
199+ ./patches.sh dnd/51/markdown create
182200
183- Once the SRD is edited, create a copy to use as an Obsidian vault.
184-
185- ``` bash
186- python update_vault.py \
187- --progress \
188- dnd/51/markdown \
189- dnd/51/obsidian_vault
201+ # to patch only the vault
202+ ./patches.sh dnd/51/obsidian_vault create
190203` ` `
191204
192- Some words that are also conditions (eg invisible) may be incorrectly linked.
193- The lines that they are on can be added to ` ignore_vault.txt ` so that they
194- won't be re-created when re-running the script:
195-
196- ``` bash
197- python update_vault.py \
198- --progress \
199- --ignore dnd/51/ignore_vault.txt \
200- dnd/51/markdown \
201- dnd/51/obsidian_vault
202- ```
205+ In general, patch the original Markdown files if you want to add more content
206+ so the vault filters apply, and patch the vault if the filters are doing the
207+ wrong thing (such as linking to the condition Invisible when referring to the
208+ Invisible Stalker).
203209
204- And where files need to be altered after the script has run in a way that
205- would be overwritten (eg creating more wikilinks that would be removed again),
206- after editing the files, create patches:
210+ Patches are kept rather than changing the content so that automated tests
211+ still pass when comparing the Markdown fragments to the original document.
207212
208- ``` bash
209- ./vault_patches.sh create dnd/51
210- ```
211-
212- that can then be restored later:
213-
214- ``` bash
215- ./vault_patches.sh apply dnd/51
216- ```
217213
218214# # Changing the code
219215
220- Every script should have a test suite.
216+ Every script should have a test suite. Every filter in the ` clean_srd.py`
217+ and ` update_vault.py` scripts should be individally tested, as well as having
218+ whole-document integration tests.
221219
222220- ` make test` runs all the code tests
223221- ` make ci` runs all the code tests, and a couple more
0 commit comments