Sha256: 589460905191a581fdc423cc8efd7b2858b78fcf7af5bd8740434c3a2902b567

Contents?: true

Size: 1.61 KB

Versions: 7

Compression:

Stored size: 1.61 KB

Contents

# -*- encoding: utf-8 -*-
################################################################################
# Time-stamp: <Mon 2020-04-20 17:52 svarrette>
################################################################################
# Interface for Bootstrapping MkDocs
#

require "falkorlib"
require "falkorlib/common"
require "falkorlib/bootstrap"

require 'erb' # required for module generation
require 'artii'
require 'facter'

include FalkorLib::Common

module FalkorLib
  module Bootstrap #:nodoc:

    module_function

    ###### mkdocs ######
    # Initialize MkDocs in the current directory
    # Supported options:
    #  * :force       [boolean] force overwritting
    ##
    def mkdocs(dir = Dir.pwd, options = {})
      info "Initialize MkDocs (see http://www.mkdocs.org/)"
      path = normalized_path(dir)
      use_git = FalkorLib::Git.init?(path)
      rootdir = (use_git) ? FalkorLib::Git.rootdir(path) : path
      templatedir = File.join( FalkorLib.templates, 'mkdocs')
      config = guess_project_config(rootdir, options)
      config[:rootdir]  = rootdir
      config[:sitename] = ask("\tSite name: ", config[:name])
      #FalkorLib::GitFlow.start('feature', 'mkdocs', rootdir) if (use_git && FalkorLib::GitFlow.init?(rootdir))
      init_from_template(templatedir, rootdir, config,
                         :no_interaction => true,
                         :no_commit => true)
      Dir.chdir( File.join(rootdir, 'docs')) do
        run %(ln -s README.md index.md )
        run %(ln -s README.md contributing/index.md )
      end
      #exit_status.to_i
    end # mkdocs

  end # module Bootstrap
end # module FalkorLib

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
falkorlib-0.9.1 lib/falkorlib/bootstrap/mkdocs.rb
falkorlib-0.9.0 lib/falkorlib/bootstrap/mkdocs.rb
falkorlib-0.8.10 lib/falkorlib/bootstrap/mkdocs.rb
falkorlib-0.8.9 lib/falkorlib/bootstrap/mkdocs.rb
falkorlib-0.8.8 lib/falkorlib/bootstrap/mkdocs.rb
falkorlib-0.8.7 lib/falkorlib/bootstrap/mkdocs.rb
falkorlib-0.8.6 lib/falkorlib/bootstrap/mkdocs.rb