- thread = Thread(spec)
- spec.log('Counting chunks...\r')
- num_chunks = ilen(thread.chunkDOMs())
- title = thread.title() or "chunk"
- for i, r in enumerate(thread.chunkDOMs()):
- percent = 100.0 * i / num_chunks
- spec.log(f'Processing {title} {i} of {num_chunks} ({percent:.1f}%)\r')
- spec.domfilter(r)
- chunk = makeChunk(r, spec.images)
- spec.texout.write(spec.texfilter(renderChunk(spec.texifier, chunk)))
- spec.log('')