subroutinesidebar_scriptprivate
subroutine sidebar_script(site, text)
The script holding the entries of the lists of the sidebar, for fdoc.js.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| site | type(site_t) | in | the site | |
| text | character(len=:) | out | allocatable | the script |
Calls
Source
Show the code
subroutine sidebar_script(site, text)
type(site_t), intent(in) :: site !! the site
character(len=:), allocatable, intent(out) :: text !! the script
type(buffer_t) :: b, entry
character(len=:), allocatable :: url, html
logical :: first
integer :: k, j
call add(b, 'window.FDOC_SIDEBAR={')
first = .true.
do k = 1, NUM_LISTS
if (size(site%members(k)%ids) == 0) cycle
if (.not. first) call add(b, ',')
first = .false.
call add(b, "'"//trim(LIST_FILE(k))//"':'")
do j = 1, size(site%members(k)%ids)
associate (id => site%members(k)%ids(j))
call entity_url(site%p%list, id, url)
call add(entry, '<li><a href="@')
call html_escape(url, entry, .true.)
call add(entry, '">')
call side_icon(site%p%list%box(id)%e, entry)
call html_escape(display_name(site%p%list%box(id)%e), entry, .false.)
call add(entry, '</a></li>')
call take(entry, html)
call add_js_text(html, b)
end associate
end do
call add(b, "'")
end do
call add(b, '};'//achar(10))
call take(b, text)
end subroutine sidebar_script