Changeset 520ba1d in rtems-central for rtemsqual/glossary.py


Ignore:
Timestamp:
Apr 28, 2020, 11:27:38 AM (10 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ddbc8f7
Parents:
22ec40f
git-author:
Sebastian Huber <sebastian.huber@…> (04/28/20 11:27:38)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/28/20 08:34:46)
Message:

content: Rework API

Use context managers for indent and comment blocks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsqual/glossary.py

    r22ec40f r520ba1d  
    5252    content = SphinxContent()
    5353    content.add_header("Glossary", level="*")
    54     content.add_blank_line()
    55     content.add_line(".. glossary::")
    56     content.add_line(":sorted:", indent=1)
     54    content.add(".. glossary::")
     55    with content.indent():
     56        content.append(":sorted:")
    5757    macro_to_sphinx = MacroToSphinx()
    5858    macro_to_sphinx.set_terms(terms)
     
    6161        text = macro_to_sphinx.substitute(item["text"].strip())
    6262        item.register_license_and_copyrights(content)
    63         content.add_definition_item(item["glossary-term"], text, indent=1)
     63        with content.indent():
     64            content.add_definition_item(item["glossary-term"], text)
    6465    content.add_licence_and_copyrights()
    6566    return content
Note: See TracChangeset for help on using the changeset viewer.