walle / gimli

Utility for converting markup files to pdf files
https://github.com/walle/gimli
MIT License
538 stars 44 forks source link

Can't get this to work in actual Ruby programs #62

Closed zachfeldman closed 9 years ago

zachfeldman commented 9 years ago

I tried using Backticks (there's no documentation for just using a class/module if this is possible) and I get no output

`gimli /Users/zachfeldman/dev/curriculum/workshops/terminal-commands.md -outputdir /Users/zachfeldman/Desktop/`

this returns true using system and backticks but no output is made. Any advice @walle ?

walle commented 9 years ago

Does it work if you use the -f flag?

Eg.

`gimli -f /Users/zachfeldman/dev/curriculum/workshops/terminal-commands.md -o /Users/zachfeldman/Desktop/`

The behaviour when not using the -f flag to convert a specific file is to convert all files in the current directory. If it does not work I will look into it.

zachfeldman commented 9 years ago

Bingo! May want to add more examples in the docs of using it within a Ruby app? THanks though!

walle commented 9 years ago

Good :)

Yea, it would be nice, but for now. If you look at the bin/ script https://github.com/walle/gimli/blob/11278758f08e2a14a05edc7290df0da5c121de59/bin/gimli it gives an overview of using the code as a library. Set up the config object and run Gimli#process! The Gimli#process! https://github.com/walle/gimli/blob/11278758f08e2a14a05edc7290df0da5c121de59/lib/gimli.rb#L29 method in it's turn basically just calls Converter#convert! https://github.com/walle/gimli/blob/11278758f08e2a14a05edc7290df0da5c121de59/lib/gimli/converter.rb#L27