Sha256: fc798b5076b2d1923e029196634c55656d0c9653c7f9705928e289abbb204ed7

Contents?: true

Size: 796 Bytes

Versions: 3

Compression:

Stored size: 796 Bytes

Contents

require "pathname"
require "metanorma/cli/site_generator"

module Metanorma
  module Cli
    module Commands
      class Site < Thor
        desc "generate SOURCE_PATH", "Geneate site from collection"
        option :config, aliases: "-c", desc: "The metanorma configuration file"
        option(
          :output_dir,
          aliases: "-o",
          default: Pathname.new(Dir.pwd).join("site").to_s,
          desc: "Output directory for the generated site",
        )

        def generate(source_path)
          Cli::SiteGenerator.generate(source_path, options.dup)
          UI.say("Site has been generated at #{options[:output_dir]}")
        rescue Cli::Errors::InvalidManifestFileError
          UI.error("Invalid data in: #{options[:config]}")
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metanorma-cli-1.4.1 lib/metanorma/cli/commands/site.rb
metanorma-cli-1.4.1pre3 lib/metanorma/cli/commands/site.rb
metanorma-cli-1.4.1pre2 lib/metanorma/cli/commands/site.rb