Add Q.js documentation

pull/241/head
Constantine Kim 10 years ago committed by Thibaut
parent 955ef5de95
commit a00e45e829

@ -0,0 +1,6 @@
#= require views/pages/base
class app.views.QPage extends app.views.BasePage
afterRender: ->
@highlightCode @findAll('.highlight-js > pre'), 'javascript'
return

@ -59,6 +59,7 @@
'pages/php',
'pages/phpunit',
'pages/postgres',
'pages/q',
'pages/rdoc',
'pages/react',
'pages/redis',

@ -59,6 +59,7 @@
'pages/php',
'pages/phpunit',
'pages/postgres',
'pages/q',
'pages/rdoc',
'pages/react',
'pages/redis',

@ -0,0 +1,5 @@
._q {
> h3 { @extend %block-heading; }
> h4 { @extend %block-label, %label-blue; }
code { @extend %label; }
}

@ -0,0 +1,16 @@
module Docs
class Q
class CleanHtmlFilter < Filter
def call
@doc = at_css('.markdown-body')
css('h3 > a, h4 > a').each do |node|
node.parent['id'] = node['href'].remove('#')
node.remove
end
doc
end
end
end
end

@ -0,0 +1,42 @@
module Docs
class Q
class EntriesFilter < Docs::EntriesFilter
def additional_entries
entries = []
type = ''
entry = []
css('h3, h4, em:contains("Alias")').each do |node|
if node.name == 'h3'
type = node.content.strip
if type == "Q.defer()" # Q.defer() is a method, but it also plays a section title role.
entries << ['Q.defer', 'qdefer', 'Q.defer()']
end
next
end
if node.name == 'h4'
name = node.content.strip.remove(/\(.*?\).*/)
link = node['id']
entry = [name, link, type]
entries << entry
next
end
if node.name == 'em' # for the aliases
aliasEntry = entry.clone
aliasEntry[0] = node.parent.at_css('code').content
entries << aliasEntry
next
end
end
entries
end
end
end
end

@ -0,0 +1,22 @@
module Docs
class Q < UrlScraper
self.name = 'Q'
self.slug = 'Q'
self.type = 'Q'
self.version = '1.4.1'
self.base_url = "https://github.com/kriskowal/q/wiki/API-Reference"
self.links = {
home: 'https://github.com/kriskowal/q/',
code: 'https://github.com/kriskowal/q/'
}
html_filters.push 'q/clean_html', 'q/entries', 'title'
options[:title] = 'Q'
options[:skip_links] = true
options[:attribution] = <<-HTML
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

@ -0,0 +1 @@
http://kriskowal.github.io/q/q.png
Loading…
Cancel
Save