class Aws::Api::Docs::DocstringProvider
def clean(value)
def clean(value) if value.nil? '' else value.gsub(/\{(\S+)\}/, '`{\1}`').strip end end
def initialize(docstrings)
def initialize(docstrings) @docstrings = docstrings end
def operation_docs(operation_name)
-
(String, nil)
-
Parameters:
-
operation_name
(String
) --
def operation_docs(operation_name) clean(@docstrings['operations'][operation_name]) end
def shape(name)
def shape(name) @docstrings['shapes'][name] || { 'base' => nil, 'refs' => {} } end
def shape_docs(shape_name)
-
(String, nil)
-
Parameters:
-
shape_name
(String
) --
def shape_docs(shape_name) clean(shape(shape_name)['base']) end
def shape_ref_docs(shape_name, target)
-
(String, nil)
-
Parameters:
-
target
(String
) -- -
shape_name
(String
) --
def shape_ref_docs(shape_name, target) if ref_docs = shape(shape_name)['refs'][target] docs = clean(ref_docs) # Running through kramdown to catch unclosed tags that # break the client doc pages, see Aws::RDS::Client # for an example. begin require 'kramdown' Kramdown::Document.new(docs, input: 'html').to_kramdown.strip rescue LoadError docs end else shape_docs(shape_name) end end