Class: Useless::Doc::UI::Godel
- Inherits:
-
Object
- Object
- Useless::Doc::UI::Godel
show all
- Includes:
- Useless::Doc::UI
- Defined in:
- lib/useless/doc/ui/godel.rb
Defined Under Namespace
Classes: API, Domain, Request, Resource, Response, Stage
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(router) ⇒ Godel
Returns a new instance of Godel.
33
34
35
|
# File 'lib/useless/doc/ui/godel.rb', line 33
def initialize(router)
@router = router
end
|
Class Method Details
.asset_path ⇒ Object
16
17
18
|
# File 'lib/useless/doc/ui/godel.rb', line 16
def self.asset_path
File.dirname(__FILE__) + '/godel'
end
|
.markdown ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/useless/doc/ui/godel.rb', line 20
def self.markdown
@markdown ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML,
:no_intra_emphasis => true, :tables => true,
:fenced_code_blocks => true,:autolink => true,
:space_after_headers => true, :lax_spacing => true,
:superscript => true)
end
|
.strip_heredoc(string) ⇒ Object
28
29
30
31
|
# File 'lib/useless/doc/ui/godel.rb', line 28
def self.strip_heredoc(string)
indent = string.scan(/^[ \t]*(?=\S)/).min.size
string.gsub(/^[ \t]{#{indent}}/, '')
end
|
Instance Method Details
#css(entity = nil) ⇒ Object
49
50
51
|
# File 'lib/useless/doc/ui/godel.rb', line 49
def css(entity = nil)
File.read(Godel.asset_path + '/stylesheet.css')
end
|