diff --git a/lib/docs/filters/mongodb/clean_html.rb b/lib/docs/filters/mongodb/clean_html.rb new file mode 100644 index 0000000000..30cd9e0217 --- /dev/null +++ b/lib/docs/filters/mongodb/clean_html.rb @@ -0,0 +1,11 @@ +module Docs + class Mongodb + class CleanHtmlFilter < Filter + def call + css('.headerlink').remove + + doc + end + end + end +end \ No newline at end of file diff --git a/lib/docs/filters/mongodb/entries.rb b/lib/docs/filters/mongodb/entries.rb new file mode 100644 index 0000000000..1df74a225c --- /dev/null +++ b/lib/docs/filters/mongodb/entries.rb @@ -0,0 +1,13 @@ +module Docs + class Mongodb + class EntriesFilter < Docs::EntriesFilter + def get_name + at_css('h1').content + end + + def get_type + subpath[/\A[^\/]+/] + end + end + end +end \ No newline at end of file diff --git a/lib/docs/scrapers/mongodb.rb b/lib/docs/scrapers/mongodb.rb new file mode 100644 index 0000000000..ab0a472cea --- /dev/null +++ b/lib/docs/scrapers/mongodb.rb @@ -0,0 +1,13 @@ +module Docs + class Mongodb < UrlScraper + self.name = 'Mongodb' + self.type = 'mongodb' + self.version = '2.6.0' + self.base_url = 'http://docs.mongodb.org/manual/reference/' + + html_filters.push 'mongodb/clean_html', 'mongodb/entries' + + options[:container] = '.body .section' + + end +end \ No newline at end of file diff --git a/public/icons/docs/mongodb/16.png b/public/icons/docs/mongodb/16.png new file mode 100644 index 0000000000..e5d515dcda Binary files /dev/null and b/public/icons/docs/mongodb/16.png differ diff --git a/public/icons/docs/mongodb/16@2x.png b/public/icons/docs/mongodb/16@2x.png new file mode 100644 index 0000000000..5e5859d694 Binary files /dev/null and b/public/icons/docs/mongodb/16@2x.png differ