Sha256: ae206dc6ff6d1872517f8914f2cd2da79f06e191260c3836dd058359278bbaa0
Contents?: true
Size: 1.08 KB
Versions: 14
Compression:
Stored size: 1.08 KB
Contents
module Nexmo module OAS module Renderer module Presenters class ApiSpecification def initialize(document_name:, code_language: nil) @document_name = document_name @code_language = code_language end def side_navigation "api/#{@document_name}" end def document_path "_api/#{@document_name}.md" end def document @document ||= File.read(document_path) end def frontmatter @frontmatter ||= YAML.safe_load(document) end def side_navigation_title @side_navigation_title ||= frontmatter.fetch('api') end def document_title @document_title ||= "#{side_navigation_title} > #{frontmatter.fetch('title')}" end def content options = {} options.merge(code_language: @code_language) if @code_language @content ||= MarkdownPipeline.new(options).call(document) end end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems