Module: CTioga2::Commands::Documentation
- Defined in:
- lib/ctioga2/commands/doc/doc.rb,
lib/ctioga2/commands/doc/man.rb,
lib/ctioga2/commands/doc/help.rb,
lib/ctioga2/commands/doc/html.rb,
lib/ctioga2/commands/doc/markup.rb,
lib/ctioga2/commands/doc/wordwrap.rb,
lib/ctioga2/commands/doc/introspection.rb,
lib/ctioga2/commands/doc/documentation-commands.rb
Overview
The base of the ‘self-documentation’ of CTioga2
Defined Under Namespace
Classes: CommandLineHelp, Doc, HTML, Introspection, Man, MarkedUpText, Markup, WordWrapper
Constant Summary collapse
- InternalFormatRE =
{ /list|raw/i => :list, /default|pretty/i => :pretty, /spec/i => :spec, /yaml/i => :yaml }
- InternalFormatType =
CmdType.new('internal-format', { :type => :re_list, :list => InternalFormatRE}, <<EOD) Output format for internals. EOD
- IntrospectionGroup =
CmdGroup.new('introspection', "Introspection", <<EOD, 100) Commands displaying information about the internals of ctioga2, such as known types/commands/backends... EOD
- TypeOption =
{'format' => CmdArg.new('internal-format')}
- RawOption =
{'raw' => CmdArg.new('boolean')}
- ListCommandsCmd =
Cmd.new('list-commands', nil, '--list-commands', [], RawOption.dup.update(TypeOption)) do |p, opts| opts['format'] = :list if opts['raw'] Introspection.new.list_commands(opts['format']) end
- ListGroupsCmd =
Cmd.new('list-groups', nil, '--list-groups', [], RawOption) do |p, opts| Introspection.new.list_groups(opts['raw']) end
- ListTypesCmd =
Cmd.new('list-types', nil, '--list-types', [], RawOption) do |p, opts| Introspection.new.list_types(opts['raw']) end
- ListStylesCmd =
Cmd.new('list-styles', nil, '--list-styles', [], RawOption) do |p, opts| Introspection.new.list_styles() end
- EditCommandCmd =
Cmd.new('edit-command', nil, '--edit-command', [ CmdArg.new('text')], {'doc' => CmdArg.new('boolean')}) do |plotmaker, cmd, opts| Introspection.new.edit_command(cmd, opts['doc']) end
- EditGroupCmd =
Cmd.new('edit-group', nil, '--edit-group', [ CmdArg.new('text')]) do |plotmaker, cmd| Introspection.new.edit_group(cmd) end
- EditTypeCmd =
Cmd.new('edit-type', nil, '--edit-type', [ CmdArg.new('text')]) do |plotmaker, cmd| Introspection.new.edit_type(cmd) end
- VersionRawCmd =
Cmd.new('version-raw', nil, '--version-raw', [ ]) do |plotmaker| print Version::version end
- DocumentationGenerationGroup =
Documentation generation
CmdGroup.new('doc', "Documentation generation", "Automatic documentation generation.", 1000, true)
- WriteManualPage =
Display help on the command-line
Cmd.new("write-manual-page", nil, "--write-man", [ CmdArg.new('text', 'version'), CmdArg.new('file'), ]) do |plotmaker, version, file| m = Man.new(plotmaker.interpreter.doc) m.write_manual_page(version, file) end
- WriteHTMLOptions =
{ 'page-menu' => CmdArg.new('text'), 'snippets' => CmdArg.new('file') }
- WriteHTMLCommands =
Cmd.new("write-html-commands", nil, "--write-html-commands", [], WriteHTMLOptions) do |plotmaker, opts| html = HTML.new(plotmaker.interpreter.doc) html.write_commands(opts) end
- WriteHTMLFunctions =
Cmd.new("write-html-functions", nil, "--write-html-functions", [], WriteHTMLOptions) do |plotmaker, opts| html = HTML.new(plotmaker.interpreter.doc) html.write_functions(opts) end
- WriteHTMLTypes =
Cmd.new("write-html-types", nil, "--write-html-types", [], WriteHTMLOptions) do |plotmaker, opts| html = HTML.new(plotmaker.interpreter.doc) html.write_types(opts) end
- WriteHTMLStyles =
Cmd.new("write-html-styles", nil, "--write-html-styles", [], WriteHTMLOptions) do |plotmaker, opts| html = HTML.new(plotmaker.interpreter.doc) html.write_styles(opts) end
- HTMLColorsOptions =
{ 'columns' => CmdArg.new('integer'), 'class' => CmdArg.new('text'), 'div-class' => CmdArg.new('text'), 'rect-width' => CmdArg.new('integer'), 'rect-height' => CmdArg.new('integer') }
- WriteHTMLColors =
Cmd.new("write-html-colors", nil, "--write-html-colors", [], HTMLColorsOptions) do |plotmaker, opts| html = HTML.new(plotmaker.interpreter.doc) html.write_colors(opts) end
- WriteHTMLColorSets =
Cmd.new("write-html-color-sets", nil, "--write-html-color-sets", [], HTMLColorsOptions. merge({ 'include' => CmdArg.new('regexp'), 'exclude' => CmdArg.new('regexp') })) do |plotmaker, opts| html = HTML.new(plotmaker.interpreter.doc) html.write_color_sets(opts) end
- WriteHTMLBackends =
Cmd.new("write-html-backends", nil, "--write-html-backends", [], WriteHTMLOptions) do |plotmaker, opts| html = HTML.new(plotmaker.interpreter.doc) html.write_backends(opts) end
- WriteHTMLCommandLineOptions =
Cmd.new("write-html-commandline", nil, "--write-html-commandline", [], WriteHTMLOptions) do |plotmaker, opts| html = HTML.new(plotmaker.interpreter.doc) html.(opts) end
- DumpCommandMarkup =
Cmd.new("dump-command-markup", nil, "--dump-command-markup", []) do |plotmaker| markup = Markup.new(plotmaker.interpreter.doc) markup.write_commands() end
- DumpTypesMarkup =
Cmd.new("dump-types-markup", nil, "--dump-types-markup", []) do |plotmaker| markup = Markup.new(plotmaker.interpreter.doc) markup.write_types() end