Add some app examples
This commit is contained in:
parent
966052ce82
commit
3fedbc2a71
3 changed files with 29 additions and 139 deletions
|
@ -5,7 +5,7 @@ class ApiExampleFilter < Nanoc::Filter
|
|||
type :text
|
||||
|
||||
def run(content, params={})
|
||||
content.gsub(/\{(\w+) example\}/) { api_example($1) }
|
||||
content.gsub(/\{(\w+) example\}/) { api_example($1) }.gsub(/\{(\w+) var\}/) { api_var($1) }
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -13,4 +13,8 @@ class ApiExampleFilter < Nanoc::Filter
|
|||
def api_example(id)
|
||||
TentApiDoc.examples[id.to_sym]
|
||||
end
|
||||
|
||||
def api_var(id)
|
||||
TentApiDoc.variables[id.to_sym]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue