fdoc

subroutineentity_titleprivate

subroutine entity_title(site, id, word, b)

Write the title of an entity's page, with what is known about it.

Arguments

NameTypeIntentAttributesDescription
sitetype(site_t)in

the site

idintegerin

the entity

wordcharacter(len=*)in

what it is

btype(buffer_t)inout

the HTML

Calls

Source

Show the code
subroutine entity_title(site, id, word, b)
    type(site_t), intent(in) :: site        !! the site
    integer, intent(in) :: id               !! the entity
    character(len=*), intent(in) :: word    !! what it is
    type(buffer_t), intent(inout) :: b      !! the HTML
    integer :: k
    logical :: open

    associate (e => site%p%list%box(id)%e)
        call breadcrumbs(site, id, b)
        call add(b, '<h1><span class="kind">'//word//'</span>')
        call html_escape(display_name(e), b, .false.)
        call procedure_badges(e, b)
        if (allocated(e%permission)) then
            if (e%permission /= 'public' .and. e%kind /= E_MODULE .and. e%kind /= E_SUBMODULE .and. e%kind /= E_FILE .and. &
                e%kind /= E_PROGRAM) call badge(e%permission, b)
        end if
        call add(b, '</h1>'//achar(10))
        open = .false.
        do k = 1, size(e%meta)
            select case (e%meta(k)%key)
            case ('author', 'date', 'version', 'since', 'license', 'category')
                if (.not. open) call add(b, '<div class="meta">')
                open = .true.
                call add(b, '<span>'//e%meta(k)%key//': ')
                call html_escape(join(e%meta(k)%values, ' '), b, .false.)
                call add(b, '</span>')
            case ('deprecated')
                if (.not. open) call add(b, '<div class="meta">')
                open = .true.
                call badge('deprecated', b)
            end select
        end do
        if (open) call add(b, '</div>'//achar(10))
        select case (e%kind)
        case (E_SUBROUTINE, E_FUNCTION, E_MODPROC)
            call signature(site, id, b)
        end select
        if (allocated(e%html)) then
            if (len(e%html) > 0) then
                call add(b, '<div class="doc">'//achar(10))
                call add(b, e%html)
                call add(b, achar(10)//'</div>'//achar(10))
            end if
        end if
    end associate
end subroutine entity_title

Graphs

Calls

Called by