darobin/respec — pull request #286 by sglaser (2013-12-09 11:36:19+00:00)
Title: enhance figure and section numbering

This is the first time I've tried a pull request (and git for that matter), so bear with me...

I've been looking into using respec as a mechanism to replace Microsoft Word for the PCI Express 4.0 Base Specification. That document is currently over 1000 pages and frequently crashes Word. In an effort to understand how respect works, I made a few enhancements.

1. `structure.js` now supports more than 26 appendices. Appendix 27 is labeled "AA", 28 is "AB", etc. It's recursive, so it should support an infinite number of appendices.

2. I enhanced `figures.js` and created `tables.js`. `Figures.js` now takes an optional `conf.figFmt` parameter. If specified, it's a printf-like format that generates the figure number. `Tables.js` is the same, but uses tot and t/l instead of tot and fig respectively. Since it's reasonable to have unnumbered tables, tables with no caption don't generate a warning.

3. `conf.figFmt` and `conf.tblFmt` are processed as follows:
`%%` is a single `%`
`%#` is the figure / table number
`%c` is the current chapter / appendix number
`%t` is the `
` or `
`
`%1` says to restart `%#` for every top level section
`%(` starts the figure/table number
`%)` ends the figure/table number . Everything between `%(` and `%)` is wrapped in `` or ``
`conf.figFmt` defaults to `"Fig. %(%#%) %t"` and `conf.tblFmt` defaults to `"%t"`. This means that there should be no change to existing output.

4. I updated `aria.js` to label the `#tot` and `#tof` sections properly.

5. I updated `base.html` to show an example. I added `base copy.html` as an alternate example.