Class: Redcarpet::Render::ManPage

### Home Classes Methods

### In Files

- lib/redcarpet/render_man.rb

### Parent

Base

### Methods

- #block_code
- #codespan
- #double_emphasis
- #emphasis
- #header
- #linebreak
- #list
- #list_item
- #normal_text
- #paragraph

### Class/Module Index

Quicksearch

- Redcarpet
- Redcarpet::CLI
- Redcarpet::Markdown
- Redcarpet::Render
- Redcarpet::Render::ManPage
- Redcarpet::Render::Safe
- Redcarpet::Render::SmartyHTML
- Redcarpet::Render::SmartyPants
- Redcarpet::Render::StripDown
- Redcarpet::Render::XHTML
- Object
- RedcarpetCompat

No matching classes.

# Redcarpet::Render::ManPage

### Public Instance Methods

block_code(code, language) click to toggle source

    # File lib/redcarpet/render_man.rb, line 9
    def block_code(code, language)
      "\n.nf\n#{normal_text(code)}\n.fi\n"
    end

codespan(code) click to toggle source

    # File lib/redcarpet/render_man.rb, line 13
    def codespan(code)
      block_code(code, nil)
    end

double_emphasis(text) click to toggle source

    # File lib/redcarpet/render_man.rb, line 30
    def double_emphasis(text)
      "\\fB#{text}\\fP"
    end

emphasis(text) click to toggle source

    # File lib/redcarpet/render_man.rb, line 34
    def emphasis(text)
      "\\fI#{text}\\fP"
    end

header(title, level) click to toggle source

    # File lib/redcarpet/render_man.rb, line 17
    def header(title, level)
      case level
      when 1
        "\n.TH #{title}\n"

      when 2
        "\n.SH #{title}\n"

      when 3
        "\n.SS #{title}\n"
      end
    end

linebreak() click to toggle source

    # File lib/redcarpet/render_man.rb, line 38
    def linebreak
      "\n.LP\n"
    end

list(content, list_type) click to toggle source

    # File lib/redcarpet/render_man.rb, line 46
    def list(content, list_type)
      case list_type
      when :ordered
        "\n\n.nr step 0 1\n#{content}\n"
      when :unordered
        "\n.\n#{content}\n"
      end
    end

list_item(content, list_type) click to toggle source

    # File lib/redcarpet/render_man.rb, line 55
    def list_item(content, list_type)
      case list_type
      when :ordered
        ".IP \\n+[step]\n#{content.strip}\n"
      when :unordered
        ".IP \\[bu] 2 \n#{content.strip}\n"
      end
    end

normal_text(text) click to toggle source

    # File lib/redcarpet/render_man.rb, line 5
    def normal_text(text)
      text.gsub('-', '\-').strip
    end

paragraph(text) click to toggle source

    # File lib/redcarpet/render_man.rb, line 42
    def paragraph(text)
      "\n.TP\n#{text}\n"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.