Class | SM::PreProcess |
In: |
markup/simple_markup/preprocess.rb
|
Parent: | Object |
# File markup/simple_markup/preprocess.rb, line 11 11: def initialize(input_file_name, include_path) 12: @input_file_name = input_file_name 13: @include_path = include_path 14: end
Look for common options in a chunk of text. Options that we don‘t handle are passed back to our caller as |directive, param|
# File markup/simple_markup/preprocess.rb, line 20 20: def handle(text) 21: text.gsub!(/^([ \t#]*):(\w+):\s*(.+)?\n/) do 22: prefix = $1 23: directive = $2.downcase 24: param = $3 25: 26: case directive 27: when "include" 28: filename = param.split[0] 29: include_file(filename, prefix) 30: 31: else 32: yield(directive, param) 33: end 34: end 35: end