Module Webgen::SourceHandler::Base::OutputPathHelpers
In: lib/webgen/sourcehandler/base.rb
Error RenderError CommandNotFoundError LoadError NodeCreationError ::Rake::TaskLib WebgenTask Helpers Configuration Node Context\n[lib/webgen/context.rb\nlib/webgen/context/nodes.rb\nlib/webgen/context/render.rb\nlib/webgen/context/tags.rb] Tree FileSystem Sitemap Copy Feed Virtual Sitemap Directory Page Fragment Template Metainfo Memory Coderay Sitemap IncludeFile BreadcrumbTrail Langbar TikZ Menu Tags Fragments Resource Website Tidy Head Kramdown Less Xmllint Blocks Comparable Language Path StandardError CmdParse::CommandParser CommandParser CmdParse::Command RunCommand WebguiCommand CreateCommand ApplyCommand WebsiteAccess Main Loggable OutputPathHelpers ExecuteCommand Link Date Relocatable Metainfo ::Kramdown::Converter::Html KramdownHtmlConverter Cache Blackboard WebsiteManager Logger Page ProxyNode Utils Scss RDoc Sass Erb RDiscount Erubis Haml Maruku Builder RedCloth AccessHash TarArchive Stacked FileSystem lib/webgen/cache.rb lib/webgen/error.rb lib/webgen/languages.rb lib/webgen/context/render.rb lib/webgen/website.rb lib/webgen/blackboard.rb lib/webgen/tree.rb lib/webgen/websitemanager.rb lib/webgen/logger.rb lib/webgen/configuration.rb lib/webgen/path.rb lib/webgen/webgentask.rb lib/webgen/page.rb lib/webgen/node.rb ClassMethods WebsiteAccess lib/webgen/cli/run_command.rb lib/webgen/cli/utils.rb lib/webgen/cli/apply_command.rb lib/webgen/cli/webgui_command.rb lib/webgen/cli.rb lib/webgen/cli/create_command.rb Color CLI LanguageManager lib/webgen/output/filesystem.rb Output lib/webgen/common/sitemap.rb Common lib/webgen/sourcehandler/memory.rb lib/webgen/sourcehandler/metainfo.rb lib/webgen/sourcehandler/copy.rb lib/webgen/sourcehandler/directory.rb lib/webgen/sourcehandler.rb lib/webgen/sourcehandler/page.rb lib/webgen/sourcehandler/template.rb lib/webgen/sourcehandler/fragment.rb lib/webgen/sourcehandler/sitemap.rb lib/webgen/sourcehandler/virtual.rb lib/webgen/sourcehandler/feed.rb OutputPathHelpers Base SourceHandler lib/webgen/tag/coderay.rb lib/webgen/tag/relocatable.rb lib/webgen/tag/menu.rb lib/webgen/tag/langbar.rb lib/webgen/tag/executecommand.rb lib/webgen/tag/breadcrumbtrail.rb lib/webgen/tag/metainfo.rb lib/webgen/tag/includefile.rb lib/webgen/tag/link.rb lib/webgen/tag/date.rb lib/webgen/tag/tikz.rb lib/webgen/tag/sitemap.rb Base Tag lib/webgen/contentprocessor/less.rb lib/webgen/contentprocessor/scss.rb lib/webgen/contentprocessor/blocks.rb lib/webgen/contentprocessor/rdoc.rb lib/webgen/contentprocessor/sass.rb lib/webgen/contentprocessor/erb.rb lib/webgen/contentprocessor/rdiscount.rb lib/webgen/contentprocessor/tags.rb lib/webgen/contentprocessor/erubis.rb lib/webgen/contentprocessor/kramdown/html.rb lib/webgen/contentprocessor/haml.rb lib/webgen/contentprocessor/maruku.rb lib/webgen/contentprocessor/xmllint.rb lib/webgen/contentprocessor/kramdown.rb lib/webgen/contentprocessor/head.rb lib/webgen/contentprocessor/builder.rb lib/webgen/contentprocessor/tidy.rb lib/webgen/contentprocessor/redcloth.rb lib/webgen/contentprocessor/fragments.rb lib/webgen/contentprocessor.rb ContentProcessor lib/webgen/source/tararchive.rb lib/webgen/source/stacked.rb lib/webgen/source/resource.rb lib/webgen/source/filesystem.rb Source Loggable Webgen dot/m_82_0.png

This module is used for defining all methods that can be used for creating output paths.

All public methods of this module are considered to be output path creation methods and must have the following parameters:

parent
the parent node
path
the path for which the output name should be created
use_lang_part
controls whether the output path name has to include the language part

Methods

Public Instance methods

Default method for creating an output path for parent and source path.

The automatically set parameter style (which uses the meta information output_path_style from the path‘s meta information hash) defines how the output name should be built (more information about this in the user documentation).

[Source]

     # File lib/webgen/sourcehandler/base.rb, line 145
145:       def standard_output_path(parent, path, use_lang_part, style = path.meta_info['output_path_style'])
146:         result = style.collect do |part|
147:           case part
148:           when String  then part
149:           when :lang   then use_lang_part ? path.meta_info['lang'] : ''
150:           when :ext    then path.ext.empty? ? '' : '.' + path.ext
151:           when :parent then temp = parent; temp = temp.parent while temp.is_fragment?; temp.path
152:           when :year, :month, :day
153:             ctime = path.meta_info['created_at']
154:             if !ctime.kind_of?(Time)
155:               raise Webgen::NodeCreationError.new("Invalid meta info 'created_at', needed because of used output path style",
156:                                                   self.class.name, path)
157:             end
158:             ctime.send(part).to_s.rjust(2, '0')
159:           when Symbol  then path.send(part)
160:           when Array   then part.include?(:lang) && !use_lang_part ? '' : standard_output_path(parent, path, use_lang_part, part)
161:           else ''
162:           end
163:         end
164:         result.join('')
165:       end

[Validate]