lib/static_site_builder/renderers/yart_renderer.rb
# Returns a String of Markdown (having recursively rendered any found YART snippets into HTML).
Returns a String of Markdown (having recursively rendered any found YART snippets into HTML).
Returns a String of Markdown ( having recursively rendered any found YART snippets into HTML ) .
def render
      return @markdown unless $yart_installed
      lines = @markdown.split("\n")
      return @markdown unless yart_snippet?(lines)
      yart_lines = extract_yart_lines(lines)
      yart_snippet = yart_lines[1..-2].join("\n")
      raise YART_PARSE_ERROR if yart_snippet.include?("YART.parse")
      html = YART.parse { eval(yart_snippet) }
      @markdown.sub!(yart_lines.join("\n"), html)
      render
    end
def render return @markdown unless $yart_installed lines = @markdown . split ( "\n" ) return @markdown unless yart_snippet? ( lines ) yart_lines = extract_yart_lines ( lines ) yart_snippet = yart_lines [ 1 .. - 2 ] . join ( "\n" ) raise YART_PARSE_ERROR if yart_snippet . include? ( "YART.parse" ) html = YART . parse { eval ( yart_snippet ) } @markdown . sub! ( yart_lines . join ( "\n" ) , html ) render end
Returns a String of Markdown (having recursively rendered any found YART snippets into HTML).
Returns a String of Markdown ( having recursively rendered any found YART snippets into HTML ) .