fdoc

subroutinemarkdown_listprivate

subroutine markdown_list(path)

Convert the Markdown texts in JSON array file path, and print the results as a JSON array.

Arguments

NameTypeIntentAttributesDescription
pathcharacter(len=*)in

the file

Calls

Source

Show the code
subroutine markdown_list(path)
    character(len=*), intent(in) :: path    !! the file
    type(json_core) :: json
    type(json_value), pointer :: root, item, results
    type(markdown_options_t) :: options
    character(len=:), allocatable :: source, html, text
    logical :: found
    integer :: k, n

    options%base_path = '.'
    options%aliases = [map_entry_t('url', 'URL'), map_entry_t('media', 'MEDIA'), map_entry_t('page', 'PAGE')]
    call json%initialize()
    call json%load(path, root)
    call json%info(root, n_children=n)
    call json%create_array(results, '')
    do k = 1, n
        call json%get_child(root, k, item, found)
        call json%get(item, source)
        call markdown_to_html(source, options, html)
        call json%add(results, '', html)
    end do
    call json%serialize(results, text)
    call write_text(text)
    call json%destroy(root)
    call json%destroy(results)
end subroutine markdown_list

Graphs

Calls

Called by