From 8f88150d733058bcf337aff8cbc28d4a713ddce7 Mon Sep 17 00:00:00 2001 From: lonewolf Date: Sun, 26 Jun 2016 00:31:46 -0700 Subject: [PATCH] Add matplotlib documentation --- lib/docs/filters/matplotlib/clean_html.rb | 12 +++++++++ lib/docs/filters/matplotlib/entries.rb | 31 ++++++++++++++++++++++ lib/docs/scrapers/matplotlib.rb | 24 +++++++++++++++++ public/icons/docs/matplotlib/16.png | Bin 0 -> 1310 bytes public/icons/docs/matplotlib/16@2x.png | Bin 0 -> 1973 bytes 5 files changed, 67 insertions(+) create mode 100644 lib/docs/filters/matplotlib/clean_html.rb create mode 100644 lib/docs/filters/matplotlib/entries.rb create mode 100644 lib/docs/scrapers/matplotlib.rb create mode 100644 public/icons/docs/matplotlib/16.png create mode 100644 public/icons/docs/matplotlib/16@2x.png diff --git a/lib/docs/filters/matplotlib/clean_html.rb b/lib/docs/filters/matplotlib/clean_html.rb new file mode 100644 index 00000000..5c16605a --- /dev/null +++ b/lib/docs/filters/matplotlib/clean_html.rb @@ -0,0 +1,12 @@ +module Docs + class Matplotlib + class CleanHtmlFilter < Filter + def call + css('.headerlink').each do |node| + node.remove + end + doc + end + end + end +end diff --git a/lib/docs/filters/matplotlib/entries.rb b/lib/docs/filters/matplotlib/entries.rb new file mode 100644 index 00000000..0bf3a53b --- /dev/null +++ b/lib/docs/filters/matplotlib/entries.rb @@ -0,0 +1,31 @@ +module Docs + class Matplotlib + class EntriesFilter < Docs::EntriesFilter + def get_name + name = at_css('h1').content.strip + name.remove! "\u{00b6}" + name + end + + def get_type + name = at_css('h1').content.strip + name.remove! "\u{00b6}" + name + end + + def additional_entries + entries = [] + ents = css('dt .descname') + + if ents + ents.each do |node| + name = node.content.sub(/\(.*\)/, '()') + id = node.parent['id'] + entries << [name, id, get_name] + end + end + entries + end + end + end +end diff --git a/lib/docs/scrapers/matplotlib.rb b/lib/docs/scrapers/matplotlib.rb new file mode 100644 index 00000000..916fd50c --- /dev/null +++ b/lib/docs/scrapers/matplotlib.rb @@ -0,0 +1,24 @@ +module Docs + class Matplotlib < FileScraper + self.name = 'Matplotlib' + self.type = 'sphinx' + self.root_path = 'index.html' + self.release = "1.5.1" + self.links = { + home: 'http://matplotlib.org/', + code: 'https://github.com/matplotlib/matplotlib' + } + + html_filters.push 'matplotlib/entries', 'matplotlib/clean_html' + + options[:container] = '.body' + + options[:attribution] = <<-HTML + © Matplotlib Development Team
+ Licensed under the BSD License. + HTML + + self.dir = '~/workspace/tmp/matplotlib/matplotlib.github.com-master/1.5.1/api/' + # self.base_url = 'http://matplotlib.org/api/' + end +end diff --git a/public/icons/docs/matplotlib/16.png b/public/icons/docs/matplotlib/16.png new file mode 100644 index 0000000000000000000000000000000000000000..8875fbceadee714542bb893d72f3d3122b901a99 GIT binary patch literal 1310 zcmZ`&dsI_(9RDFIilCGwhE`f>_E?Tbq-YV3#g>4`Bc;qhURj}}v%(6Huu@A)$Ap2f z2W-1zyJH&zHplLE?{;CZ*o#MK4||)B>|LkRiM|(B=k!PC-244~f8YE0zCPdYJ(`o9 z5g8s6ju49Eanp0*jAGsep&-|>mgK=Pw<0Ag1tHzZMSm90gZruyZf+Jrht?ug*MQI; zV5+->&_Omrmx~ZeYC$mYJtbrN;Ee0jiG{q&daA9P+(E zyf@%HyB)x^kZW_h2w%`eqS4CKTC={97Uht=0$Q|{@cQ7ZZG@&9(@2XLq}|a&_$MGf zl+@fI@6_rC6xB{yh23GK1*x_XC#0}bdPaAV5P>v_W|Izh{4EL$GZ@MCVoF;Nc>x1R zA}|FQCYLV&B~hB1V3EFYsHd|_WjoCy&8?7;Zq6o6EyUOb3a@244Vh6(5k1PcyK1zT_r+O2YO zphJS|fO)gq!w~DAoGqAXkZHjH7HFK&9Y&|DoKn}cb#=p_dk2SS@Do7VzXSrAOj56p z$;FVIW9<_OWeVVv0R!8>jF1a)U`B)&Dr7Rk>|la0M;mRHXu5-7|2UKlbBE~z=AYVH zU^iex2#-gs#wAJ>Y|c#NF{WQa?G*2{(w3Rt$E+|%7wwdlLPveWqe6)kc2dwL27X{z z5)BR#bXcS_(hi9lhk%V@>8WPX^z?M>hGR7R4pO?i6yEs24G#XXvT)p74f|s6>zdR5U6>|MAxXuZkJ8yp2f`#FWA|e+r zK~Xo{xb&u*mqjnXC1%CSTW`A^ty+D@op-HSd-u9~?!E7R)&uJiJ2oyp;lad*Hf&7V zwE5vjlF_3nscGq)$1=FQ$G2o=Wp70}+j8^r3!d1%qwvY6c0Rr98B|ofyQH+NyyDqC z&prP_<=%a$>c#yB_y=El`IYKJufFy=AZlvs4%ffYaOBOm-adNl_&e{S6DQw$|I}$g zqwq{qv#6!@ENW{POQf=nPPsyfsk+n}gloHXdP9$~x3Ax1K4%#~5mv%xCn<-M9vpHF zkGN6f2dq(#*XIw6jZaK|ICUOf_~_$LKE3$a=U;sJ)z{x#`t~xqa&>+3wePNf|3mVR zKmGj6ufHvwsxH8j!k5-6IpSI`Rw?lxcDSCo5fB5 i$;rF6@jnig`%3qeSO335!s3D>;DC6X>~uV}sQz!YEXbVz literal 0 HcmV?d00001 diff --git a/public/icons/docs/matplotlib/16@2x.png b/public/icons/docs/matplotlib/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..8af81757538a18534bd65ddb6d97e307d6ba319a GIT binary patch literal 1973 zcmZ`)dpHyN8~>7fIJp(V(Hf$LaFA1nVcC*Pl47kAicWUXOqOdqX>Bnkx!00QEc%gK zSm$)%B%08y=9Z!nGf6bf{MMhpKYq{qyzl3EKA-3FKA(Ty=e-u_@1vz*tN{SfLLt3_ zpzRdsmhfz>Ud=61pqYV8#MhC2Dr8Ua#EFu@&I z?^{`{AH|BrVv4>F^O(KPHfkqM@yXSZv3129$=%j4reRs{NI?3WnfK5}ZRen#{5bWVhbSerMps zOB1RSMJ7LzX5P+m`ma88?NWYhd`muZhderDMg*ypQwE;zb~hRlt~xI zr?}LmRCM|A)?F61nE{WHIQ{JYV_GtHZJhM|QGpv|Ddjo#AC!vtMgl~Fv6gy_m`;`Ui$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