Class: TeamApi::Snippets

Inherits:
Object
  • Object
show all
Defined in:
lib/team_api/snippets.rb

Constant Summary collapse

HEADLINE =

Used to convert snippet headline markers to h4, since the layout uses h3.

"\n####"
MARKDOWN_SNIPPET_MUNGER =
proc do |text|
  text.gsub!(/^::: (.*) :::$/, "#{HEADLINE} \\1") # For jtag. ;-)
  text.gsub!(/^\*\*\*/, HEADLINE) # For elaine. ;-)
end

Class Method Summary collapse

Class Method Details

.publish(site) ⇒ Object

TODO(mbland): Push this to the snippet import script.



17
18
19
20
21
22
# File 'lib/team_api/snippets.rb', line 17

def self.publish(site)
  publisher = ::WeeklySnippets::Publisher.new(
    headline: HEADLINE, public_mode: site.config['public'],
    markdown_snippet_munger: MARKDOWN_SNIPPET_MUNGER)
  site.data['snippets'] = publisher.publish site.data['snippets']
end