Module YARD::Templates::Helpers::HtmlHelper
In: lib/yard/templates/helpers/html_helper.rb

The helper module for HTML templates.

Methods

Included Modules

MarkupHelper HtmlSyntaxHighlightHelper

Public Instance methods

@param [CodeObjects::Base] object the object to get an anchor for @return [String] the anchor for a specific object

Returns the current character set. The default value can be overridden by setting the LANG environment variable or by overriding this method. In Ruby 1.9 you can also modify this value by setting +Encoding.default_external+.

@return [String] the current character set @since 0.5.4

Formats a list of objects and links them @return [String] a formatted list of objects

Formats a list of types from a tag.

@param [Array<String>, FalseClass] typelist

  the list of types to be formatted.

@param [Boolean] brackets omits the surrounding

  brackets if +brackets+ is set to +false+.

@return [String] the list of types formatted

  as [Type1, Type2, ...] with the types linked
  to their respective descriptions.

Escapes HTML entities

@param [String] text the text to escape @return [String] the HTML with escaped entities

Converts HTML to HTML @param [String] text input html @return [String] output HTML @since 0.6.0

Converts Markdown to HTML @param [String] text input Markdown text @return [String] output HTML @since 0.6.0

@return [String] the same text with no markup @since 0.6.6

Converts plaintext to pre-formatted HTML @param [String] text the input text @return [String] the output HTML @since 0.6.0

Converts RDoc formatting (SimpleMarkup) to HTML @param [String] text the input RDoc formatted text @return [String] output HTML @since 0.6.0

Highlights Ruby source. Similar to {html_syntax_highlight}, but this method is meant to be called from {htmlify} when markup is set to "ruby".

@param [String] source the Ruby source @return [String] the highlighted HTML @since 0.7.0

Converts plaintext to regular HTML @param [String] text the input text @return [String] the output HTML @since 0.6.0

Converts Textile to HTML @param [String] text the input Textile text @return [String] output HTML @since 0.6.0

Converts plaintext to strict Textile (hard breaks) @param [String] text the input textile data @return [String] the output HTML @since 0.6.0

Syntax highlights source in language type.

@note To support a specific language type, implement the method

  +html_syntax_highlight_TYPE+ in this class.

@param [String] source the source code to highlight @param [Symbol, String] type the language type (:ruby, :plain, etc). Use

  :plain for no syntax highlighting.

@return [String] the highlighted source

@return [String] unhighlighted source

Turns text into HTML using markup style formatting.

@param [String] text the text to format @param [Symbol] markup examples are +:markdown+, +:textile+, +:rdoc+.

  To add a custom markup type, see {MarkupHelper}

@return [String] the HTML

@return [String] HTMLified text as a single line (paragraphs removed)

Resolves any text in the form of +{Name}+ to the object specified by Name. Also supports link titles in the form +{Name title}+.

@example Linking to an instance method

  resolve_links("{MyClass#method}") # => "<a href='...'>MyClass#method</a>"

@example Linking to a class with a title

  resolve_links("{A::B::C the C class}") # => "<a href='...'>the c class</a>"

@param [String] text the text to resolve links in @return [String] HTML with linkified references

Formats the signature of method meth.

@param [CodeObjects::MethodObject] meth the method object to list

  the signature of

@param [Boolean] link whether to link the method signature to the details view @param [Boolean] show_extras whether to show extra meta-data (visibility, attribute info) @param [Boolean] full_attr_name whether to show the full attribute name

  ("name=" instead of "name")

@return [String] the formatted method signature

Get the return types for a method signature.

@param [CodeObjects::MethodObject] meth the method object @param [Boolean] link whether to link the types @return [String] the signature types @since 0.5.3

Returns the URL for an object.

@param [String, CodeObjects::Base] obj the object (or object path) to link to @param [String] anchor the anchor to link to @param [Boolean] relative use a relative or absolute link @return [String] the URL location of the object

Returns the URL for a specific file

@param [String, CodeObjects::ExtraFileObject] filename the filename to link to @param [String] anchor optional anchor @return [String] the URL pointing to the file

Returns the URL for the frameset page

@return [String] the URL pointing to the frames page @since 0.8.0

Returns the URL for the alphabetic index page

@return [String] the URL pointing to the first main page the

  user should see.

Returns the URL for a list type

@param [String, Symbol] type the list type to generate a URL for @return [String] the URL pointing to the list @since 0.8.0

Returns the URL for the main page (README or alphabetic index)

@return [String] the URL pointing to the first main page the

  user should see.

Escapes a URL

@param [String] text the URL @return [String] the escaped URL

[Validate]