| name | generate-bookmap |
| description | Generates a valid DITA 1.3 bookmap template. Use this skill when you need a correctly structured starting point for a DITA bookmap with booktitle, bookmeta, frontmatter, chapter placeholders, appendix, and backmatter scaffolding. Output includes the correct DOCTYPE declaration. |
| compatibility | Python 3.9+. No third-party dependencies. |
Overview
Generates a DITA 1.3 <bookmap> template from a title, ID, and optional chapter list.
Usage
python scripts/generate_bookmap.py "My Book Title" my-book-id
python scripts/generate_bookmap.py "My Book Title" my-book-id \
--chapters chapter1.dita chapter2.dita chapter3.dita \
--appendix appendixA.dita
Output
Well-formed XML to stdout including:
<?xml?> + <!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA 1.3 BookMap//EN">
<booktitle> with <mainbooktitle> and <booktitlealt> placeholder
<bookmeta> with <publisherinformation> and <bookid> scaffolding
<frontmatter> with <toc/>, <figurelist/>, <tablelist/>
- One
<chapter> per --chapters argument (or two placeholders)
- One
<appendix> per --appendix argument (or one placeholder)
<backmatter> with <indexlist/>
Common edge cases
- DTD order is enforced: front → chapters → appendix → back
<part> grouping is not generated by default; add manually if needed
<booktitlealt> is for subtitles; remove if not needed