subroutinesource_sectionprivate
subroutine source_section(site, id, b)
Write the source of entity id, if source is set, from the text of its file.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| site | type(site_t) | in | the site | |
| id | integer | in | the procedure or type | |
| b | type(buffer_t) | inout | the HTML |
Calls
Source
Show the code
subroutine source_section(site, id, b)
type(site_t), intent(in) :: site !! the site
integer, intent(in) :: id !! the procedure or type
type(buffer_t), intent(inout) :: b !! the HTML
if (.not. wants_source(site, id)) return
associate (e => site%p%list%box(id)%e)
if (e%source_first == 0) return
call add(b, '<h2 id="source">Source</h2>'//achar(10)//'<details class="source"><summary>Show the code</summary>')
call add(b, '<pre><code>')
call highlight_fortran(site%p%list%box(e%file)%e%source_text(e%source_first:e%source_last), b, .false.)
call add(b, '</code></pre></details>'//achar(10))
end associate
end subroutine source_section