lib/markdown-helpers/doc_tree_builder.rb
# recursive call on directories starting at @doc_directory
# writes indented list block for each directory
recursive call on directories starting at @doc_directory
writes indented list block for each directory
recursive call on directories starting at @doc_directory writes indented list block for each directory
def generate_index(
    options = {
      directory: @config['doc_directory'],
      level: @config['base_level'],
      header_level: @config['base_header']
    }
  )
    sub_directories = Dir.entries(options[:directory])
    directory_last = true
    sub_directories.each do |filename|
      next if ignore_file?(filename, options[:directory])
      path = File.join(options[:directory], filename)
      if File.directory?(path)
        options[:level] = options[:level] - 1 if directory_last && options[:level] > 0
        concat_directory(path, options[:level] + 1, options[:header_level])
        directory_last = true
      else
        concat_file(path, options[:level])
        directory_last = false
      end
    end
  end
def generate_index ( options = { directory : @config [ 'doc_directory' ] , level : @config [ 'base_level' ] , header_level : @config [ 'base_header' ] } ) sub_directories = Dir . entries ( options [ :directory ] ) directory_last = true sub_directories . each do | filename | next if ignore_file? ( filename , options [ :directory ] ) path = File . join ( options [ :directory ] , filename ) if File . directory? ( path ) options [ :level ] = options [ :level ] - 1 if directory_last && options [ :level ] > 0 concat_directory ( path , options [ :level ] + 1 , options [ :header_level ] ) directory_last = true else concat_file ( path , options [ :level ] ) directory_last = false end end end
recursive call on directories starting at @doc_directory
writes indented list block for each directory
recursive call on directories starting at @doc_directory writes indented list block for each directory
# case where two directories are back to back
options
<not_specific>