Sha256: 86f732505f601647ef2ffbb8b859d65e6bc43e15af192d2100d743dc236e49d7

Contents?: true

Size: 751 Bytes

Versions: 23

Compression:

Stored size: 751 Bytes

Contents

# frozen_string_literal: true

module Docs
  module Guides
    class Generator < Docs::Generator
      def generate
        clear_dir(
          self.class.destination_folder,
          except: [
            'index.md'
          ]
        )

        ledgers.each_with_index do |ledger, i|
          Docs::Template.new(
            data: {
              ledger: ledger,
              weight: i + 1
            },
            destination_path: destination_path(
              self.class.destination_folder,
              ledger.root_key
            ),
            template_path: template_path(:guides, :ledger)
          ).write

          nl
        end
      end

      def self.destination_folder
        'guides/ledgers'
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ledger_sync-3.0.0 documentation/generators/guides/generator.rb
ledger_sync-2.6.0 documentation/generators/guides/generator.rb
ledger_sync-2.5.0 documentation/generators/guides/generator.rb
ledger_sync-2.4.4 documentation/generators/guides/generator.rb
ledger_sync-2.3.1 documentation/generators/guides/generator.rb
ledger_sync-2.2.3 documentation/generators/guides/generator.rb
ledger_sync-2.2.1 documentation/generators/guides/generator.rb
ledger_sync-2.2.0 documentation/generators/guides/generator.rb
ledger_sync-2.0.2 documentation/generators/guides/generator.rb
ledger_sync-2.0.1 documentation/generators/guides/generator.rb
ledger_sync-2.0.0 documentation/generators/guides/generator.rb
ledger_sync-2.0.0.pre.1 documentation/generators/guides/generator.rb
ledger_sync-1.8.1 documentation/generators/guides/generator.rb
ledger_sync-1.8.0 documentation/generators/guides/generator.rb
ledger_sync-1.7.0 documentation/generators/guides/generator.rb
ledger_sync-1.6.0 documentation/generators/guides/generator.rb
ledger_sync-1.5.2 documentation/generators/guides/generator.rb
ledger_sync-1.5.1 documentation/generators/guides/generator.rb
ledger_sync-1.5.0 documentation/generators/guides/generator.rb
ledger_sync-1.4.4 documentation/generators/guides/generator.rb