innoconv.ext.number_boxes

Scan documents for numbered boxes (info, example, exercise).

Viewers need to be able to quickly number and reference boxes without scanning the whole document structure themselves. This extension adds a field to the Manifest that lists all boxes per section.

It will assign an auto-generated ID based on the box type and number to the box div element (in case it doesn’t already have one). Also a data-number attribute is attached.

Furthermore this extension faciliates the course-wide tracking of exercise progress. For each exercise, the total achievable points and number of questions are stored. A viewer application can easily display total points per section without having to scan all documents for exercises.

class innoconv.ext.number_boxes.NumberBoxes(*args, **kwargs)[source]

Bases: innoconv.ext.abstract.AbstractExtension

Scan the documents for boxes.

process_element(elem, _)[source]

Respond to AST element.

pre_conversion(language)[source]

Remember current conversion language.

post_conversion(_)[source]

Set scan to done.

pre_process_file(path)[source]

Remember current path.

post_process_file(ast, title, content_type, section_type=None, short_title=None)[source]

Scan the AST.

manifest_fields()[source]

Add boxes field to manifest.