subroutinelicense_textprivate
subroutine license_text(license, b)
Write the name of license license, linked if it is a known one.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| license | character(len=*) | in | the setting | |
| b | type(buffer_t) | inout | the HTML |
Calls
Source
Show the code
subroutine license_text(license, b)
character(len=*), intent(in) :: license !! the setting
type(buffer_t), intent(inout) :: b !! the HTML
character(len=:), allocatable :: url, name
select case (lowercase(license))
case ('by'); name = 'CC BY'; url = 'http://creativecommons.org/licenses/by/4.0/'
case ('by-nd'); name = 'CC BY-ND'; url = 'http://creativecommons.org/licenses/by-nd/4.0/'
case ('by-sa'); name = 'CC BY-SA'; url = 'http://creativecommons.org/licenses/by-sa/4.0/'
case ('by-nc'); name = 'CC BY-NC'; url = 'http://creativecommons.org/licenses/by-nc/4.0/'
case ('by-nc-nd'); name = 'CC BY-NC-ND'; url = 'http://creativecommons.org/licenses/by-nc-nd/4.0/'
case ('by-nc-sa'); name = 'CC BY-NC-SA'; url = 'http://creativecommons.org/licenses/by-nc-sa/4.0/'
case ('gpl'); name = 'GNU GPL'; url = 'http://www.gnu.org/licenses/gpl'
case ('lgpl'); name = 'GNU LGPL'; url = 'http://www.gnu.org/licenses/lgpl'
case ('agpl'); name = 'GNU AGPL'; url = 'http://www.gnu.org/licenses/agpl'
case ('gfdl'); name = 'GNU FDL'; url = 'http://www.gnu.org/licenses/old-licenses/fdl-1.2.en.html'
case ('opl'); name = 'Open Publication License'; url = 'http://opencontent.org/openpub/'
case ('pdl'); name = 'Public Documentation License'; url = 'http://www.openoffice.org/licenses/PDL.html'
case ('bsd'); name = 'FreeBSD Documentation License'; url = 'http://www.freebsd.org/copyright/freebsd-doc-license.html'
case ('isc'); name = 'ISC'; url = 'https://opensource.org/licenses/ISC'
case ('mit'); name = 'MIT'; url = 'https://opensource.org/licenses/MIT'
case default
call html_escape(license, b, .false.)
return
end select
call add(b, '<a rel="license" href="'//url//'">'//name//'</a>')
end subroutine license_text