Class: Gmi2LaTeX::Command
- Inherits:
-
Object
- Object
- Gmi2LaTeX::Command
- Defined in:
- lib/gmi2latex/command.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.run ⇒ Object
7 8 9 |
# File 'lib/gmi2latex/command.rb', line 7 def self.run new.run end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/gmi2latex/command.rb', line 11 def run header = <<~LaTeX \\RequirePackage{plautopatch} \\documentclass[a4paper,article,dvipdfmx]{jlreq} \\usepackage{hyperref} \\begin{document} LaTeX = "\\end{document}\n" OptionParser.new do |parser| parser.on("--header=SOURCE") { |source| header = source } parser.on("--footer=SOURCE") { |source| = source } end.parse! doc = Gemtext::Parser.new($stdin).parse Renderer.new(doc, header:, footer:).render end |