subroutinebadgeprivate
subroutine badge(text, b)
Write text, an intent or attribute, as a badge. Its class comes from its first word, such as
attr-pointer, which is what gives it its colour.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| text | character(len=*) | in | the intent or attribute | |
| b | type(buffer_t) | inout | the HTML |
Calls
Source
Show the code
subroutine badge(text, b)
character(len=*), intent(in) :: text !! the intent or attribute
type(buffer_t), intent(inout) :: b !! the HTML
character(len=*), parameter :: LETTERS = 'abcdefghijklmnopqrstuvwxyz'
integer :: n
n = verify(lowercase(text)//'(', LETTERS) - 1
call add(b, '<span class="attr attr-'//lowercase(text(:n))//'">')
call html_escape(text, b, .false.)
call add(b, '</span>')
end subroutine badge