mdc/lib/parsing/parser_handler.rb
##
# Include code from an external file and transform
# it to a fenced code block
#
# @param [ParserState] ps State of the parser
# @param [MarkdownLine] line Line of input
Include code from an external file and transform
it to a fenced code block
Include code from an external file and transform it to a fenced code block
def code_include(ps, line)
      path, first_line, language_hint = line.code_include
      source = File.readlines(path, "\n", encoding: 'UTF-8')
      caption = ''
      order = 0
      slide(ps) << Domain::Source.new(language_hint, caption, order)
      source.each_with_index do |src_line, i|
        element(ps) << src_line if i + 1 >= first_line
      end
    end
def code_include ( ps , line ) path , first_line , language_hint = line . code_include source = File . readlines ( path , "\n" , encoding : 'UTF-8' ) caption = '' order = 0 slide ( ps ) << Domain :: Source . new ( language_hint , caption , order ) source . each_with_index do | src_line , i | element ( ps ) << src_line if i + 1 >= first_line end end
Include code from an external file and transform
it to a fenced code block
Include code from an external file and transform it to a fenced code block
## Add the included source to the slide
ps
<not_specific>
line
<not_specific>
<not_specific>
line Line of input
line Line of input