docs/documentation/_plugins/openapi.rb
#
# Returns configuration module content from the openAPI spec
Returns configuration module content from the openAPI spec
Returns configuration module content from the openAPI spec
def format_configuration(input)
        result = []
        result.push('<div markdown="0">')
        if !( input.has_key?('i18n'))
           input['i18n'] = {}
        end
        if !( input['i18n'].has_key?('en'))
           input['i18n']['en'] = { "properties" => input['properties'] }
        end
        if ( input.has_key?("properties"))
           then
            converter = Jekyll::Converters::Markdown::KramdownParser.new(Jekyll.configuration())
            result.push('<ul>')
            input['properties'].sort.to_h.each do |key, value|
                _primaryLanguage = nil
                _fallbackLanguage = nil
                if ( input['i18n'].has_key?(@context.registers[:page]["lang"]) and input['i18n'][@context.registers[:page]["lang"]].has_key?("properties") )
                    _primaryLanguage = input['i18n'][@context.registers[:page]["lang"]]["properties"][key]
                end
                if ( @context.registers[:page]["lang"] == 'en' )
                    fallbackLanguageName = 'ru'
                else
                    fallbackLanguageName = 'en'
                end
                if ( input['i18n'].has_key?(fallbackLanguageName) and input['i18n'][fallbackLanguageName].has_key?("properties") )
                    _fallbackLanguage = input['i18n'][fallbackLanguageName]["properties"][key]
                end
                result.push(format_schema(key, value, input, _primaryLanguage, _fallbackLanguage ))
            end
            result.push('</ul>')
        end
        result.push('</div>')
        result.join
    end
def format_configuration ( input ) result = [ ] result . push ( '<div markdown="0">' ) if ! ( input . has_key? ( 'i18n' ) ) input [ 'i18n' ] = { } end if ! ( input [ 'i18n' ] . has_key? ( 'en' ) ) input [ 'i18n' ] [ 'en' ] = { "properties" => input [ 'properties' ] } end if ( input . has_key? ( "properties" ) ) then converter = Jekyll :: Converters :: Markdown :: KramdownParser . new ( Jekyll . configuration ( ) ) result . push ( '<ul>' ) input [ 'properties' ] . sort . to_h . each do | key , value | _primaryLanguage = nil _fallbackLanguage = nil if ( input [ 'i18n' ] . has_key? ( @context . registers [ :page ] [ "lang" ] ) and input [ 'i18n' ] [ @context . registers [ :page ] [ "lang" ] ] . has_key? ( "properties" ) ) _primaryLanguage = input [ 'i18n' ] [ @context . registers [ :page ] [ "lang" ] ] [ "properties" ] [ key ] end if ( @context . registers [ :page ] [ "lang" ] == 'en' ) fallbackLanguageName = 'ru' else fallbackLanguageName = 'en' end if ( input [ 'i18n' ] . has_key? ( fallbackLanguageName ) and input [ 'i18n' ] [ fallbackLanguageName ] . has_key? ( "properties" ) ) _fallbackLanguage = input [ 'i18n' ] [ fallbackLanguageName ] [ "properties" ] [ key ] end result . push ( format_schema ( key , value , input , _primaryLanguage , _fallbackLanguage ) ) end result . push ( '</ul>' ) end result . push ( '</div>' ) result . join end
Returns configuration module content from the openAPI spec
Returns configuration module content from the openAPI spec
input
<not_specific>