asciidoxy/generator/asciidoc.py
def insert_fragment(self,
                        element,
                        insert_filter: InsertionFilter,
                        leveloffset: str = "+1",
                        kind_override: Optional[str] = None,
                        **asciidoc_options) -> str:
        """Generate and insert a documentation fragment.

        Args:
            element:          Python representation of the element to insert.
            insertion_filter: Filter for members to insert.
            leveloffset:      Offset of the top header of the inserted text from the top level
                                  header of the including document.
            kind_override:    Override the kind of template to use. None to use the kind of
                                  `element`.
            asciidoc_options: Any additional option is added as an attribute to the include
                                  directive in single page mode.

        Returns:
            AsciiDoc text to include in the document.
        """

        assert element.id
        fragment_file = self._context.fragment_dir / f"{element.id}.adoc"

        if kind_override is None:
            kind = element.kind
        else:
            kind = kind_override

        rendered_doc = self._template(element.language, kind).render(element=element,
                                                                     insert_filter=insert_filter,
                                                                     api_context=self._context,
                                                                     api=self)

        if not self._context.preprocessing_run:
            with fragment_file.open("w", encoding="utf-8") as f:
                print(rendered_doc, file=f)

        asciidoc_options["leveloffset"] = leveloffset
        attributes = ",".join(f"{str(key)}={str(value)}" for key, value in asciidoc_options.items())
        return f"include::{fragment_file}[{attributes}]"
Generate and insert a documentation fragment.

        Args:
            element:          Python representation of the element to insert.
            insertion_filter: Filter for members to insert.
            leveloffset:      Offset of the top header of the inserted text from the top level
                                  header of the including document.
            kind_override:    Override the kind of template to use. None to use the kind of
                                  `element`.
            asciidoc_options: Any additional option is added as an attribute to the include
                                  directive in single page mode.

        Returns:
            AsciiDoc text to include in the document.
        
Generate and insert a documentation fragment.
Generate and insert a documentation fragment .
def insert_fragment(self,
                        element,
                        insert_filter: InsertionFilter,
                        leveloffset: str = "+1",
                        kind_override: Optional[str] = None,
                        **asciidoc_options) -> str:
        assert element.id
        fragment_file = self._context.fragment_dir / f"{element.id}.adoc"
        if kind_override is None:
            kind = element.kind
        else:
            kind = kind_override
        rendered_doc = self._template(element.language, kind).render(element=element,
                                                                     insert_filter=insert_filter,
                                                                     api_context=self._context,
                                                                     api=self)
        if not self._context.preprocessing_run:
            with fragment_file.open("w", encoding="utf-8") as f:
                print(rendered_doc, file=f)
        asciidoc_options["leveloffset"] = leveloffset
        attributes = ",".join(f"{str(key)}={str(value)}" for key, value in asciidoc_options.items())
        return f"include::{fragment_file}[{attributes}]"
def insert_fragment ( self , element , insert_filter : InsertionFilter , leveloffset : str = "+1" , kind_override : Optional [ str ] = None , ** asciidoc_options ) -> str : assert element . id fragment_file = self . _context . fragment_dir / f"{element.id}.adoc" if kind_override is None : kind = element . kind else : kind = kind_override rendered_doc = self . _template ( element . language , kind ) . render ( element = element , insert_filter = insert_filter , api_context = self . _context , api = self ) if not self . _context . preprocessing_run : with fragment_file . open ( "w" , encoding = "utf-8" ) as f : print ( rendered_doc , file = f ) asciidoc_options [ "leveloffset" ] = leveloffset attributes = "," . join ( f"{str(key)}={str(value)}" for key , value in asciidoc_options . items ( ) ) return f"include::{fragment_file}[{attributes}]"
Generate and insert a documentation fragment.
Generate and insert a documentation fragment .
"""Generate and insert a documentation fragment.

        Args:
            element:          Python representation of the element to insert.
            insertion_filter: Filter for members to insert.
            leveloffset:      Offset of the top header of the inserted text from the top level
                                  header of the including document.
            kind_override:    Override the kind of template to use. None to use the kind of
                                  `element`.
            asciidoc_options: Any additional option is added as an attribute to the include
                                  directive in single page mode.

        Returns:
            AsciiDoc text to include in the document.
        """
AsciiDoc text to include in the document.
AsciiDoc text to include in the document .
self
element
Python representation of the element to insert.
Python representation of the element to insert .
insert_filter
InsertionFilter
leveloffset
str
Offset of the top header of the inserted text from the top level
header of the including document.
Offset of the top header of the inserted text from the top level header of the including document .
kind_override
Optional[str]
Override the kind of template to use. None to use the kind of
`element`.
Override the kind of template to use . None to use the kind of ` element ` .
insertion_filter
Filter for members to insert.
Filter for members to insert .
asciidoc_options
Any additional option is added as an attribute to the include
directive in single page mode.
Any additional option is added as an attribute to the include directive in single page mode .