gumpu / ROBODoc

Documentation Extraction Tool
http://www.xs4all.nl/~rfsber/Robo/index.html
GNU General Public License v3.0
80 stars 21 forks source link

Syntax highlighting for example code within the header #5

Open jacobwilliams opened 9 years ago

jacobwilliams commented 9 years ago

I was thinking a good feature would be this: to have a new block type that allows you to put sourcecode within a commented portion of the header, and still have it be syntax highlighted as though it were not commented. Here is an example:

!*****************************************************************************************
!****f* json_module/json_create_array
!
!  NAME
!    json_create_array
!
!  DESCRIPTION
!    Allocate a json_value pointer and make it an array variable.
!    The pointer should not already be allocated.
!
!  EXAMPLE
!    type(json_value),pointer :: p
!    call json_create(p,'arrayname')
!
!  SOURCE

    subroutine json_create_array(me,name)

    implicit none

    type(json_value),pointer            :: me
    character(kind=CK,len=*),intent(in) :: name

    call json_value_create(me)
    call to_array(me,name)

    end subroutine json_create_array
!*****************************************************************************************

Currently, the output looks like this

What I would like is to be able to indicate that the EXAMPLE block should be syntax highlighted, excluding the first comment character. Note that I can't put it in the source items block, because it would highlight each line as a comment. It might also be useful to be able to specify some different settings for this type of block (for example, perhaps I wouldn't want to show the line numbers for these, but I do for the main SOURCE).