Module: BuildMaster::ContentEngine

Included in:
MarkdownEngine, TextileEngine
Defined in:
lib/buildmaster/site/content_engine_repository.rb

Constant Summary collapse

@@TEXTILE_REGX =

todo match only beginning of the file

/---(-)*\n(.*)\n(-)*---\n/

Instance Method Summary collapse

Instance Method Details

#process_content_with_title(full_content) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/buildmaster/site/content_engine_repository.rb', line 36

def process_content_with_title(full_content)
  match_result = @@TEXTILE_REGX.match(full_content)
  title = ''
  body_content = full_content
  if match_result != nil
    title = match_result[2]
    body_content = match_result.post_match
  end
  html_body = yield body_content
  html_content = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"\nxmlns:template=\"http://buildmaster.rubyforge.org/xtemplate/1.0\">\n<head>\n<title>\#{title}</title>\n</head>\n<body>      \n  \#{html_body}\n</body>\n</html>\n"
  return html_content     
end