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

Method _convert_doc_content

awscli/help.py:267–284  ·  view source on GitHub ↗
(self, contents)

Source from the content-addressed store, hash-verified

265 """
266
267 def _convert_doc_content(self, contents):
268 settings_overrides = self._DEFAULT_DOCUTILS_SETTINGS_OVERRIDES.copy()
269 settings_overrides["report_level"] = 3
270 man_contents = publish_string(
271 contents,
272 writer=manpage.Writer(),
273 settings_overrides=self._DEFAULT_DOCUTILS_SETTINGS_OVERRIDES,
274 )
275 if self._exists_on_path('groff'):
276 cmdline = ['groff', '-m', 'man', '-T', 'html']
277 elif self._exists_on_path('mandoc'):
278 cmdline = ['mandoc', '-T', 'html']
279 else:
280 raise ExecutableNotFoundError('groff or mandoc')
281 LOG.debug("Running command: %s", cmdline)
282 p3 = self._popen(cmdline, stdin=PIPE, stdout=PIPE, stderr=PIPE)
283 output = p3.communicate(input=man_contents)[0]
284 return output
285
286 def _exists_on_path(self, name):
287 # Since we're only dealing with POSIX systems, we can

Callers

nothing calls this directly

Calls 5

_exists_on_pathMethod · 0.95
copyMethod · 0.45
_popenMethod · 0.45
communicateMethod · 0.45

Tested by

no test coverage detected