Sha256: e00de7eec66964e3f6bd5cbce4d04ee67b4d6162611950a48a81da5a713d9214

Contents?: true

Size: 828 Bytes

Versions: 18

Compression:

Stored size: 828 Bytes

Contents

view(:summary) do |*args|
  params = args.extract_options!
  briefcase = args.first

  briefcase.present(:default, params).tap do |hash|
    if summary = briefcase.pages.find {|p| p.title == "Summary" }
      hash[:summary] = summary.to_model.as_json(params)
    end

    if briefcase.has_table_of_contents?
      hash[:table_of_contents] = table_of_contents.as_json(params)
    end
  end
end

config do
  set(:documentation_path, File.join(File.dirname(__FILE__), 'documentation'))
end

command(:sync) do |*args|
  puts "== Sync command is empty.  Define in your brief.rb"
end

class Brief::Briefcase
  def has_table_of_contents?
    docs_path.join('index.md').exist?
  end

  def table_of_contents
    doc = Brief::Document.new(briefcase.docs_path.join("index.md"), document_type: "outline")
    doc && doc.to_model
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
brief-1.17.14 apps/blueprint/config.rb
brief-1.17.13 apps/blueprint/config.rb
brief-1.17.12 apps/blueprint/config.rb
brief-1.17.11 apps/blueprint/config.rb
brief-1.17.10 apps/blueprint/config.rb
brief-1.17.9 apps/blueprint/config.rb
brief-1.17.8 apps/blueprint/config.rb
brief-1.17.7 apps/blueprint/config.rb
brief-1.17.5 apps/blueprint/config.rb
brief-1.17.4 apps/blueprint/config.rb
brief-1.17.3 apps/blueprint/config.rb
brief-1.17.2 apps/blueprint/config.rb
brief-1.17.1 apps/blueprint/config.rb
brief-1.17.0 apps/blueprint/config.rb
brief-1.16.2 apps/blueprint/config.rb
brief-1.16.1 apps/blueprint/config.rb
brief-1.16.0 apps/blueprint/config.rb
brief-1.15.5 apps/blueprint/config.rb