#!/usr/bin/ruby
require "puredoc/xhtpdoc"

# This class makes PureDoc with XHTML using inline style as extended expression.
class PureDoc::HTMLWithStyle < PureDoc::XHTPureDoc
  std :c, "code", t:"title", inline:true
  std :cb, "code", style: {"display" => "block", "white-space" => "pre-wrap"}, t:"title"
  std :s, "samp", t:"title" , c:"class", inline:true
  std :sb, "samp", t:"title", style: {"display" => "block", "white-space" => "pre", "max-width" => "80%", "margin" => "auto", "overflow" => "scroll" }, c:"class"
  std :wsb, "samp", t:"title", style: {"display" => "block", "white-space" => "pre-wrap"}, c:"class"
  std :i, "tt", cls: "puredoc_idname", inline:true
  std :f, "tt", cls: "puredoc_pathname", inline:true
  std :t, "span", cls: "puredoc_title", style: { "text-style" => "italic" }, inline:true
  std :val, "tt", cls: "puredoc_value", inline:true
  std :nb, "div", cls: "puredoc_noteblock", c:"class"
  std :cmd, "tt", cls: "puredoc_cmdname", inline:true
  
  def initialize
    @fig_with_style = true
    super
  end
  
  # Note
  def n(note, &text)
    puredoc_element(:n) do
      addnote esc!(note)
      '<span class="puredoc_note" title="%s">%s</pure:note>' % [esc!(note), esc(text.call) ]
    end
  end
  
  #manpage
  def m(sec, text)
    puredoc_element(:n) do
      '<span style="font_style: italic;">%s(%d)</span>' % [esc(text), sec]
    end
  end
  
end


=begin DEBUG

cp = PureDoc::HTMLWithStyle.new
puts cp.is { cb "somecode" }

=end
