fdoc

subroutineassign_pages

subroutine assign_pages(p)

Give each entity with a page of its own a page name that is unique in its directory, as FORD does: name, then name~2.

Arguments

NameTypeIntentAttributesDescription
ptype(project_t)inout

the project

Calls

Source

Show the code
subroutine assign_pages(p)
    type(project_t), intent(inout) :: p     !! the project
    character(len=:), allocatable :: url, name
    type(name_index_t) :: seen
    integer :: k, count, at

    do k = 1, p%list%n
        associate (e => p%list%box(k)%e)
            if (e%kind == E_NONE .or. .not. allocated(e%name)) cycle
            if (allocated(e%external_url)) cycle
            ! these are parts of the page of what holds them
            select case (e%kind)
            case (E_VARIABLE, E_BOUNDPROC, E_COMMON, E_ENUM, E_FINAL)
                cycle
            end select
            if (e%kind == E_FILE) then
                at = last_separator(e%name)
                call page_name(e%name(at + 1:), name)
                e%page = name
            end if
            call entity_url(p%list, k, url)
            if (len(url) == 0 .or. index(url, '#') > 0) cycle
            count = index_find(seen, url) + 1
            call index_set(seen, url, count)
            if (count > 1) then
                call page_name(e%name, name)
                if (e%kind == E_FILE) name = e%page
                e%page = name//'~'//trim(int_text(count))
            end if
        end associate
    end do
end subroutine assign_pages

Graphs

Calls

Called by