Sha256: dea117267213b6b3a6549e11e5f9f8aefafdde1fe4585d8547dac74b30300382

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# Marky is a simple markdown parser written in Nila and runs on Nodejs. 
# This will demonstrate the power and expressiveness of Nila. We will also 
# provide the Ruby version of the parser so that you can see how easy it
# is to port code from Ruby to Javascript using Nila

# This parser was written by Sri Madhavi Rajasekaran and is released under
# the MIT License.

# If you want to learn more about Nila, please visit http://adhithyan15.github.io/nila

require 'fs'

def parse_markdown(input_file)

  fs.readFile input_file, 'utf8', do |err,data| 
      puts err if err
      puts data
  end

end

commandline_args = []

process.argv.forEach do |val,index,array|

  commandline_args << val

end

parsed_args = commandline_args[2..last]

unless parsed_args.empty?

    if parsed_args[0].include?("-c")
    
      file_name = parsed_args[1]
    
      unless file_name.undefined?
       
        parse_markdown file_name 
        
      else
      
        puts "No file has been specified!"
      
      end
    
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nilac-0.0.4.3.9.5 examples/marky.nila