Added Chapter H.

master
Pacman Ghost 3 years ago
parent a822948a1f
commit 463df8bb6c
  1. 24
      asl_rulebook2/extract/content.py
  2. 3
      asl_rulebook2/extract/data/chapter-fixups.json
  3. 6
      asl_rulebook2/extract/data/footnote-fixups.json
  4. 42
      asl_rulebook2/extract/data/target-fixups.json
  5. BIN
      asl_rulebook2/webapp/data/chapters/H-background.png
  6. 1
      asl_rulebook2/webapp/static/css/chapters.css
  7. BIN
      doc/features/images/chapters-extended.png
  8. BIN
      doc/features/images/chapters.png
  9. 2
      doc/features/index.html

@ -29,11 +29,12 @@ _DISABLE_SORT_ITEMS = [
"E28", "E29", "E30", # Chapter E footnotes
"F20", "F21", # Chapter F footnotes
"G48", "G49", "G50", # Chapter G footnotes
"H9", # Chapter H footnotes
]
_DEFAULT_ARGS = {
"chapter-a": "42-102", "chapter-b": "109-154", "chapter-c": "158-183", "chapter-d": "187-213",
"chapter-e": "216-245", "chapter-f": "247-267", "chapter-g": "270-319",
"chapter-e": "216-245", "chapter-f": "247-267", "chapter-g": "270-319", "chapter-h": "322-324,326-330",
"chapter-j": "593",
"chapter-w": "647-664",
"content_vp_left": 0, "content_vp_right": 565, "content_vp_top": 715, "content_vp_bottom": 28, # viewport
@ -95,6 +96,8 @@ class ExtractContent( ExtractBase ):
break
if page_no not in page_index:
self.log_msg( "progress", "- Skipping page {}.", page_no )
if curr_chapter_pageno is not None:
curr_chapter_pageno += 1
continue
if not self._curr_chapter or self._curr_chapter != page_index[page_no]:
# we've found the start of a new chapter
@ -289,7 +292,7 @@ class ExtractContent( ExtractBase ):
else:
self._curr_footnote[1] += elem.get_text()
def _save_footnote( self ):
def _save_footnote( self ): #pylint: disable=too-many-branches
"""Save a parsed footnote."""
if not self._curr_footnote:
@ -331,6 +334,11 @@ class ExtractContent( ExtractBase ):
if footnote_id == "9" and "9" in footnote_ids:
footnote_id = "29"
# check if we've gone past the end of the Chapter H footnotes
if self._curr_chapter == "H" and len(footnote_id) > 1:
self._curr_footnote = None
return
# clean up the content
content = re.sub( r"\s+", " ", content ).strip()
content = fixup_text( content )
@ -388,9 +396,15 @@ class ExtractContent( ExtractBase ):
)
# check for the credits at the end of the Chapter F footnotes
pos = content.find( "WEST OF ALAMEIN CREDITS" )
if pos > 0:
content = content[:pos]
if self._curr_chapter == "F":
pos = content.find( "WEST OF ALAMEIN CREDITS" )
if pos > 0:
content = content[:pos]
# check for the start of the vehicle notes at the end of the Chapter H footnotes
if self._curr_chapter == "H":
pos = content.find( "GERMAN VEHICLE NOTES" )
if pos > 0:
content = content[:pos]
# save the footnote
self._footnotes[ self._curr_chapter ].append( {

@ -8,13 +8,14 @@
"E": "Miscellaneous",
"F": "North Africa",
"G": "Pacific Theater",
"H": "Design Your Own",
"J": "Deluxe ASL",
"W": "Korean War"
},
"_comment_": "Section titles are all-caps, and are converted to normal-caps during extraction. This table specifies words that actually should be all-caps.",
"capitalize_words": [
"LOS", "SW", "CC", "SMOKE",
"LOS", "SW", "CC", "SMOKE", "OB",
"OBA", "TH#", "TK#", "DRM", "RCL", "LATW",
"AFV", "OVR", "DD",
"ASL",

@ -169,6 +169,12 @@
},
"H": {
"4": [
[ "ASLgame system.", "ASL game system." ]
]
},
"W": {
"2": [

@ -397,6 +397,48 @@
"55": { "new_ruleid": null }
},
"H2": {
"1.25": {
"new_ruleid": "H1.25",
"new_caption": "MOL"
}
},
"H3": {
"1.46OBSERVATIONPOST(OP)TANKS:": {
"new_ruleid": "H1.46",
"new_caption": "OBSERVATION POST (OP) TANKS"
}
},
"H6": {
"10": { "new_ruleid": null, "instances": 2 },
"11": { "new_ruleid": null, "instances": 2 },
"12": { "new_ruleid": null, "instances": 2 },
"1.531 AIRSUPPORT:": {
"new_ruleid": "H1.531",
"new_caption": "AIR SUPPORT"
}
},
"H7": {
"1.71BONUSINFANTRY:": {
"new_ruleid": "H1.71",
"new_caption": "BONUS INFANTRY"
}
},
"H8": {
"22 LMGMMGHMGATRLT. MTRPSKFTDC": { "new_ruleid": null },
"422 LMGMMGHMG.50cal ATRLT. MTRFTDC": { "new_ruleid": null },
"1 GERMAN SW ALLOTMENT CHART": { "new_ruleid": null },
"1,3 RUSSIAN SW ALLOTMENT CHART": { "new_ruleid": null },
"1.84REINFORCEMENTLEADERS/SW:": {
"new_ruleid": "H1.84",
"new_caption": "REINFORCEMENT LEADERS/SW"
}
},
"J1": {
"1.MINIATURES:": { "new_ruleid": null }
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

@ -5,6 +5,7 @@
.chapter-e { border: 1px solid #9ad0e9 !important ; }
.chapter-f { border: 1px solid #b4965f !important ; }
.chapter-g { border: 1px solid #c6cf21 !important ; }
.chapter-h { border: 1px solid #f3a954 !important ; }
.chapter-j { border: 1px solid #6e7723 !important ; }
.chapter-w { border: 1px solid #ad965d !important ; }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 KiB

After

Width:  |  Height:  |  Size: 469 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 KiB

After

Width:  |  Height:  |  Size: 358 KiB

@ -20,7 +20,7 @@
<p> And if the rule has any associated footnotes, these will be shown in a popup.
<p style="margin-top:1.5em;"> You can also browse the ASLRB by chapter: <br>
<img src="images/chapters.png" class="imageZoom" style="margin:1em 0 0 2em;width:300px;">
<img src="images/chapters.png" class="imageZoom" style="margin:1em 0 0 2em;width:250px;">
<br><br>

Loading…
Cancel
Save