MCPcopy Index your code
hub / github.com/aws/aws-cli / add_new_section

Method add_new_section

awscli/botocore/docs/bcdoc/restdoc.py:159–184  ·  view source on GitHub ↗

Adds a new section to the current document structure This document structure will be considered a section to the current document structure but will in itself be an entirely new document structure that can be written to and have sections as well :param name:

(self, name, context=None)

Source from the content-addressed store, hash-verified

157 self.add_new_section(section_name)
158
159 def add_new_section(self, name, context=None):
160 """Adds a new section to the current document structure
161
162 This document structure will be considered a section to the
163 current document structure but will in itself be an entirely
164 new document structure that can be written to and have sections
165 as well
166
167 :param name: The name of the section.
168 :param context: A dictionary of data to store with the strucuture. These
169 are only stored per section not the entire structure.
170 :rtype: DocumentStructure
171 :returns: A new document structure to add to but lives as a section
172 to the document structure it was instantiated from.
173 """
174 # Add a new section
175 section = self.__class__(
176 name=name, target=self.target, context=context
177 )
178 section.path = self.path + [name]
179 # Indent the section apporpriately as well
180 section.style.indentation = self.style.indentation
181 section.translation_map = self.translation_map
182 section.hrefs = self.hrefs
183 self._structure[name] = section
184 return section
185
186 def get_section(self, name):
187 """Retrieve a section"""

Callers 15

_generate_structureMethod · 0.95
add_title_sectionMethod · 0.95
document_expires_shapeFunction · 0.45
_add_client_introMethod · 0.45
_add_client_methodMethod · 0.45
_add_exception_classMethod · 0.45
_add_response_attrMethod · 0.45
_add_response_exampleMethod · 0.45
_add_response_paramsMethod · 0.45
_add_paginatorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected