From 2f9608662f842bdade887014031b490faa266cdf Mon Sep 17 00:00:00 2001 From: Jamie Ly Date: Sat, 21 Oct 2017 22:51:20 -0400 Subject: [PATCH 01/61] Adds scala documentation --- assets/stylesheets/application-dark.css.scss | 1 + assets/stylesheets/application.css.scss | 1 + assets/stylesheets/pages/_scala.scss | 4 + lib/docs/filters/scala/clean_html.rb | 99 +++++++++++++++++++ lib/docs/filters/scala/clean_html_210.rb | 32 ++++++ lib/docs/filters/scala/clean_html_212.rb | 36 +++++++ lib/docs/filters/scala/entries.rb | 65 ++++++++++++ lib/docs/scrapers/scala.rb | 80 +++++++++++++++ public/icons/docs/scala/16.png | Bin 0 -> 944 bytes public/icons/docs/scala/16@2x.png | Bin 0 -> 1843 bytes 10 files changed, 318 insertions(+) create mode 100644 assets/stylesheets/pages/_scala.scss create mode 100644 lib/docs/filters/scala/clean_html.rb create mode 100644 lib/docs/filters/scala/clean_html_210.rb create mode 100644 lib/docs/filters/scala/clean_html_212.rb create mode 100644 lib/docs/filters/scala/entries.rb create mode 100644 lib/docs/scrapers/scala.rb create mode 100644 public/icons/docs/scala/16.png create mode 100644 public/icons/docs/scala/16@2x.png diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss index d480f720..3c407b58 100644 --- a/assets/stylesheets/application-dark.css.scss +++ b/assets/stylesheets/application-dark.css.scss @@ -85,6 +85,7 @@ 'pages/rfc', 'pages/rubydoc', 'pages/rust', + 'pages/scala', 'pages/sinon', 'pages/socketio', 'pages/sphinx', diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 4fdc2a14..0b5a71ee 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -85,6 +85,7 @@ 'pages/rfc', 'pages/rubydoc', 'pages/rust', + 'pages/scala', 'pages/sinon', 'pages/socketio', 'pages/sphinx', diff --git a/assets/stylesheets/pages/_scala.scss b/assets/stylesheets/pages/_scala.scss new file mode 100644 index 00000000..b2beb118 --- /dev/null +++ b/assets/stylesheets/pages/_scala.scss @@ -0,0 +1,4 @@ +._scala { + @extend %simple; + .deprecated { @extend %label-red; } +} diff --git a/lib/docs/filters/scala/clean_html.rb b/lib/docs/filters/scala/clean_html.rb new file mode 100644 index 00000000..95097c80 --- /dev/null +++ b/lib/docs/filters/scala/clean_html.rb @@ -0,0 +1,99 @@ +module Docs + class Scala + class CleanHtmlFilter < Filter + def call + always + + if slug == 'index' + root + else + other + end + end + + def always + # remove deprecated sections + css('.members').each do |members| + header = members.at_css('h3') + members.remove if header.text.downcase.include? 'deprecate' + end + # Some of this is just for 2.12 + # These are things that provide interactive features, which are not supported yet. + css('#subpackage-spacer, #search, #mbrsel, .diagram-btn').remove + css('#footer').remove + css('.toggleContainer').remove + + signature = at_css('#signature') + signature.replace %Q| +

#{signature.inner_html}

+ | + + css('div.members > h3').each do |node| + change_tag! 'h2', node + end + + css('div.members > ol').each do |list| + list.css('li').each do |li| + h3 = doc.document.create_element 'h3' + li.prepend_child h3 + li.css('.shortcomment').remove + modifier = li.at_css('.modifier_kind') + modifier.parent = h3 if modifier + symbol = li.at_css('.symbol') + symbol.parent = h3 if symbol + li.swap li.children + end + list.swap list.children + end + + pres = css('.fullcomment pre, .fullcommenttop pre') + pres.each do |pre| + pre['data-language'] = 'scala' + end + pres.add_class 'language-scala' + + + + doc + + end + + def root + css('#filter').remove # these are filters to search through the types and packages + css('#library').remove # these are icons at the top + doc + end + + def other + # these are sections of the documentation which do not seem useful + %w(#inheritedMembers #groupedMembers .permalink .hiddenContent .material-icons).each do |selector| + css(selector).remove + end + + # This is the kind of thing we have, class, object, trait + kind = at_css('.modifier_kind .kind').content + # this image replacement doesn't do anything on 2.12 docs + img = at_css('img') + img.replace %Q|#{kind}| unless img.nil? + class_to_add = kind == 'object' ? 'value': 'type' + + # for 2.10, 2.11, the kind class is associated to the body. we have to + # add it somewhere, so we do that with the #definition. + definition = css('#definition') + definition.css('.big_circle').remove + definition.add_class class_to_add + + # this is something that is not shown on the site, such as deprecated members + css('li[visbl=prt]').remove + + doc + end + + private + + def change_tag!(new_tag, node) + node.replace %Q|<#{new_tag}>#{node.inner_html}| + end + end + end +end diff --git a/lib/docs/filters/scala/clean_html_210.rb b/lib/docs/filters/scala/clean_html_210.rb new file mode 100644 index 00000000..3160f103 --- /dev/null +++ b/lib/docs/filters/scala/clean_html_210.rb @@ -0,0 +1,32 @@ +module Docs + class Scala + class CleanHtml210Filter < Filter + def call + definition = at_css('#definition') + begin + type = definition.at_css('.img_kind').text + name = definition.at_css('h1').text.strip + + package = definition.at_css('#owner').text rescue '' + package = package + '.' unless name.empty? || name.start_with?('root') + + other = definition.at_css('.morelinks').dup + other_content = other ? "

#{other.to_html}

" : '' + + definition.replace %Q| +

#{type} #{package}#{name}

+ #{other_content} + | + end if definition + + doc + end + + private + + def change_tag!(new_tag, node) + node.replace %Q|<#{new_tag}>#{node.inner_html}| + end + end + end +end diff --git a/lib/docs/filters/scala/clean_html_212.rb b/lib/docs/filters/scala/clean_html_212.rb new file mode 100644 index 00000000..7b4b1fe2 --- /dev/null +++ b/lib/docs/filters/scala/clean_html_212.rb @@ -0,0 +1,36 @@ +module Docs + class Scala + class CleanHtml212Filter < Filter + def call + css('.permalink').remove + + definition = at_css('#definition') + begin + type_full_name = {c: 'class', t: 'trait', o: 'object', 'p': 'package'} + type = type_full_name[definition.at_css('.big-circle').text.to_sym] + name = definition.at_css('h1').text + + package = definition.at_css('#owner').text rescue '' + package = package + '.' unless name.empty? || package.empty? + + other = definition.at_css('.morelinks').dup + other_content = other ? "

#{other.to_html}

" : '' + + definition.replace %Q| +

#{type} #{package}#{name}

+ #{other_content} + | + + end if definition + + doc + end + + private + + def change_tag!(new_tag, node) + node.replace %Q|<#{new_tag}>#{node.inner_html}| + end + end + end +end diff --git a/lib/docs/filters/scala/entries.rb b/lib/docs/filters/scala/entries.rb new file mode 100644 index 00000000..d328764c --- /dev/null +++ b/lib/docs/filters/scala/entries.rb @@ -0,0 +1,65 @@ +module Docs + class Scala + class EntriesFilter < Docs::EntriesFilter + def get_name + # this first condition is mainly for scala 212 docs, which + # have their package listing as index.html + if is_package? + symbol = at_css('#definition h1') + symbol ? symbol.text.gsub(/\W+/, '') : "package" + else + slug.split('/').last + end + end + + def get_type + # if this entry is for a package, we group the package under the parent package + if is_package? + parent_package + # otherwise, group it under the regular package name + else + package_name + end + end + + def include_default_entry? + true + end + + private + + # For the package name, we use the slug rather than parsing the package + # name from the HTML because companion object classes may be broken out into + # their own entries (by the source documentation). When that happens, + # we want to group these classes (like `scala.reflect.api.Annotations.Annotation`) + # under the package name, and not the fully-qualfied name which would + # include the companion object. + def package_name + name = package_drop_last(slug_parts) + name.empty? ? '_root_' : name + end + + def parent_package + name = package_name + parent = package_drop_last(package_name.split('.')) + parent.empty? ? '_root_' : parent + end + + def package_drop_last(parts) + parts[0...-1].join('.') + end + + def slug_parts + slug.split('/') + end + + def owner + at_css('#owner') + end + + def is_package? + slug.ends_with?('index') || slug.ends_with?('package') + end + end + end +end diff --git a/lib/docs/scrapers/scala.rb b/lib/docs/scrapers/scala.rb new file mode 100644 index 00000000..6b6d6bb2 --- /dev/null +++ b/lib/docs/scrapers/scala.rb @@ -0,0 +1,80 @@ +module Docs + class Scala < FileScraper + include FixInternalUrlsBehavior + + self.name = 'scala' + self.type = 'scala' + self.links = { + home: 'http://www.scala-lang.org/', + code: 'https://github.com/scala/scala' + } + + version '2.12 Library' do + self.release = '2.12.3' + self.dir = '/Users/Thibaut/DevDocs/Docs/Scala212/api/scala-library' # https://downloads.lightbend.com/scala/2.12.3/scala-docs-2.12.3.zip + self.base_url = 'http://www.scala-lang.org/api/2.12.3/' + self.root_path = 'index.html' + options[:attribution] = <<-HTML + Scala programming documentation. Copyright (c) 2003-2017 EPFL, with contributions from Lightbend. + HTML + html_filters.push 'scala/entries', 'scala/clean_html', 'scala/clean_html_212' + end + + version '2.12 Reflection' do + self.release = '2.12.3' + self.dir = '/Users/Thibaut/DevDocs/Docs/Scala212/api/scala-reflect' # https://downloads.lightbend.com/scala/2.12.3/scala-docs-2.12.3.zip + self.base_url = 'http://www.scala-lang.org/api/2.12.3/scala-reflect/' + self.root_path = 'index.html' + options[:attribution] = <<-HTML + Scala programming documentation. Copyright (c) 2003-2017 EPFL, with contributions from Lightbend. + HTML + html_filters.push 'scala/entries', 'scala/clean_html', 'scala/clean_html_212' + end + + version '2.11 Library' do + self.release = '2.11.8' + self.dir = '/Users/Thibaut/DevDocs/Docs/Scala211/api/scala-library' # https://downloads.lightbend.com/scala/2.11.8/scala-docs-2.11.8.zip + self.base_url = 'http://www.scala-lang.org/api/2.11.8/' + self.root_path = 'package.html' + options[:skip_patterns] = [/^index.html/, /index\/index-/] + options[:attribution] = <<-HTML + Scala programming documentation. Copyright (c) 2003-2016 EPFL, with contributions from Lightbend. + HTML + html_filters.push 'scala/entries', 'scala/clean_html', 'scala/clean_html_210' + end + + version '2.11 Reflection' do + self.release = '2.11.8' + self.dir = '/Users/Thibaut/DevDocs/Docs/Scala211/api/scala-reflect' # https://downloads.lightbend.com/scala/2.11.8/scala-docs-2.11.8.zip + self.base_url = 'http://www.scala-lang.org/api/2.11.8/scala-reflect/' + self.root_path = 'package.html' + options[:skip_patterns] = [/^index.html/, /index\/index-/] + options[:attribution] = <<-HTML + Scala programming documentation. Copyright (c) 2003-2016 EPFL, with contributions from Lightbend. + HTML + html_filters.push 'scala/entries', 'scala/clean_html', 'scala/clean_html_210' + end + + version '2.10' do + self.release = '2.10.6' + self.dir = '/Users/Thibaut/DevDocs/Docs/Scala210' # https://downloads.lightbend.com/scala/2.10.6/scala-docs-2.10.6.zip + self.base_url = 'http://www.scala-lang.org/api/2.10.6/' + self.root_path = 'package.html' + options[:skip_patterns] = [/^index.html/, /index\/index-/] + options[:attribution] = <<-HTML + Scala programming documentation. Copyright (c) 2003-2013 EPFL, with contributions from Typesafe. + HTML + html_filters.push 'scala/entries', 'scala/clean_html', 'scala/clean_html_210' + end + end +end diff --git a/public/icons/docs/scala/16.png b/public/icons/docs/scala/16.png new file mode 100644 index 0000000000000000000000000000000000000000..429ed7df29b85da3cc2d26215945b30014465d38 GIT binary patch literal 944 zcmeAS@N?(olHy`uVBq!ia0vp^AhrMp8<5nmf9C+CSkfJR9T^xl_H+M9WCij$3p^r= z85p>QL70(Y)*J~22FA$Dkcg59UmvUF{9L`nl>DSry^7odplSvNn+hu+GdHy)QK2F? zC$HG5!d3~a!V1U+3F|8Y3;nDA{o-C@9zzrKDK}xwt{K z19`Se86_nJR{Hwo<>h+i#(Mch>H3D2mX`VkM*2oZx=P7{9O-#x!EwNQn0$BtH5O0c3d|4@L;p!@;Rg)2@K@7o-U3d z8lt6>&gKa_@*L0YPcPrh?Hi=HD5&v=)l?;gM~_=rw8D=tDi%IECj7z6!-l0pdTIsZ z5(XwEz1Agfmt~sWoXh|C?A(cN$>)3ie>-oi!O+4W_|N#?o434&E`BlHK0S_MhB^N_ z@#oI_rZUBT@|fOu)^A#A9@};)v7BEu71`folYhQCb#Pn59N|MI=4>6h6~5116Q1oo zCb&05I$&w@x=@ZyS9Dr5d|EgcdiKoxXyYbdBK%dwQH57A)HL_vRPK)nHxFbO$s2Ni z3R?QCv>{o1L5|H7J*Sm*S6#e>CMBBhJukm(`T1kr8eDG$t>Fiv70}iFVrF)MlM6d-aa0bR)*%EcCc}Q&W&oUeJEY zu*JpXVI_y*ghLwcO%99xyjl}&yn61RHCZyUQ}#z%1~|S@v9QP!@p$g@+*5erN2j}U zp62OGfBLGRe5UMyrlgn5}kw9uPQydSn&OE*PAexm#Ztn zv(I$&aA@~z-PpSEs?%+Wj~g%BU({&w$oaj-(4&*_!~~x_-ZdS|Vzig;<505)t~URAL>Zu}39_&@d4U6%s^CENMke(O7EN_Jdl|&KuJV z!BZ->R<$FRv|6dXmw&-Z)I{paTT;M|o!S|9)b zl&}~yUVN&H4Jt1y-qpg0ZQ?^Z(%H)y0Gf*xw@EVMSRoD*kO%;Z2lq_^sAL@i0Eqyq zACXS<@fG>IRtx%RpmY6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e>zfo-gS}KE$k6V;NF}By)0$(`r#&g#`QxP&>N^sIp}sBNEo!Txz1Th zC2|VA`uUns(^oq|<+aL^lsw~1Q*P5=s?Sdgw*(LO9=)EsxxV{5XC>_?KdG^`8=alx z<>lZ(?H17rRKGrF@nX$;L|G5dC#&#OwPOu|aJTjM2coL{{D_WGVQ0l*!Qf!?xx69A Xl>A#sPxsj8_P;T#8xGy*63YBH63Qux literal 0 HcmV?d00001 From 330e337b7b071e745fd332763839d2a3bba4ceb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20L=C3=A9gr=C3=A1di?= Date: Sun, 25 Mar 2018 22:01:48 +0200 Subject: [PATCH 02/61] Add WordPress documentation --- assets/stylesheets/application-dark.css.scss | 1 + assets/stylesheets/application.css.scss | 1 + assets/stylesheets/pages/_wordpress.scss | 11 ++++++ lib/docs/filters/wordpress/clean_html.rb | 27 +++++++++++++ lib/docs/filters/wordpress/entries.rb | 23 +++++++++++ lib/docs/scrapers/wordpress.rb | 39 +++++++++++++++++++ public/icons/docs/wordpress/16.png | Bin 0 -> 958 bytes public/icons/docs/wordpress/16@2x.png | Bin 0 -> 3284 bytes public/icons/docs/wordpress/SOURCE | 1 + 9 files changed, 103 insertions(+) create mode 100644 assets/stylesheets/pages/_wordpress.scss create mode 100644 lib/docs/filters/wordpress/clean_html.rb create mode 100644 lib/docs/filters/wordpress/entries.rb create mode 100644 lib/docs/scrapers/wordpress.rb create mode 100644 public/icons/docs/wordpress/16.png create mode 100644 public/icons/docs/wordpress/16@2x.png create mode 100644 public/icons/docs/wordpress/SOURCE diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss index c8dc1f8f..fd92bdd3 100644 --- a/assets/stylesheets/application-dark.css.scss +++ b/assets/stylesheets/application-dark.css.scss @@ -98,5 +98,6 @@ 'pages/underscore', 'pages/vue', 'pages/webpack', + 'pages/wordpress', 'pages/yard', 'pages/yii'; diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 26e0b885..4d59a29c 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -98,5 +98,6 @@ 'pages/underscore', 'pages/vue', 'pages/webpack', + 'pages/wordpress', 'pages/yard', 'pages/yii'; diff --git a/assets/stylesheets/pages/_wordpress.scss b/assets/stylesheets/pages/_wordpress.scss new file mode 100644 index 00000000..78124652 --- /dev/null +++ b/assets/stylesheets/pages/_wordpress.scss @@ -0,0 +1,11 @@ +._wordpress { + @extend %simple; + + .breadcrumbs { + display: none; + } + + .callout-warning { + @extend %note, %note-red; + } +} \ No newline at end of file diff --git a/lib/docs/filters/wordpress/clean_html.rb b/lib/docs/filters/wordpress/clean_html.rb new file mode 100644 index 00000000..dcc4f397 --- /dev/null +++ b/lib/docs/filters/wordpress/clean_html.rb @@ -0,0 +1,27 @@ +module Docs + class Wordpress + class CleanHtmlFilter < Filter + def call + if root_page? + doc.inner_html = '

WordPress

' + return doc + end + + css('hr', '.screen-reader-text', '.table-of-contents', + '.anchor', '.toc-jump', '.source-code-links', '.related', + '.user-notes').remove + + # Add PHP code highlighting + br = //i + css('.source-code-container', '.syntaxhighlighter').each do |node| + node.name = 'pre' + node.inner_html = node.inner_html.gsub(br, "\n") + node.content = node.content.strip + node['data-language'] = 'php' + end + + doc + end + end + end +end \ No newline at end of file diff --git a/lib/docs/filters/wordpress/entries.rb b/lib/docs/filters/wordpress/entries.rb new file mode 100644 index 00000000..012db134 --- /dev/null +++ b/lib/docs/filters/wordpress/entries.rb @@ -0,0 +1,23 @@ +module Docs + class Wordpress + class EntriesFilter < Docs::EntriesFilter + def breadcrumbs + @breadcrumbs ||= css('.breadcrumbs .trail-inner a') + .map(&:content) + .map(&:strip) + end + + def get_name + at_css('.breadcrumbs .trail-end').content + end + + def get_type + if breadcrumbs.size > 1 + breadcrumbs.drop(1).join(': ') + else + at_css('.breadcrumbs .trail-end').content + end + end + end + end +end \ No newline at end of file diff --git a/lib/docs/scrapers/wordpress.rb b/lib/docs/scrapers/wordpress.rb new file mode 100644 index 00000000..472013ac --- /dev/null +++ b/lib/docs/scrapers/wordpress.rb @@ -0,0 +1,39 @@ +module Docs + class Wordpress < UrlScraper + self.name = 'WordPress' + self.type = 'wordpress' + self.release = '4.9.4' + self.base_url = 'https://developer.wordpress.org/reference/' + self.initial_paths = %w( + functions/ + hooks/ + classes/ + ) + + self.links = { + home: 'https://wordpress.org/', + code: 'https://github.com/WordPress/WordPress' + } + + html_filters.push 'wordpress/clean_html', 'wordpress/entries' + + options[:container] = '#content-area' + options[:trailing_slash] = true + options[:only_patterns] = [ + /\Afunctions\//, + /\Ahooks\//, + /\Aclasses\// + ] + + options[:skip_patterns] = [ + /\Afunctions\/page\/\d+/, + /\Ahooks\/page\/\d+/, + /\Aclasses\/page\/\d+/ + ] + + options[:attribution] = <<-HTML + © 2003–2018 WordPress Foundation
+ Licensed under the GNU GPLv2+ License. + HTML + end +end \ No newline at end of file diff --git a/public/icons/docs/wordpress/16.png b/public/icons/docs/wordpress/16.png new file mode 100644 index 0000000000000000000000000000000000000000..13f3fa64dd7aee3835861516bd4a5e51de297ac7 GIT binary patch literal 958 zcmV;v13~$dbKQO*@ZEgH%pcb<}T*4%`BNe6J0dK zFh~cw0i`ieDg8CpgV1)grBK>)_I^h$%ue#0obUaf=Q;2DeecWJ&-CGcPcz{o!d}9b zwb%qL}N`Q_PZT$+iPaJ`)(=mR5nQb zw+VT{xa%!u@Rg(5@XD2s4_nV)9X1a>3}YdagRB4?$0LfYI^|7O6aZfZ+Quu9^QpoGy`NsSrGUV=cTzuuo!*W=N7Fb&f(1G~Gf+CCDRM|2^B z7PAq$GA%ek1J6txilSiOCJP+~k60?J8Vm>K(6phlfj(>1BB>@$)U3n6^b=?V9($V1 zfFi?IrBwxO^(K@H3f5O>5t&aTG?#?Hb8Jgs2GK`SB4{<~;fW;a^AYD;R&AqV)85)n>v(AcEhA z{sH^f8(SQ3+AJ6to5G$}E0~7DcbP%&ZC}XUUSIjh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O%xp5S4p)} zQa$Kp-(l$#6svz(w{2?^iK>@9&a!*uDjnP(5tcSAJds3jtj#{+VA1A5WAB=tAJ;dB z`HVkKx~b3-ESHy$Q`@N|->O<&rY6r&v-nVj5%R=;uLWyc4cClWSWAmlzYl0}odK=Pln%cDXn=6&id$EDa4_A|Q|qO|WCT?)2}!PqQ{<8C&3F*X{L zl~rX-&}IFDBfDcB-Z-$I9w(sImLXKlO_u3+zp}`8&>jkfev478D%j95_9JhA_RYx;E_i7Da4~ysb&sr5RPpDm#Lm0_;PAgxxc%H$0BrWs#%139` ze*T6lhQAv?p^O-qLISV^EUxQ(2(G!m=105I+nH)(_{RjGL=%5%d~2jMuc-_I-E|^e zV1XN>^a#?!nVYfGC+Z$&1z0LFw6!@OMi+Nx<9vE?w<`t*lZ^JME(V5y2kI<>tJWrY zI#msdmp|Xq6+vUv@H-c~9$1b9+w#{{&8&*z?6j4>SuZ4?iiCOXc2sBxt6U zy5ErCmg%iK3lp+_nYhxA=FGkCFPM_I4;Vepr7REMhQE;Y+n;hX>m7)Z7bV8Vs5dVy zDO65%To&4AJCU3y{2KY`dAt18=zzNLn!hxNKqpGYiAw96e;PLe*$qZq9wEGHnS2d{ zR1|ad3NZ7_*igB`aT@ym1mul1||jVtZ=vlAVpnKI1ODwDPOr4ZW+z+m%~N z=NzrdjT+bVPPAp+T|X1~e!SGm1^eRSF~#gI$*6qS>+-w2K)*#en%Mp8u)h`VFGG!y zLgLDtV8qH(TdJeRlU(iKXTSf|8{-t9>`KKrT_>|ycg@8u1j&ssHtgShQP9r6!7gzWPl+WDp zURpm5&DZe-P*dBecbX;|Nd6N=nhAHur^(UWW|H)lgo-2SOw*^{Uqeb>*4^&M_2sMN tt53>4{%xmS%S_yChvl^|A7`O_LZHMPRuh>`*WdilFvD1(OH5s({|%@}uC4$8 literal 0 HcmV?d00001 diff --git a/public/icons/docs/wordpress/SOURCE b/public/icons/docs/wordpress/SOURCE new file mode 100644 index 00000000..1c817d62 --- /dev/null +++ b/public/icons/docs/wordpress/SOURCE @@ -0,0 +1 @@ +https://wordpress.org/about/logos/ \ No newline at end of file From c7da05580e82c6a7f7f0a7b958b2a49e4fc9d251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20L=C3=A9gr=C3=A1di?= Date: Sun, 25 Mar 2018 22:30:37 +0200 Subject: [PATCH 03/61] Reduce number of types --- lib/docs/filters/wordpress/entries.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/docs/filters/wordpress/entries.rb b/lib/docs/filters/wordpress/entries.rb index 012db134..bfcd10b3 100644 --- a/lib/docs/filters/wordpress/entries.rb +++ b/lib/docs/filters/wordpress/entries.rb @@ -12,7 +12,13 @@ module Docs end def get_type - if breadcrumbs.size > 1 + if subpath.starts_with?('classes') + 'Classes' + elsif subpath.starts_with?('hooks') + 'Hooks' + elsif subpath.starts_with?('functions') + 'Functions' + elsif breadcrumbs.size > 1 breadcrumbs.drop(1).join(': ') else at_css('.breadcrumbs .trail-end').content From a8ff630f9a6fac408baa48d7a66d789234d85ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20L=C3=A9gr=C3=A1di?= Date: Mon, 26 Mar 2018 10:14:45 +0200 Subject: [PATCH 04/61] Keep "Related" section --- lib/docs/filters/wordpress/clean_html.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/docs/filters/wordpress/clean_html.rb b/lib/docs/filters/wordpress/clean_html.rb index dcc4f397..388b3cba 100644 --- a/lib/docs/filters/wordpress/clean_html.rb +++ b/lib/docs/filters/wordpress/clean_html.rb @@ -8,8 +8,7 @@ module Docs end css('hr', '.screen-reader-text', '.table-of-contents', - '.anchor', '.toc-jump', '.source-code-links', '.related', - '.user-notes').remove + '.anchor', '.toc-jump', '.source-code-links', '.user-notes').remove # Add PHP code highlighting br = //i From 8d656ab63fec93c8b04998c914af071ef383c7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20L=C3=A9gr=C3=A1di?= Date: Mon, 26 Mar 2018 10:19:08 +0200 Subject: [PATCH 05/61] Add styling for alert callouts --- assets/stylesheets/pages/_wordpress.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/stylesheets/pages/_wordpress.scss b/assets/stylesheets/pages/_wordpress.scss index 78124652..1da15abd 100644 --- a/assets/stylesheets/pages/_wordpress.scss +++ b/assets/stylesheets/pages/_wordpress.scss @@ -8,4 +8,8 @@ .callout-warning { @extend %note, %note-red; } + + .callout-alert { + @extend %note, %note-orange; + } } \ No newline at end of file From fde45213f402dfe87d4edce8d22a6d8eeed21b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20L=C3=A9gr=C3=A1di?= Date: Mon, 26 Mar 2018 10:59:20 +0200 Subject: [PATCH 06/61] Remove "Show / Hide more" links --- lib/docs/filters/wordpress/clean_html.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/docs/filters/wordpress/clean_html.rb b/lib/docs/filters/wordpress/clean_html.rb index 388b3cba..91708045 100644 --- a/lib/docs/filters/wordpress/clean_html.rb +++ b/lib/docs/filters/wordpress/clean_html.rb @@ -8,7 +8,8 @@ module Docs end css('hr', '.screen-reader-text', '.table-of-contents', - '.anchor', '.toc-jump', '.source-code-links', '.user-notes').remove + '.anchor', '.toc-jump', '.source-code-links', '.user-notes', + '.show-more', '.hide-more').remove # Add PHP code highlighting br = //i From 577b4a62d72c31915c27fbc42c67ae077bff64c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20L=C3=A9gr=C3=A1di?= Date: Mon, 26 Mar 2018 10:59:56 +0200 Subject: [PATCH 07/61] Fix syntax highlighting in `pre` tags --- lib/docs/filters/wordpress/clean_html.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/docs/filters/wordpress/clean_html.rb b/lib/docs/filters/wordpress/clean_html.rb index 91708045..42ca5f29 100644 --- a/lib/docs/filters/wordpress/clean_html.rb +++ b/lib/docs/filters/wordpress/clean_html.rb @@ -11,9 +11,14 @@ module Docs '.anchor', '.toc-jump', '.source-code-links', '.user-notes', '.show-more', '.hide-more').remove - # Add PHP code highlighting br = //i - css('.source-code-container', '.syntaxhighlighter').each do |node| + + # Add PHP code highlighting + css('pre').each do |node| + node['data-language'] = 'php' + end + + css('.source-code-container').each do |node| node.name = 'pre' node.inner_html = node.inner_html.gsub(br, "\n") node.content = node.content.strip From 9d60cc80f5cf0cc67b5153fe2a28dd217c47c43e Mon Sep 17 00:00:00 2001 From: Boris Bera Date: Tue, 25 Sep 2018 22:29:26 -0400 Subject: [PATCH 08/61] Add basic scraper and friends that doesn't blow up --- lib/docs/filters/salt_stack/clean_html.rb | 9 +++++++++ lib/docs/filters/salt_stack/entries.rb | 13 +++++++++++++ lib/docs/scrapers/salt_stack.rb | 14 ++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 lib/docs/filters/salt_stack/clean_html.rb create mode 100644 lib/docs/filters/salt_stack/entries.rb create mode 100644 lib/docs/scrapers/salt_stack.rb diff --git a/lib/docs/filters/salt_stack/clean_html.rb b/lib/docs/filters/salt_stack/clean_html.rb new file mode 100644 index 00000000..ac53a94c --- /dev/null +++ b/lib/docs/filters/salt_stack/clean_html.rb @@ -0,0 +1,9 @@ +module Docs + class SaltStack + class CleanHtmlFilter < Filter + def call + doc + end + end + end +end diff --git a/lib/docs/filters/salt_stack/entries.rb b/lib/docs/filters/salt_stack/entries.rb new file mode 100644 index 00000000..dda9871d --- /dev/null +++ b/lib/docs/filters/salt_stack/entries.rb @@ -0,0 +1,13 @@ +module Docs + class SaltStack + class EntriesFilter < Docs::EntriesFilter + def get_name + at_css('h1').content + end + + def get_type + 'TODO' + end + end + end +end diff --git a/lib/docs/scrapers/salt_stack.rb b/lib/docs/scrapers/salt_stack.rb new file mode 100644 index 00000000..3196a18a --- /dev/null +++ b/lib/docs/scrapers/salt_stack.rb @@ -0,0 +1,14 @@ +module Docs + class SaltStack < UrlScraper + self.release = '2018.3.2' + self.base_url = 'https://docs.saltstack.com/en/latest/ref/' + + html_filters.push 'salt_stack/entries', 'salt_stack/clean_html' + + options[:container] = '.body-content' + + options[:attribution] = <<-HTML + © 2018 SaltStack. All Rights Reserved, SaltStack Inc. + HTML + end +end From b7075dd51ac8c3c21046fbf293b744e75a19aa60 Mon Sep 17 00:00:00 2001 From: Boris Bera Date: Tue, 25 Sep 2018 23:46:15 -0400 Subject: [PATCH 09/61] Implement working crawling and section building for salt --- lib/docs/filters/salt_stack/clean_html.rb | 2 ++ lib/docs/filters/salt_stack/entries.rb | 19 +++++++++++++++++-- lib/docs/scrapers/salt_stack.rb | 7 ++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/docs/filters/salt_stack/clean_html.rb b/lib/docs/filters/salt_stack/clean_html.rb index ac53a94c..0f084519 100644 --- a/lib/docs/filters/salt_stack/clean_html.rb +++ b/lib/docs/filters/salt_stack/clean_html.rb @@ -2,6 +2,8 @@ module Docs class SaltStack class CleanHtmlFilter < Filter def call + css('.headerlink').remove + doc end end diff --git a/lib/docs/filters/salt_stack/entries.rb b/lib/docs/filters/salt_stack/entries.rb index dda9871d..51bf17d2 100644 --- a/lib/docs/filters/salt_stack/entries.rb +++ b/lib/docs/filters/salt_stack/entries.rb @@ -1,12 +1,27 @@ module Docs class SaltStack class EntriesFilter < Docs::EntriesFilter + SALT_REF_RGX = /salt\.([^\.]+)\.([^\s]+)/ + def get_name - at_css('h1').content + header = at_css('h1').content + + ref_match = SALT_REF_RGX.match(header) + if ref_match + ns, mod = ref_match.captures + "#{ns}.#{mod}" + else + header + end end def get_type - 'TODO' + type, _ = slug.split('/', 2) + type + end + + def include_default_entry? + !subpath.end_with?('index.html') end end end diff --git a/lib/docs/scrapers/salt_stack.rb b/lib/docs/scrapers/salt_stack.rb index 3196a18a..a4c974b2 100644 --- a/lib/docs/scrapers/salt_stack.rb +++ b/lib/docs/scrapers/salt_stack.rb @@ -1,9 +1,14 @@ module Docs class SaltStack < UrlScraper + self.type = 'salt_stack' self.release = '2018.3.2' self.base_url = 'https://docs.saltstack.com/en/latest/ref/' - html_filters.push 'salt_stack/entries', 'salt_stack/clean_html' + html_filters.push 'salt_stack/clean_html', 'salt_stack/entries' + + options[:only_patterns] = [ + %r{[^/]+/all/} + ] options[:container] = '.body-content' From e69e15e04a0491e6ce3619d5a1af57a38e516581 Mon Sep 17 00:00:00 2001 From: Boris Bera Date: Wed, 26 Sep 2018 00:02:35 -0400 Subject: [PATCH 10/61] Add salt links --- lib/docs/scrapers/salt_stack.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/docs/scrapers/salt_stack.rb b/lib/docs/scrapers/salt_stack.rb index a4c974b2..90df1767 100644 --- a/lib/docs/scrapers/salt_stack.rb +++ b/lib/docs/scrapers/salt_stack.rb @@ -3,6 +3,10 @@ module Docs self.type = 'salt_stack' self.release = '2018.3.2' self.base_url = 'https://docs.saltstack.com/en/latest/ref/' + self.links = { + home: 'https://www.saltstack.com/', + code: 'https://github.com/saltstack/salt' + } html_filters.push 'salt_stack/clean_html', 'salt_stack/entries' From 55023390c1b771730080f1cab0e8ed592d87f7cf Mon Sep 17 00:00:00 2001 From: Boris Bera Date: Wed, 26 Sep 2018 00:20:43 -0400 Subject: [PATCH 11/61] Include indexes in docs --- lib/docs/filters/salt_stack/entries.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/docs/filters/salt_stack/entries.rb b/lib/docs/filters/salt_stack/entries.rb index 51bf17d2..ff49a8f7 100644 --- a/lib/docs/filters/salt_stack/entries.rb +++ b/lib/docs/filters/salt_stack/entries.rb @@ -19,10 +19,6 @@ module Docs type, _ = slug.split('/', 2) type end - - def include_default_entry? - !subpath.end_with?('index.html') - end end end end From 63b3ef9a419a6a3cc2fe8004ae127df9e5062e75 Mon Sep 17 00:00:00 2001 From: Boris Bera Date: Wed, 26 Sep 2018 20:12:50 -0400 Subject: [PATCH 12/61] Remove the index pages for refs --- lib/docs/filters/salt_stack/entries.rb | 7 +++++-- lib/docs/scrapers/salt_stack.rb | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/docs/filters/salt_stack/entries.rb b/lib/docs/filters/salt_stack/entries.rb index ff49a8f7..23b8f46f 100644 --- a/lib/docs/filters/salt_stack/entries.rb +++ b/lib/docs/filters/salt_stack/entries.rb @@ -16,8 +16,11 @@ module Docs end def get_type - type, _ = slug.split('/', 2) - type + slug.split('/', 2).first + end + + def include_default_entry? + slug.split('/').last.start_with? 'salt' end end end diff --git a/lib/docs/scrapers/salt_stack.rb b/lib/docs/scrapers/salt_stack.rb index 90df1767..ee83a476 100644 --- a/lib/docs/scrapers/salt_stack.rb +++ b/lib/docs/scrapers/salt_stack.rb @@ -11,7 +11,7 @@ module Docs html_filters.push 'salt_stack/clean_html', 'salt_stack/entries' options[:only_patterns] = [ - %r{[^/]+/all/} + %r{^[^/]+/all/} ] options[:container] = '.body-content' From 925f458985bb2a659d59d09d22a00672b9acd73f Mon Sep 17 00:00:00 2001 From: Boris Bera Date: Wed, 26 Sep 2018 20:14:56 -0400 Subject: [PATCH 13/61] Add apache2 license to attribution --- lib/docs/scrapers/salt_stack.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/docs/scrapers/salt_stack.rb b/lib/docs/scrapers/salt_stack.rb index ee83a476..ae4e47f3 100644 --- a/lib/docs/scrapers/salt_stack.rb +++ b/lib/docs/scrapers/salt_stack.rb @@ -17,7 +17,8 @@ module Docs options[:container] = '.body-content' options[:attribution] = <<-HTML - © 2018 SaltStack. All Rights Reserved, SaltStack Inc. + © 2018 SaltStack.
+ Licensed under the Apache License, Version 2.0. HTML end end From c5f382b0adff61454e9afbc576c8d5a11760f34b Mon Sep 17 00:00:00 2001 From: Boris Bera Date: Wed, 26 Sep 2018 20:27:51 -0400 Subject: [PATCH 14/61] Add salt logo --- public/icons/docs/salt_stack/16.png | Bin 0 -> 726 bytes public/icons/docs/salt_stack/16@2x.png | Bin 0 -> 1432 bytes public/icons/docs/salt_stack/SOURCE | 1 + 3 files changed, 1 insertion(+) create mode 100644 public/icons/docs/salt_stack/16.png create mode 100644 public/icons/docs/salt_stack/16@2x.png create mode 100644 public/icons/docs/salt_stack/SOURCE diff --git a/public/icons/docs/salt_stack/16.png b/public/icons/docs/salt_stack/16.png new file mode 100644 index 0000000000000000000000000000000000000000..ee2631f845b18128b013d30d8070ccdfcbb3b142 GIT binary patch literal 726 zcmV;{0xA88P)@~8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H10#ivuK~y-6jgvoU6hRop-#2@=w|ma)%$%_>hBU?qHj+Y6EL0Fd zEky(c8$}36ENo2tgJmF!DE?{e1WOwYXm4Yoq!I)rCWaunc(>VIlkDB?eikO@c^dRJ z!#w8wzBdfx;4kXygD->{@m+UlHEm1*$dyt%%YJFpE4fEKzp${n+WZOt)RiS0$WtI1 zVsaj4S>_2rmjpNgc)GrnJO+>%qs}tZK(X0+&`wr@V6O?}or+TXI*CTBDXry+?v}>L zLq@C5jT&%-FWLd?glmRGH{8UW_!=a)0) zr#Zy7teIZxY^ap#0rG)DhnI#?bWcjTr9jzbt<@Ycc|ab3oH0i0z923$$TdMQ0^|Wu zxY!8*03=CL1#rU#!5IQ(Yf*KWucZA2q+)5s*!RyZ`_I07*qo IM6N<$f_+6d-2eap literal 0 HcmV?d00001 diff --git a/public/icons/docs/salt_stack/16@2x.png b/public/icons/docs/salt_stack/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..3fe90907409a82e389bf23d66322249968a32229 GIT binary patch literal 1432 zcmV;J1!ww+P)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H11rEBYZJL=%lyi$;{IRj&_K+S0T3qt&?Qtm&h! z)Vb%Lo?A6O_Znx6G1pmZ?zw@3K+1f6=G;l$INtjcRCu)rf1EL&HyJOPim`~yQsGsW zV0o)XYef9B%sjY1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9GPXUr$ z6yxiSqIw=ZoU20~z;SWa)~)!XSNKF1v@wCd>Sk&xN#trop2;-7QQ z4IOIZ@lhT|PZHt&2>}{K_1v^+(@!A6j(UwYsrnJ@Yaagz9Y*&j4(eiu>m8w_wMfegGt@e!-1Tr z>XxYYceFnj8MsV^zfke-PBtY?1tj9GQ{f-mr=<1(%zR=heq}1Wxzl9S4c)Hc0jDJI zeU=J8o+NlL!ZtMWa( Date: Mon, 1 Oct 2018 18:34:36 +0200 Subject: [PATCH 15/61] Add Composer --- .../templates/pages/about_tmpl.coffee | 5 +++ assets/stylesheets/pages/_simple.scss | 1 + lib/docs/filters/composer/clean_html.rb | 25 +++++++++++ lib/docs/filters/composer/entries.rb | 39 ++++++++++++++++++ lib/docs/scrapers/composer.rb | 27 ++++++++++++ public/icons/docs/composer/16.png | Bin 0 -> 1464 bytes public/icons/docs/composer/16@2x.png | Bin 0 -> 3607 bytes public/icons/docs/composer/SOURCE | 1 + 8 files changed, 98 insertions(+) create mode 100644 lib/docs/filters/composer/clean_html.rb create mode 100644 lib/docs/filters/composer/entries.rb create mode 100644 lib/docs/scrapers/composer.rb create mode 100644 public/icons/docs/composer/16.png create mode 100644 public/icons/docs/composer/16@2x.png create mode 100644 public/icons/docs/composer/SOURCE diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 26ca8e7e..7e5f7505 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -190,6 +190,11 @@ credits = [ '2009-2018 Jeremy Ashkenas', 'MIT', 'https://raw.githubusercontent.com/jashkenas/coffeescript/master/LICENSE' + ], [ + 'Composer', + '2012-2018 Nils Adermann, Jordi Boggiano', + 'MIT', + 'https://github.com/composer/composer/blob/master/LICENSE' ], [ 'Cordova', '2012-2017 The Apache Software Foundation', diff --git a/assets/stylesheets/pages/_simple.scss b/assets/stylesheets/pages/_simple.scss index fe36579d..8293bed0 100644 --- a/assets/stylesheets/pages/_simple.scss +++ b/assets/stylesheets/pages/_simple.scss @@ -21,6 +21,7 @@ ._bower, ._chai, ._codeceptjs, +._composer, ._docker, ._electron, ._fish, diff --git a/lib/docs/filters/composer/clean_html.rb b/lib/docs/filters/composer/clean_html.rb new file mode 100644 index 00000000..b4abce49 --- /dev/null +++ b/lib/docs/filters/composer/clean_html.rb @@ -0,0 +1,25 @@ +module Docs + class Composer + class CleanHtmlFilter < Filter + def call + # Remove unneeded elements + css('#searchbar, .toc, .fork-and-edit, .anchor').remove + + # Code blocks + css('pre').each do |node| + code = node.at_css('code[class]') + + unless code.nil? + node['data-language'] = 'javascript' if code['class'].include?('javascript') + node['data-language'] = 'php' if code['class'].include?('php') + end + + node.content = node.content.strip + node.remove_attribute('class') + end + + doc + end + end + end +end diff --git a/lib/docs/filters/composer/entries.rb b/lib/docs/filters/composer/entries.rb new file mode 100644 index 00000000..7547dd38 --- /dev/null +++ b/lib/docs/filters/composer/entries.rb @@ -0,0 +1,39 @@ +module Docs + class Composer + class EntriesFilter < Docs::EntriesFilter + def get_name + title = at_css('h1').content + + title = "#{Integer(subpath[1]) + 1}. #{title}" if type == 'Book' + + title + end + + def get_type + return 'Articles' if subpath.start_with?('articles/') + + 'Book' + end + + def additional_entries + entries = [] + + if subpath == '04-schema.md' # JSON Schema + css('h3').each do |node| + name = node.content.strip + name.remove!(' (root-only)') + entries << [name, node['id'], 'JSON Schema'] + end + end + + if subpath == '06-config.md' # Composer config + css('h2').each do |node| + entries << [node.content.strip, node['id'], 'Configuration Options'] + end + end + + entries + end + end + end +end diff --git a/lib/docs/scrapers/composer.rb b/lib/docs/scrapers/composer.rb new file mode 100644 index 00000000..e62aab43 --- /dev/null +++ b/lib/docs/scrapers/composer.rb @@ -0,0 +1,27 @@ +module Docs + class Composer < UrlScraper + self.name = 'Composer' + self.type = 'composer' + + self.links = { + home: 'https://getcomposer.org', + code: 'https://github.com/composer/composer' + } + + html_filters.push 'composer/clean_html', 'composer/entries' + + self.release = '1.7.2' + self.base_url = 'https://getcomposer.org/doc/' + + options[:container] = '#main' + + options[:skip_patterns] = [ + /^faqs/ + ] + + options[:attribution] = <<-HTML + © Nils Adermann, Jordi Boggiano
+ Licensed under the MIT License. + HTML + end +end diff --git a/public/icons/docs/composer/16.png b/public/icons/docs/composer/16.png new file mode 100644 index 0000000000000000000000000000000000000000..bfbdb4d9185dd22aeda1e5b70846b203b1b40cf8 GIT binary patch literal 1464 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBD8X6a5n0T@pr;JNj1^1m z%NQ6KBQrxHN+NuHtdjF{^%7I^lT!66atnZ}85nFTtboki)RIJnirk#MVyg;UC9n!B zAR8pCucQE0Qj%?}6yY17;GAESs$i;TqGzCF$EBd4U{jQmW)z9|8>y;bpKhp88yV>WRp=I1=9MH?=;jqGLkxkLMfuL^+7WFhI$72aI=A0Z9t+{{zaLoK$}74 z+Zoz`RicPN?Xl4ZS&rlwh)=?hGZhTM5jDj~Gf- zc=jj%NRAA6uAx+DaLmfeZHl3q&z84tcQ?HgK6dSUWo>@_%oo1zY|Wp~x&OZW-Eqbr z^Do}Hv*h>m+gJXb{dh3mYTu3ePd^TB-eH|1Lp8Z3udK{0C- zL*(L%3v|D&(VF7?an~*@8T*5nD06*Mmg$DbzMvD%3n#3I;0UcMKcn(XV3xGo+jx1~ZEya(Z<4M0J=NB@ zKGtozmEYf(&6U^Bc|4I7m*jiDbj`J`+7Z)QD{SQM{!6+n&2{bkkD0Tad>?G**(EA1 zAu%cT#0!pqlbNRP*H@NZK7Ow2R)WFO1pJlhKvcJY1UcF27lE}95`}_7N1;48_f6FJfBgU!z zjaP}zuYZ@>gq;;U1w5G4Eq^W%a$9sRJK0_5*GV^HPLor`x<{tniTjzv_$vJ1@^>{A zTX(Y?J!SlQXxG)(cN$nag;iue>dc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@qxnjq5|0AWKe#2Hu-e z5lH6)r>Cuz6L6-!TqHHg02j!S)vLU6a~Nt3uQh`9{XmwM#m6fuFS?>hSr~1HN{m=* z428xOnC`7CM=L4gU>IAbfTtHVE31+J3aEDyA^BEpdwB8Avk~twVQ!$VKdkP^rEEGB z%mRngIlC%jyfq)?aecdyf65kjZouINVQ(;SIB!HNt$20qD;X#$4G-pXN* zD~{ObWQQzRUVH7MHQIZ_0(yZvrmc@NA9LgMM|6M21a; zXqBY?L2IQvFB8Wpf{drsy2?Y1NoTWYoMojw>njb`^~7KzZt;|jZDMrX|}%jYB;|GXZ2O-7~*p$b^&)GxZvm2nS+^%ahP8030oOlR?IYm@>O1$D<=0^hUL zI8>|BQ7h>p?V0-R>bX`1+kseT`0&UKy>`(RAt6DCseH$k33|rdtLbAX)}CY(H@*BK zIo^5e?<=0?04q;=@+Re6q}}fK6{8|d{s&yZr+GA=^ABT3vqB>VE^?3IOo*l zKa>|>Y}LY>ALz~MV)Pcpj*!P|@_^M@T;1vM?1!K|)t?Mct4pTLt_-B9SzRjX=&hB5 zb-#Z7D!gy!QJwod6J_mtFBB)Px2`#yDnQ!d!)_e&6%JRfHMBquLj6i%G6cs z!7T6to#pB0xI*?s&c}2ONxYGZJaPgwNZYbjKuy?4uO{d literal 0 HcmV?d00001 diff --git a/public/icons/docs/composer/SOURCE b/public/icons/docs/composer/SOURCE new file mode 100644 index 00000000..ea9acaa7 --- /dev/null +++ b/public/icons/docs/composer/SOURCE @@ -0,0 +1 @@ +https://github.com/composer/getcomposer.org/blob/master/web/img/logo-composer-transparent.png From 8e06630bf010db49ac3eda194918f323183179d9 Mon Sep 17 00:00:00 2001 From: Nicolas Ettlin Date: Mon, 1 Oct 2018 21:31:13 +0200 Subject: [PATCH 16/61] Improve Composer title page --- lib/docs/filters/composer/clean_html.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/docs/filters/composer/clean_html.rb b/lib/docs/filters/composer/clean_html.rb index b4abce49..54ce7a26 100644 --- a/lib/docs/filters/composer/clean_html.rb +++ b/lib/docs/filters/composer/clean_html.rb @@ -5,6 +5,16 @@ module Docs # Remove unneeded elements css('#searchbar, .toc, .fork-and-edit, .anchor').remove + # Fix the home page titles + if subpath == '' + css('h1').each do |node| + node.name = 'h2' + end + + # Add a main title before the first subtitle + at_css('h2').before('

Composer

') + end + # Code blocks css('pre').each do |node| code = node.at_css('code[class]') From 92388055064a68fd4dabb854007b6a3d094f11d9 Mon Sep 17 00:00:00 2001 From: Nicolas Ettlin Date: Tue, 2 Oct 2018 18:01:07 +0200 Subject: [PATCH 17/61] Switch Composer to 'simple' style --- assets/stylesheets/pages/_simple.scss | 1 - lib/docs/scrapers/composer.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/stylesheets/pages/_simple.scss b/assets/stylesheets/pages/_simple.scss index 8293bed0..fe36579d 100644 --- a/assets/stylesheets/pages/_simple.scss +++ b/assets/stylesheets/pages/_simple.scss @@ -21,7 +21,6 @@ ._bower, ._chai, ._codeceptjs, -._composer, ._docker, ._electron, ._fish, diff --git a/lib/docs/scrapers/composer.rb b/lib/docs/scrapers/composer.rb index e62aab43..beade9cb 100644 --- a/lib/docs/scrapers/composer.rb +++ b/lib/docs/scrapers/composer.rb @@ -1,7 +1,7 @@ module Docs class Composer < UrlScraper self.name = 'Composer' - self.type = 'composer' + self.type = 'simple' self.links = { home: 'https://getcomposer.org', From 2d6c1be335d64dd32bcbfdacd295019f5fd2b621 Mon Sep 17 00:00:00 2001 From: Nicolas Ettlin Date: Wed, 3 Oct 2018 21:50:22 +0200 Subject: [PATCH 18/61] Add Vue Router reference --- .../templates/pages/about_tmpl.coffee | 5 ++ lib/docs/filters/vue_router/clean_html.rb | 14 ++++ lib/docs/filters/vue_router/entries.rb | 73 ++++++++++++++++++ lib/docs/scrapers/vue_router.rb | 27 +++++++ public/icons/docs/vue_router/16.png | Bin 0 -> 1211 bytes public/icons/docs/vue_router/16@2x.png | Bin 0 -> 2020 bytes public/icons/docs/vue_router/SOURCE | 2 + 7 files changed, 121 insertions(+) create mode 100644 lib/docs/filters/vue_router/clean_html.rb create mode 100644 lib/docs/filters/vue_router/entries.rb create mode 100644 lib/docs/scrapers/vue_router.rb create mode 100644 public/icons/docs/vue_router/16.png create mode 100644 public/icons/docs/vue_router/16@2x.png create mode 100644 public/icons/docs/vue_router/SOURCE diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index fef9a024..56dfadd1 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -680,6 +680,11 @@ credits = [ '2013-2018 Evan You, Vue.js contributors', 'MIT', 'https://raw.githubusercontent.com/vuejs/vue/master/LICENSE' + ], [ + 'Vue Router', + '2013-2018 Evan You, Vue.js contributors', + 'MIT', + 'https://github.com/vuejs/vue-router/blob/dev/LICENSE' ], [ 'Vulkan', '2014-2017 Khronos Group Inc.
Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc.', diff --git a/lib/docs/filters/vue_router/clean_html.rb b/lib/docs/filters/vue_router/clean_html.rb new file mode 100644 index 00000000..6377b0d4 --- /dev/null +++ b/lib/docs/filters/vue_router/clean_html.rb @@ -0,0 +1,14 @@ +module Docs + class VueRouter + class CleanHtmlFilter < Filter + def call + @doc = at_css('.content') + + # Remove unneeded elements + css('.bit-sponsor, .header-anchor').remove + + doc + end + end + end +end \ No newline at end of file diff --git a/lib/docs/filters/vue_router/entries.rb b/lib/docs/filters/vue_router/entries.rb new file mode 100644 index 00000000..c00c99f2 --- /dev/null +++ b/lib/docs/filters/vue_router/entries.rb @@ -0,0 +1,73 @@ +module Docs + class VueRouter + class EntriesFilter < Docs::EntriesFilter + def get_name + name = at_css('h1').content + + name.remove! '# ' + + name + end + + def get_type + return 'Other Guides' if subpath.start_with?('guide/advanced') + return 'Basic Guides' if subpath.start_with?('guide') || subpath.start_with?('installation') + + 'API Reference' + end + + def include_default_entry? + name != 'API Reference' + end + + def additional_entries + return [] unless subpath.start_with?('api') + + entries = [ + ['', 'router-link', 'API Reference'], + ['', 'router-view', 'API Reference'], + ['$route', 'the-route-object', 'API Reference'], + ['Component Injections', 'component-injections', 'API Reference'] + ] + + css('h3').each do |node| + entryName = node.content.strip + + # Get the previous h2 title + title = node + title = title.previous_element until title.name == 'h2' + title = title.content.strip + title.remove! '# ' + + entryName.remove! '# ' + + unless entryName.start_with?('router.') + if title == "Router Construction Options" + entryName = "RouterOptions.#{entryName}" + elsif title == " Props" + entryName = " `#{entryName}` prop" + elsif title == " Props" + entryName = " `#{entryName}` prop" + else + entryName = "> #{entryName} (in: #{title})" + end + end + + unless title == "Component Injections" || node['id'] == 'applying-active-class-to-outer-element' || node['id'] == 'route-object-properties' + entries << [entryName, node['id'], 'API Reference'] + end + end + + css('#route-object-properties + ul > li > p:first-child > strong').each do |node| + entryName = node.content.strip + id = "route-object-#{entryName.remove('$route.')}" + + node['id'] = id + entries << [entryName, node['id'], 'API Reference'] + end + + entries + end + end + end +end \ No newline at end of file diff --git a/lib/docs/scrapers/vue_router.rb b/lib/docs/scrapers/vue_router.rb new file mode 100644 index 00000000..e19efa11 --- /dev/null +++ b/lib/docs/scrapers/vue_router.rb @@ -0,0 +1,27 @@ +module Docs + class VueRouter < UrlScraper + self.slug = 'vue_router' + self.name = 'Vue Router' + self.type = 'simple' + + self.links = { + home: 'https://router.vuejs.org', + code: 'https://github.com/vuejs/vue-router' + } + + html_filters.push 'vue_router/entries', 'vue_router/clean_html' + + self.release = '3.0.1' + self.base_url = 'https://router.vuejs.org/' + + options[:skip_patterns] = [ + # Other languages + /^(zh|ja|ru|kr)\//, + ] + + options[:attribution] = <<-HTML + © 2013–2018 Evan You, Vue.js contributors
+ Licensed under the MIT License. + HTML + end +end diff --git a/public/icons/docs/vue_router/16.png b/public/icons/docs/vue_router/16.png new file mode 100644 index 0000000000000000000000000000000000000000..64eb9b345a929493b14931f7a58b07abd91835b8 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/SOURCE b/public/icons/docs/vue_router/SOURCE new file mode 100644 index 00000000..474e2fca --- /dev/null +++ b/public/icons/docs/vue_router/SOURCE @@ -0,0 +1,2 @@ +http://vuejs.org/ +(Edited from the original logo to distinguish Vue Router from Vue) From 5c48bc238476c3f12fed45dcb9758fc66bae7d72 Mon Sep 17 00:00:00 2001 From: Nicolas Ettlin Date: Thu, 11 Oct 2018 19:33:24 +0200 Subject: [PATCH 19/61] Vue Router: ignore French documentation A French translation was recently added to the Vue Router documentation, so we need to ignore it as well as the other translations. --- lib/docs/scrapers/vue_router.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/docs/scrapers/vue_router.rb b/lib/docs/scrapers/vue_router.rb index e19efa11..a029466b 100644 --- a/lib/docs/scrapers/vue_router.rb +++ b/lib/docs/scrapers/vue_router.rb @@ -16,7 +16,7 @@ module Docs options[:skip_patterns] = [ # Other languages - /^(zh|ja|ru|kr)\//, + /^(zh|ja|ru|kr|fr)\//, ] options[:attribution] = <<-HTML From 274e6318303a532652a3f3ca1fe4714f5cb5247f Mon Sep 17 00:00:00 2001 From: Nicolas Ettlin Date: Sun, 14 Oct 2018 21:12:15 +0200 Subject: [PATCH 20/61] Vue Router : add parentheses after method names --- lib/docs/filters/vue_router/entries.rb | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/docs/filters/vue_router/entries.rb b/lib/docs/filters/vue_router/entries.rb index c00c99f2..e8eb2279 100644 --- a/lib/docs/filters/vue_router/entries.rb +++ b/lib/docs/filters/vue_router/entries.rb @@ -41,16 +41,14 @@ module Docs entryName.remove! '# ' - unless entryName.start_with?('router.') - if title == "Router Construction Options" - entryName = "RouterOptions.#{entryName}" - elsif title == " Props" - entryName = " `#{entryName}` prop" - elsif title == " Props" - entryName = " `#{entryName}` prop" - else - entryName = "> #{entryName} (in: #{title})" - end + if title == "Router Construction Options" + entryName = "RouterOptions.#{entryName}" + elsif title == " Props" + entryName = " `#{entryName}` prop" + elsif title == " Props" + entryName = " `#{entryName}` prop" + elsif title == "Router Instance Methods" + entryName = "#{entryName}()" end unless title == "Component Injections" || node['id'] == 'applying-active-class-to-outer-element' || node['id'] == 'route-object-properties' From 54064a92aa91874c736b30ba8d90c7f1e0f61704 Mon Sep 17 00:00:00 2001 From: Nicolas Ettlin Date: Sun, 14 Oct 2018 21:12:54 +0200 Subject: [PATCH 21/61] Vue Router : use the official Vue icon --- public/icons/docs/vue_router/16.png | Bin 1211 -> 534 bytes public/icons/docs/vue_router/16@2x.png | Bin 2020 -> 1244 bytes public/icons/docs/vue_router/SOURCE | 1 - 3 files changed, 1 deletion(-) diff --git a/public/icons/docs/vue_router/16.png b/public/icons/docs/vue_router/16.png index 64eb9b345a929493b14931f7a58b07abd91835b8..153c58cdefe476e6738e7123d9c35a56d482a1ef 100644 GIT binary patch delta 509 zcmV*H1M-xUw)lk~@0;(R zckjKZ%G3U_T6BNH-SSH(m0NOKtx~PFGNB4U!y`kM4qc_=?tf!%Blx06;rq(kwU3kb zr4M#}>9al8YEcAmG(0k7>Cja(ao|*6^`*Mq7aeuwbYoej&tDdMAurV1M;SO89vQN9 z=qlhP-3PPV1JN&g-<^lo$5y%VqkN$)Q}fM`furG(AxlRA;KbnxZ=>@~Z}u?8(<@gp ztJ09E`qG$zqkrLPGI8fC9R>0SIn0{hXLa`VJ@GcfpJ$%j$Sij;v*((^z|p)>FC|0v zPgmpsKR~|oTkhtK!nAzzs#s1Vvz)~pI2s-qvcPmFAGMFL>gaa8x^-9di*P(Myp`GW z&CFhCW^gn-GNuEHySYhs`1?WA%3w8P;An0V3{AF(i+1blhgi=>y;J!yQ~f*??^&?J zz|rtbwurxvm4E5Zxi@S4BPjz%Gnw7si+_-{7Wv1$r1L4iw=i%tlQG!q6mhW3t21!p z?F&)nfppS&#}vH%U>=DLG-I^?g3n!x{9pV6knB79sjXWo00000NkvXXu0mjfsCESw literal 1211 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%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Ef&*sdzD?aj0md7C~HZ*GRWJlhXLn0L-|Mf%6&jsk3?x6X1rne75 zp~|(EA@#Dq5Iw3`f{SM`d^bXf7R1+ub45c#1Fo}dY!nz>alm(eSiTBa-uYpFUs3eT zOaT4>uw~<$0)*4-jyS2WRui?!)5rKHMbuv8G@$Pto%+e$(E zv=}*8M~b-z-w^s(p<-|{xz?Fax+Se~)IYlRi#q?hUPBr%Qo1j(6*3kVI`;f}?(J7z zX8*48O_u=WV~NE39u>Z~Qj9W&RQDq(y0NmlFO4Vu(&Z2oc$n_IRtV-_q3#jOxfaKf zNOtUfoojf+HRp_s42O;h2eGlnT ze{XecXn$W{{hd3ilGB_=DfvV~NtL{OVrFJ0&>ri1cy=;wPv=R<8%Jsb?9V7Y+}kcu zEiJ|Md9iW_zJCjEn;HOq?RFV_=ISy?^x4C*vYOz^LP7DZvKf3Pkn{K&iC-Tw`{HcQ z(d@cDE7bHHHYny3;upAtW*f1iNogJ+(L_Zep8;2-6;rP{H`-fjIvi&$RPwi*#SI}= zikA%W1SK^@j*C4)N9;%wa~hX@sJ^g&rh+|U6~IM*b1qsns2yco3{bQ zdFU#SW6+YTVWTmJ7D&^DcVZyYqXV<6YTR7 z(T?ISg%Np^GCz%cpP!$HdnXOA2YXQrdqj#28ugt${nnzdH!e2I_C?Bkfg+=mxn2j& zLcyT`otM2Ou83q?&lMlxn?#?zYw;LFJ-6?Yd&|d^2)EV+4f^qq=39bjje{SeoDbyO zFYb9i+12_eL(Z$iI$@y0z?~`j7ryv~Ma+urnx|aJ8mG#J4H~g*U3fNV$OZ>37vPdp zg&9WW^=Fa;1%i=hSGU6Xg^e;xzbBq%0S?>zu67H9c`uh;gp1GdzX5dAmn^^Bwd diff --git a/public/icons/docs/vue_router/SOURCE b/public/icons/docs/vue_router/SOURCE index 474e2fca..97bd9e03 100644 --- a/public/icons/docs/vue_router/SOURCE +++ b/public/icons/docs/vue_router/SOURCE @@ -1,2 +1 @@ http://vuejs.org/ -(Edited from the original logo to distinguish Vue Router from Vue) From d3196c53ed3948d42223053a042ef180f79db2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Gonz=C3=A1lez?= Date: Tue, 25 Sep 2018 17:51:35 +0200 Subject: [PATCH 22/61] Add documentation for cypress.io --- assets/stylesheets/application.css.scss | 1 + assets/stylesheets/pages/_cypress.scss | 21 ++++++++++++ lib/docs/filters/cypress/clean_html.rb | 17 ++++++++++ lib/docs/filters/cypress/entries.rb | 41 ++++++++++++++++++++++++ lib/docs/scrapers/cypress.rb | 33 +++++++++++++++++++ public/icons/docs/cypress/16.png | Bin 0 -> 1183 bytes public/icons/docs/cypress/16@2x.png | Bin 0 -> 1858 bytes public/icons/docs/cypress/SOURCE.ico | Bin 0 -> 32038 bytes 8 files changed, 113 insertions(+) create mode 100644 assets/stylesheets/pages/_cypress.scss create mode 100644 lib/docs/filters/cypress/clean_html.rb create mode 100644 lib/docs/filters/cypress/entries.rb create mode 100644 lib/docs/scrapers/cypress.rb create mode 100644 public/icons/docs/cypress/16.png create mode 100644 public/icons/docs/cypress/16@2x.png create mode 100644 public/icons/docs/cypress/SOURCE.ico diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index fd6ffffd..72feda6a 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -46,6 +46,7 @@ 'pages/coffeescript', 'pages/cordova', 'pages/crystal', + 'pages/cypress', 'pages/d', 'pages/d3', 'pages/dart', diff --git a/assets/stylesheets/pages/_cypress.scss b/assets/stylesheets/pages/_cypress.scss new file mode 100644 index 00000000..aa1108d2 --- /dev/null +++ b/assets/stylesheets/pages/_cypress.scss @@ -0,0 +1,21 @@ +._cypress { + @extend %simple; + + .note { + h1 { + margin-left: inherit + } + + &.danger { + @extend %note-red + } + + &.info { + @extend %note-blue + } + + &.success { + @extend %note-green + } + } +} diff --git a/lib/docs/filters/cypress/clean_html.rb b/lib/docs/filters/cypress/clean_html.rb new file mode 100644 index 00000000..6a36d24c --- /dev/null +++ b/lib/docs/filters/cypress/clean_html.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Docs + class Cypress + class CleanHtmlFilter < Filter + def call + css('.article-edit-link').remove + css('#sidebar').remove + css('article footer').remove + css('#article-toc').remove + css('.article-footer-updated').remove + + doc + end + end + end +end diff --git a/lib/docs/filters/cypress/entries.rb b/lib/docs/filters/cypress/entries.rb new file mode 100644 index 00000000..a854acd7 --- /dev/null +++ b/lib/docs/filters/cypress/entries.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Docs + class Cypress + class EntriesFilter < Docs::EntriesFilter + SECTIONS = %w[ + commands + core-concepts + cypress-api + events + examples + getting-started + guides + overview + plugins + references + utilities + ].freeze + + def get_name + at_css('h1.article-title').content.strip + end + + def get_type + path = context[:url].path + + SECTIONS.each do |section| + if path.match?("/#{section}/") + return section.split('-').map(&:capitalize).join(' ') + end + end + end + + def additional_entries + css('.sidebar-li > a').map do |node| + [node['href']] + end + end + end + end +end diff --git a/lib/docs/scrapers/cypress.rb b/lib/docs/scrapers/cypress.rb new file mode 100644 index 00000000..d6db296a --- /dev/null +++ b/lib/docs/scrapers/cypress.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Docs + class Cypress < UrlScraper + # Follow the instructions on https://github.com/cypress-io/cypress-documentation/blob/develop/CONTRIBUTING.md + # to run the cypress documentation server locally in the following URL: + # self.base_url = 'http://localhost:2222' + self.base_url = 'https://docs.cypress.io' + + self.name = 'Cypress' + self.type = 'cypress' + self.root_path = '/api/introduction/api.html' + + html_filters.push 'cypress/clean_html', 'cypress/entries' + + options[:root_title] = 'Cypress' + options[:container] = '#content' + + options[:include_default_entry] = true + + options[:skip_link] = lambda do |link| + href = link.attr(:href) + + EntriesFilter::SECTIONS.none? { |section| href.match?("/#{section}/") } + end + + options[:attribution] = <<-HTML + © 2018 Cypress.io + - Licensed under the + MIT License. + HTML + end +end diff --git a/public/icons/docs/cypress/16.png b/public/icons/docs/c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`-3# z`|&Qf#R*0;9YXDXKH0x+qLgU=@qT((;_+{4{z;Yyy&%x#7L z?hDi$)NW4O?0IhYj~crZX`An~2dz9ZYmUjKDW`px+;m%0eLg7n(n}MIxqc^}e-2oE tRmA`Mw9n6V1%Ac%doEP{d-3@n>3hexf5k7BSPCi|JYD@<);T3K0RYQJ$%X&` literal 0 HcmV?d00001 diff --git a/public/icons/docs/cypress/16@2x.png b/public/icons/docs/cypress/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..a327f375e2bd8d79903a04704031e94ecf0d93c0 GIT binary patch literal 1858 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL`2bFmY#wM3hAM z`dB6B=jtV<RtPXT0ZVp4u-iLH_n z$Rap^xU(cP4PjGWG1OZ?59)(t^bPe4^xy%qvMP z0$K*u4RauF6;QKm^g+Re6nv1l0gD17$BxTJA0E+mT>P$DlNlITo_e}ChD2~44Ug9N z8YvS0e8)G*=_j5kdu4&^6lH$v$Ild?#kbNn0ZWev$UVT|LX1Ax9iX8 zv?^7wv$Om3?c2BVFayirUre_qb$6fUKYjZ2?7m(6G9A6WzB_jB{yq8quWa{+|C>IC zzL)NG`+VxusrXlRR_q_n=jY`ui@&`iO~7x*u3c%X)Dy4F*ikI=`+urT*#`5R1JlyN ztrGZmT;ElkTc5uAWS;kjBceBg-zo?1Gr2WavZ|}?O^0*Wu3JkdJm>HE{qtv_rzdA> zdU~*j2S;Jeg=^QuzJC86?C;O7s-hAQ7BH6WrkMrG1T-7u+JEf$hPu{;DuVMXf&HDAhv9YpSw{Q0j3k?-5 zEid<$VUS)jXO4{H?K^jt{P|PUTVGdMDVbDKUjDyN)9P_zV&auMcXWC;Ki{%(qod5; zBVI|(8#fxxnmv2*;ls|k&R%|g(+n8=ti3!vCvG`-(2>*l!@0|sjqguY7Ty|be(Ln; zPG;8&1#gxvU20-zs8}E`FR!JgwWzO;uPJ%);>AqtmoGBb*>illRZzh2>-|Jl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nL|X|cUk??1IdU6;E5MBRu^ zh4w|QpnD_w4i{;1+kF~GY#a6mu`jERxJXdicBK*f$NYiophfpzsROZnmEV6}MfE!Y z-Ss)PB(B!MAE_OnYeQ_e^(H(=2xRrOwoo?0>fGqG*w4Jce9{(dwK||vUE_S&IubdZ z1tztjIzX4g_nXVw8^afwtd&>ieOY7|TGPgCXlcI4XU{ZPpsu~M(AhRzG>t4|X6|KL zYFin4(WQd`K9r9HirP^Y58lWK?%&JkyDD)-Ki+?4t|;VJ7QC!_fCs$V^!v}T`V_r8 p3iK7YNPu~HiohHJd+tn{Jj%cU7n+VSzKzOHe-GgQ|NpmY;NLnW=MDe> literal 0 HcmV?d00001 From 013ce522a2d942cd2cf3387edabdae8c91dbcd62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Gonz=C3=A1lez?= Date: Wed, 17 Oct 2018 13:09:13 +0200 Subject: [PATCH 23/61] Update base url after recent changes to cypress documentation --- lib/docs/scrapers/cypress.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/docs/scrapers/cypress.rb b/lib/docs/scrapers/cypress.rb index d6db296a..e5433b22 100644 --- a/lib/docs/scrapers/cypress.rb +++ b/lib/docs/scrapers/cypress.rb @@ -9,7 +9,7 @@ module Docs self.name = 'Cypress' self.type = 'cypress' - self.root_path = '/api/introduction/api.html' + self.root_path = '/api/api/table-of-contents.html' html_filters.push 'cypress/clean_html', 'cypress/entries' From 57232ce130a64eceded02b89fb38e64523e4db3a Mon Sep 17 00:00:00 2001 From: Nicolas Ettlin Date: Wed, 17 Oct 2018 21:21:21 +0200 Subject: [PATCH 24/61] Add Vuex reference --- .../templates/pages/about_tmpl.coffee | 5 ++ lib/docs/filters/vuex/clean_html.rb | 14 ++++ lib/docs/filters/vuex/entries.rb | 68 ++++++++++++++++++ lib/docs/scrapers/vuex.rb | 26 +++++++ public/icons/docs/vuex/16.png | Bin 0 -> 534 bytes public/icons/docs/vuex/16@2x.png | Bin 0 -> 1244 bytes public/icons/docs/vuex/SOURCE | 1 + 7 files changed, 114 insertions(+) create mode 100644 lib/docs/filters/vuex/clean_html.rb create mode 100644 lib/docs/filters/vuex/entries.rb create mode 100644 lib/docs/scrapers/vuex.rb create mode 100644 public/icons/docs/vuex/16.png create mode 100644 public/icons/docs/vuex/16@2x.png create mode 100644 public/icons/docs/vuex/SOURCE diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index fef9a024..72fb74cd 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -680,6 +680,11 @@ credits = [ '2013-2018 Evan You, Vue.js contributors', 'MIT', 'https://raw.githubusercontent.com/vuejs/vue/master/LICENSE' + ], [ + 'Vuex', + '2015-2018 Evan You, Vue.js contributors', + 'MIT', + 'https://raw.githubusercontent.com/vuejs/vuex/master/LICENSE' ], [ 'Vulkan', '2014-2017 Khronos Group Inc.
Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc.', diff --git a/lib/docs/filters/vuex/clean_html.rb b/lib/docs/filters/vuex/clean_html.rb new file mode 100644 index 00000000..f62870cc --- /dev/null +++ b/lib/docs/filters/vuex/clean_html.rb @@ -0,0 +1,14 @@ +module Docs + class Vuex + class CleanHtmlFilter < Filter + def call + @doc = at_css('.content') + + # Remove unneeded elements + css('.header-anchor').remove + + doc + end + end + end +end \ No newline at end of file diff --git a/lib/docs/filters/vuex/entries.rb b/lib/docs/filters/vuex/entries.rb new file mode 100644 index 00000000..72c8486e --- /dev/null +++ b/lib/docs/filters/vuex/entries.rb @@ -0,0 +1,68 @@ +module Docs + class Vuex + class EntriesFilter < Docs::EntriesFilter + def get_name + name = at_css('h1').content + + name.remove! '# ' + + # Add index on guides + unless subpath.start_with?('api') + sidebarLink = at_css('.sidebar-link.active') + allLinks = css('.sidebar-link:not([href="/"]):not([href="../index"])') + + index = allLinks.index(sidebarLink) + + name.prepend "#{index + 1}. " if index + end + + name + end + + def get_type + 'Guide' + end + + def include_default_entry? + name != 'API Reference' + end + + def additional_entries + return [] unless subpath.start_with?('api') + + entries = [ + ['Component Binding Helpers', 'component-binding-helpers', 'API Reference'], + ['Store', 'vuex-store', 'API Reference'], + ] + + css('h3').each do |node| + entryName = node.content.strip + + # Get the previous h2 title + title = node + title = title.previous_element until title.name == 'h2' + title = title.content.strip + title.remove! '# ' + + entryName.remove! '# ' + + unless entryName.start_with?('router.') + if title == "Vuex.Store Constructor Options" + entryName = "StoreOptions.#{entryName}" + elsif title == "Vuex.Store Instance Properties" + entryName = "Vuex.Store.#{entryName}" + elsif title == "Vuex.Store Instance Methods" + entryName = "Vuex.Store.#{entryName}()" + elsif title == "Component Binding Helpers" + entryName = "#{entryName}()" + end + end + + entries << [entryName, node['id'], 'API Reference'] + end + + entries + end + end + end +end \ No newline at end of file diff --git a/lib/docs/scrapers/vuex.rb b/lib/docs/scrapers/vuex.rb new file mode 100644 index 00000000..774e989f --- /dev/null +++ b/lib/docs/scrapers/vuex.rb @@ -0,0 +1,26 @@ +module Docs + class Vuex < UrlScraper + self.name = 'Vuex' + self.type = 'simple' + + self.links = { + home: 'https://vuex.vuejs.org', + code: 'https://github.com/vuejs/vuex' + } + + html_filters.push 'vuex/entries', 'vuex/clean_html' + + self.release = '3.0.1' + self.base_url = 'https://vuex.vuejs.org/' + + options[:skip_patterns] = [ + # Other languages + /^(zh|ja|ru|kr|fr|ptbr)\//, + ] + + options[:attribution] = <<-HTML + © 2015–2018 Evan You, Vue.js contributors
+ Licensed under the MIT License. + HTML + end +end diff --git a/public/icons/docs/vuex/16.png b/public/icons/docs/vuex/16.png new file mode 100644 index 0000000000000000000000000000000000000000..153c58cdefe476e6738e7123d9c35a56d482a1ef GIT binary patch literal 534 zcmV+x0_pvUP)*H1M-xUw)lk~@0;(RckjKZ%G3U_T6BNH-SSH(m0NOKtx~PF zGNB4U!y`kM4qc_=?qhEw_@YPQ`^wt2kCXPL4|aX&vpv^p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pony/container.rb | 9 +++++++++ lib/docs/filters/pony/entries.rb | 14 ++++++++++++++ lib/docs/scrapers/pony.rb | 12 ++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 lib/docs/filters/pony/clean_html.rb create mode 100644 lib/docs/filters/pony/container.rb create mode 100644 lib/docs/filters/pony/entries.rb create mode 100644 lib/docs/scrapers/pony.rb diff --git a/lib/docs/filters/pony/clean_html.rb b/lib/docs/filters/pony/clean_html.rb new file mode 100644 index 00000000..0aac0f7a --- /dev/null +++ b/lib/docs/filters/pony/clean_html.rb @@ -0,0 +1,10 @@ +module Docs + class Pony + class CleanHtmlFilter < Filter + def call + css('.headerlink').remove + doc + end + end + end +end diff --git a/lib/docs/filters/pony/container.rb b/lib/docs/filters/pony/container.rb new file mode 100644 index 00000000..f29db7d4 --- /dev/null +++ b/lib/docs/filters/pony/container.rb @@ -0,0 +1,9 @@ +module Docs + class Pony + class ContainerFilter < Filter + def call + css('article') + end + end + end +end diff --git a/lib/docs/filters/pony/entries.rb b/lib/docs/filters/pony/entries.rb new file mode 100644 index 00000000..09ffe595 --- /dev/null +++ b/lib/docs/filters/pony/entries.rb @@ -0,0 +1,14 @@ +module Docs + class Pony + class EntriesFilter < Docs::EntriesFilter + def get_name + binding.pry + context[:html_title].sub(/ - .*/, '') + end + + def get_type + subpath.split('-')[0][1..-1] + end + end + end +end diff --git a/lib/docs/scrapers/pony.rb b/lib/docs/scrapers/pony.rb new file mode 100644 index 00000000..9863ed76 --- /dev/null +++ b/lib/docs/scrapers/pony.rb @@ -0,0 +1,12 @@ +module Docs + class Pony < UrlScraper + self.type = 'pony' + self.release = '0.25.0' + self.base_url = 'http://localhost:2015' + #self.base_url = 'https://stdlib.ponylang.io/' + + html_filters.push 'pony/container', 'pony/entries', 'pony/clean_html' + options[:attribution] = "Me" + options[:follow_links] = ->(filter) { filter.subpath !~ /src/ } + end +end From 04ccf963961ede13401bf888d73fb6900ceecc56 Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Thu, 13 Dec 2018 22:24:03 +0100 Subject: [PATCH 26/61] Remove header handling This is already taken care of in the container filter. --- lib/docs/filters/pony/clean_html.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/docs/filters/pony/clean_html.rb b/lib/docs/filters/pony/clean_html.rb index 0aac0f7a..248c3de7 100644 --- a/lib/docs/filters/pony/clean_html.rb +++ b/lib/docs/filters/pony/clean_html.rb @@ -2,7 +2,6 @@ module Docs class Pony class CleanHtmlFilter < Filter def call - css('.headerlink').remove doc end end From dea577a1a3e36b4052cb4c82ec0cbbd7e7398f80 Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Thu, 13 Dec 2018 22:24:34 +0100 Subject: [PATCH 27/61] Fix type naming and remove debug statement --- lib/docs/filters/pony/entries.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/docs/filters/pony/entries.rb b/lib/docs/filters/pony/entries.rb index 09ffe595..0dbc81c8 100644 --- a/lib/docs/filters/pony/entries.rb +++ b/lib/docs/filters/pony/entries.rb @@ -2,12 +2,11 @@ module Docs class Pony class EntriesFilter < Docs::EntriesFilter def get_name - binding.pry context[:html_title].sub(/ - .*/, '') end def get_type - subpath.split('-')[0][1..-1] + subpath.split('-')[0][0..-1] end end end From 56c6fe95afe686dc78a70b16c684cefef7aec156 Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Thu, 13 Dec 2018 22:25:07 +0100 Subject: [PATCH 28/61] Use live URL --- lib/docs/scrapers/pony.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/docs/scrapers/pony.rb b/lib/docs/scrapers/pony.rb index 9863ed76..6fb1dd56 100644 --- a/lib/docs/scrapers/pony.rb +++ b/lib/docs/scrapers/pony.rb @@ -2,8 +2,7 @@ module Docs class Pony < UrlScraper self.type = 'pony' self.release = '0.25.0' - self.base_url = 'http://localhost:2015' - #self.base_url = 'https://stdlib.ponylang.io/' + self.base_url = 'https://stdlib.ponylang.io/' html_filters.push 'pony/container', 'pony/entries', 'pony/clean_html' options[:attribution] = "Me" From 6a8a80d190f4791009fde522ea37c00abfdb7c6e Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Thu, 13 Dec 2018 22:25:23 +0100 Subject: [PATCH 29/61] Fix ordering of filters --- lib/docs/scrapers/pony.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/docs/scrapers/pony.rb b/lib/docs/scrapers/pony.rb index 6fb1dd56..a9cbd6c3 100644 --- a/lib/docs/scrapers/pony.rb +++ b/lib/docs/scrapers/pony.rb @@ -4,7 +4,7 @@ module Docs self.release = '0.25.0' self.base_url = 'https://stdlib.ponylang.io/' - html_filters.push 'pony/container', 'pony/entries', 'pony/clean_html' + html_filters.push 'pony/container', 'pony/clean_html', 'pony/entries' options[:attribution] = "Me" options[:follow_links] = ->(filter) { filter.subpath !~ /src/ } end From 21aca67a5330088eff9768c962bee5b3344b20de Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Thu, 13 Dec 2018 22:25:36 +0100 Subject: [PATCH 30/61] Deal with trailing slash and 'src' URLs --- lib/docs/scrapers/pony.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/docs/scrapers/pony.rb b/lib/docs/scrapers/pony.rb index a9cbd6c3..0201ed18 100644 --- a/lib/docs/scrapers/pony.rb +++ b/lib/docs/scrapers/pony.rb @@ -6,6 +6,7 @@ module Docs html_filters.push 'pony/container', 'pony/clean_html', 'pony/entries' options[:attribution] = "Me" - options[:follow_links] = ->(filter) { filter.subpath !~ /src/ } + options[:trailing_slash] = false + options[:skip_patterns] = [/src/] end end From 81efc885ec2256fd6688da1c247346591d143c63 Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Thu, 13 Dec 2018 22:33:17 +0100 Subject: [PATCH 31/61] Add logos --- public/icons/docs/pony/16.png | Bin 0 -> 1979 bytes public/icons/docs/pony/16@2x.png | Bin 0 -> 1979 bytes public/icons/docs/pony/SOURCE | 1 + 3 files changed, 1 insertion(+) create mode 100644 public/icons/docs/pony/16.png create mode 100644 public/icons/docs/pony/16@2x.png create mode 100644 public/icons/docs/pony/SOURCE diff --git a/public/icons/docs/pony/16.png b/public/icons/docs/pony/16.png new file mode 100644 index 0000000000000000000000000000000000000000..daed6509fb0efbcee6aceaa42047dd39ed731f03 GIT binary patch literal 1979 zcmV;s2SoUZP)hr}s;W?PY#LfiKT`mKOgiA& znx)_ge$DZ|LOC!@aS8&($kCy&?^t1u1;7B3^0+uw`US$2&$QUl6&j`mh8af4IH=Yv zZ&oaOozh=(ya-hPCjcXyXkdb8Xv~FN+!%0a!ejEs-(yF=Q))n9guoLT02zqbRH(Ab zItmGo8HXb7;0TU*M-uminF`5V$YoQ~+?({6=OC(CdSj(%l~UEQuVU#0G*%8NI05ku zO=ChzQD0)IJR<<9r18JYj1@f7IMQNX9Mo3m2`y)%AgEC;8GFY*EWQ4##D&cWb z?C4K=ObHBQlRhUJAvjRw$wGxy4yv)E9dJi=AT-Pm46_2mq-?;&4&uHlYburqsV5l1w(s-kv_LUUAXJ zH#>HJTXG>ctlzNlzUIltfjTa^;5_zq??tt~Yfhfp%-#3>iiaQkHLD-{1F^NtK5Y&^ zx&1C~xbAE0*}aQIGRZURUgDlRZ)0ayCylurMht~Q57Va4VC$Q2@a{Wrv!G=m_x$n! z5JSiA9+oa?yV0+gKtb!x8AY{Waey7$J9y-w2YB?6hlj`B-uf1QUi~-?=>`C*l?t!F zwwVnttYu$!H*@Bl&Vjx@cJ1ty6nc7Cdd|53jGr)(S6+OPMN8`6mMuS@36mxbuQPkjT*5Hqa~EE8Sa}Wu zxayi~0a(z|%JR>D0e~P30J!!W*Yl&5KO0KI(b~2YfY!DpYuaU&*=WUr=`< z2#BJn4geTapML7hSv2MIY*^Pm1W-TUmMuS@WGcmimR6eb`B4E5+dpo|fv;bGBiDcH zCICKse;WX6pL>R#T{{@EU>Kk@ILN|9ZLDj59uXNH7ZKt(CYef&Dn6T}(Ua1YA^M@zS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T*5Hqa~EE8Sa}Wu zxayi~0a(z|%JR>D0e~P30J!!W*Yl&5KO0KI(b~2YfY!DpYuaU&*=WUr=`< z2#BJn4geTapML7hSv2MIY*^Pm1W-TUmMuS@WGcmimR6eb`B4E5+dpo|fv;bGBiDcH zCICKse;WX6pL>R#T{{@EU>Kk@ILN|9ZLDj59uXNH7ZKt(CYef&Dn6T}(Ua1YA^M@zS#y92g+g(7?3mGXO{=68z#f53%8ex+ABbIiLAwwXnYZ zc?OC_X3w3=m@!Q}{r7cbvf1IqXU;l}Og2k4+sOFw6aJNTkYv}+E&#*`W5y=U_aFV^ z<3DU|Ya5mF(~g%nZsdx~E?wDMakqYaA27$KxLd$Wd9)fK9~#Cvs5&JQU?8I1!2uu{ z2q&uGs}dO@69{>Q!N^enO0lv>psB%Up@YFdIId!OqvqHRR21y~GT)(off*6r*aUY5 zhN)JG1H)KPNEahsv&z1Th{}s*n~T zoAR0M6p3|cK_LT-S8$nt3ypv;UDfv>vRndLZV>LX~Gn6FsT}!?l1xtL(Fm z11gj~ArUJbMo2dXoEtm#M#}y`80!gRl0Fj)6>h6ow$~gVlw$s7>do2DQ64Er1Q?2< zgFS&^a$uMd*MWM Date: Fri, 14 Dec 2018 10:13:51 +0100 Subject: [PATCH 32/61] Remove unnecessary clean html filter --- lib/docs/filters/pony/clean_html.rb | 9 --------- lib/docs/scrapers/pony.rb | 3 ++- 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 lib/docs/filters/pony/clean_html.rb diff --git a/lib/docs/filters/pony/clean_html.rb b/lib/docs/filters/pony/clean_html.rb deleted file mode 100644 index 248c3de7..00000000 --- a/lib/docs/filters/pony/clean_html.rb +++ /dev/null @@ -1,9 +0,0 @@ -module Docs - class Pony - class CleanHtmlFilter < Filter - def call - doc - end - end - end -end diff --git a/lib/docs/scrapers/pony.rb b/lib/docs/scrapers/pony.rb index 0201ed18..091c22fe 100644 --- a/lib/docs/scrapers/pony.rb +++ b/lib/docs/scrapers/pony.rb @@ -4,8 +4,9 @@ module Docs self.release = '0.25.0' self.base_url = 'https://stdlib.ponylang.io/' - html_filters.push 'pony/container', 'pony/clean_html', 'pony/entries' + html_filters.push 'pony/container', 'pony/entries' options[:attribution] = "Me" + options[:trailing_slash] = false options[:skip_patterns] = [/src/] end From d27c1c47a256099814310bed5672796928dc5d67 Mon Sep 17 00:00:00 2001 From: Harm Aarts Date: Fri, 14 Dec 2018 10:14:10 +0100 Subject: [PATCH 33/61] Fix attribution --- lib/docs/scrapers/pony.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/docs/scrapers/pony.rb b/lib/docs/scrapers/pony.rb index 091c22fe..702bc1ef 100644 --- a/lib/docs/scrapers/pony.rb +++ b/lib/docs/scrapers/pony.rb @@ -5,7 +5,10 @@ module Docs self.base_url = 'https://stdlib.ponylang.io/' html_filters.push 'pony/container', 'pony/entries' - options[:attribution] = "Me" + + options[:attribution] = <<-HTML + © 2018 Pony Developers + HTML options[:trailing_slash] = false options[:skip_patterns] = [/src/] From 5da021471720c5c02fe30762a178d6148acb84e7 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Sat, 15 Dec 2018 17:41:49 +0000 Subject: [PATCH 34/61] Add RxJS The current RxJS documentation site is https://rxjs.dev/. It is very similar to Angular documentation site (https://angular.io/) so I reused most code. Images on the documentation site seem to be broken and so the scrapper cannot download them. You can see an example of a broken image at https://rxjs.dev/api/operators/buffer. Related to https://github.com/freeCodeCamp/devdocs/issues/939 --- assets/stylesheets/application.css.scss | 1 + assets/stylesheets/pages/_rxjs.scss | 24 ++++++ lib/docs/filters/rxjs/clean_html.rb | 101 ++++++++++++++++++++++++ lib/docs/filters/rxjs/entries.rb | 23 ++++++ lib/docs/scrapers/rxjs.rb | 94 ++++++++++++++++++++++ public/icons/docs/rxjs/16.png | Bin 0 -> 5356 bytes public/icons/docs/rxjs/16@2x.png | Bin 0 -> 5084 bytes public/icons/docs/rxjs/SOURCE | 1 + 8 files changed, 244 insertions(+) create mode 100644 assets/stylesheets/pages/_rxjs.scss create mode 100644 lib/docs/filters/rxjs/clean_html.rb create mode 100644 lib/docs/filters/rxjs/entries.rb create mode 100644 lib/docs/scrapers/rxjs.rb create mode 100644 public/icons/docs/rxjs/16.png create mode 100644 public/icons/docs/rxjs/16@2x.png create mode 100644 public/icons/docs/rxjs/SOURCE diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index fd6ffffd..bcd8a7f2 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -94,6 +94,7 @@ 'pages/rfc', 'pages/rubydoc', 'pages/rust', + 'pages/rxjs', 'pages/sinon', 'pages/socketio', 'pages/sphinx', diff --git a/assets/stylesheets/pages/_rxjs.scss b/assets/stylesheets/pages/_rxjs.scss new file mode 100644 index 00000000..15e1252b --- /dev/null +++ b/assets/stylesheets/pages/_rxjs.scss @@ -0,0 +1,24 @@ +._rxjs { + @extend %simple; + + .pre-title { @extend %pre-heading; } + + .breadcrumbs { @extend %note; } + .banner { @extend %note-green; } + code.stable { @extend %label-green; } + code.experimental { @extend %label-orange; } + code.deprecated { @extend %label-red; } + .alert.is-important { @extend %note-red; } + .alert.is-helpful, .breadcrumbs { @extend %note-blue; } + + .breadcrumbs { padding-left: 2em; } + + img { margin: 1em 0; } + + .location-badge { + font-style: italic; + text-align: right; + } + + td h3 { margin: 0 !important; } +} diff --git a/lib/docs/filters/rxjs/clean_html.rb b/lib/docs/filters/rxjs/clean_html.rb new file mode 100644 index 00000000..1056b1a6 --- /dev/null +++ b/lib/docs/filters/rxjs/clean_html.rb @@ -0,0 +1,101 @@ +module Docs + class Rxjs + class CleanHtmlFilter < Filter + def call + if root_page? + css('.card-container').remove + at_css('h1').content = 'RxJS Documentation' + end + + css('br', 'hr', '.material-icons', '.header-link', '.breadcrumb').remove + + css('.content', 'article', '.api-header', 'section', '.instance-member').each do |node| + node.before(node.children).remove + end + + css('label', 'h2 > em', 'h3 > em').each do |node| + node.name = 'code' + end + + css('h1 + code').each do |node| + node.before('

') + while node.next_element.name == 'code' + node.previous_element << ' ' + node.previous_element << node.next_element + end + node.previous_element.prepend_child(node) + end + + css('td h3', '.l-sub-section > h3', '.alert h3', '.row-margin > h3', '.api-heading ~ h3', '.api-heading + h2', '.metadata-member h3').each do |node| + node.name = 'h4' + end + + css('.l-sub-section', '.alert', '.banner').each do |node| + node.name = 'blockquote' + end + + css('.file').each do |node| + node.content = node.content.strip + end + + css('.filetree .children').each do |node| + node.css('.file').each do |n| + n.content = " #{n.content}" + end + end + + css('.filetree').each do |node| + node.content = node.css('.file').map(&:inner_html).join("\n") + node.name = 'pre' + node.remove_attribute('class') + end + + css('pre').each do |node| + node.content = node.content.strip + + node['data-language'] = 'typescript' if node['path'].try(:ends_with?, '.ts') + node['data-language'] = 'html' if node['path'].try(:ends_with?, '.html') + node['data-language'] = 'css' if node['path'].try(:ends_with?, '.css') + node['data-language'] = 'js' if node['path'].try(:ends_with?, '.js') + node['data-language'] = 'json' if node['path'].try(:ends_with?, '.json') + node['data-language'] = node['language'].sub(/\Ats/, 'typescript').strip if node['language'] + node['data-language'] ||= 'typescript' if node.content.start_with?('@') + + node.before(%(
#{node['title']}
)) if node['title'] + + if node['class'] && node['class'].include?('api-heading') + node.name = 'h3' + node.inner_html = "#{node.inner_html}" + end + + node.remove_attribute('path') + node.remove_attribute('region') + node.remove_attribute('linenums') + node.remove_attribute('title') + node.remove_attribute('language') + node.remove_attribute('hidecopy') + node.remove_attribute('class') + end + + css('h1[class]').remove_attr('class') + css('table[class]').remove_attr('class') + css('table[width]').remove_attr('width') + css('tr[style]').remove_attr('style') + + if at_css('.api-type-label.module') + at_css('h1').content = subpath.remove('api/') + end + + css('th h3').each do |node| + node.name = 'span' + end + + css('code code').each do |node| + node.before(node.children).remove + end + + doc + end + end + end +end diff --git a/lib/docs/filters/rxjs/entries.rb b/lib/docs/filters/rxjs/entries.rb new file mode 100644 index 00000000..020ce1eb --- /dev/null +++ b/lib/docs/filters/rxjs/entries.rb @@ -0,0 +1,23 @@ +module Docs + class Rxjs + class EntriesFilter < Docs::EntriesFilter + def get_name + name = at_css('h1').content + name.prepend "#{$1}. " if subpath =~ /\-pt(\d+)/ + name + end + + def get_type + if slug.start_with?('guide') + 'Guide' + elsif at_css('.api-type-label.module') + name.split('/').first + elsif slug.start_with?('api/') + slug.split('/').second + else + 'Miscellaneous' + end + end + end + end +end diff --git a/lib/docs/scrapers/rxjs.rb b/lib/docs/scrapers/rxjs.rb new file mode 100644 index 00000000..1825fc80 --- /dev/null +++ b/lib/docs/scrapers/rxjs.rb @@ -0,0 +1,94 @@ +require 'yajl/json_gem' + +module Docs + class Rxjs < UrlScraper + self.name = 'RxJS' + self.type = 'rxjs' + self.links = { + home: 'https://rxjs.dev/', + code: 'https://github.com/ReactiveX/rxjs' + } + + options[:max_image_size] = 256_000 + + options[:attribution] = <<-HTML + © 2015–2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.
+ Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0. + HTML + + module Common + private + + def initial_urls + initial_urls = [] + + Request.run "#{self.class.base_url}generated/navigation.json" do |response| + data = JSON.parse(response.body) + dig = ->(entry) do + initial_urls << url_for("generated/docs/#{entry['url']}.json") if entry['url'] && entry['url'] != 'api' + entry['children'].each(&dig) if entry['children'] + end + data['SideNav'].each(&dig) + end + + Request.run "#{self.class.base_url}generated/docs/api/api-list.json" do |response| + data = JSON.parse(response.body) + dig = ->(entry) do + initial_urls << url_for("generated/docs/#{entry['path']}.json") if entry['path'] + initial_urls << url_for("generated/docs/api/#{entry['name']}.json") if entry['name'] && !entry['path'] + entry['items'].each(&dig) if entry['items'] + end + data.each(&dig) + end + + initial_urls + end + + def handle_response(response) + if response.mime_type.include?('json') + begin + response.options[:response_body] = JSON.parse(response.body)['contents'] + rescue JSON::ParserError + response.options[:response_body] = '' + end + response.headers['Content-Type'] = 'text/html' + response.url.path = response.url.path.sub('/generated/docs/', '/').remove('.json') + response.effective_url.path = response.effective_url.path.sub('/generated/docs/', '/').remove('.json') + end + super + end + end + + version do + self.release = '6.3.3' + self.base_url = 'https://rxjs.dev/' + self.root_path = 'guide/overview' + + html_filters.push 'rxjs/clean_html', 'rxjs/entries' + + options[:follow_links] = false + options[:only_patterns] = [/\Aguide/, /\Aapi/] + options[:fix_urls_before_parse] = ->(url) do + url.sub! %r{\Aguide/}, '/guide/' + url.sub! %r{\Aapi/}, '/api/' + url.sub! %r{\Agenerated/}, '/generated/' + url + end + + include Docs::Rxjs::Common + end + + private + + def parse(response) + response.body.gsub! '', 'live example' + response.body.gsub! ' zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1bvk}M|-{O1%t0w5OYIII!AfsgM5MAb~cd5*Bd zT{Be_%_3z=DcX#`{+#9yd_4JJLd={bC5umxAiki%_I%FM*|6{WVsGPHzj?m!=psDn zyr!Y!3;N?bAqVZR-}_B&x(@3?cV%6W*3KRc9ml#5`P1+8-H6UB;fp)^-^O0TI$iYh zJ!F8^4FltlgczeKCj4_Uq>hc5`-~a~$tVNI)tXb?UmZTNqdYCGBYmSH^!tJMT+y zF#n%z#(p-}U}EsYXFR=co^~Ho_Tt+nC9KO$pGl}2Fyg6! zHSj_HvBm9uW$)J>se^d6}rw@ez1aFegz=RSj??EMu8AF z71Ox!-Iw_iH}(s$1P0@Vnc-lu^(;}Ndt-|>&xCQ&24hcZxZHICK!m*`jBx}8Y(jXu zQ(!ZykP3JDX3^x!;BaArG z$b*NBG7)Q&W|(oNnI}(~EVD6t;bIRIcEbMXlWewdq-zD6VlejnoV?H=A zo)-fMXumkK>_YI1xy6|kkEDnmthu25Iw2E%YZPWN#4GWUgs{w#UR(rOz|BdT_|aXER#!@k|c(v_cc|$MzxAF2KC>Ub_?Z=KV3Q z4V2?zZrfc$t(?J)(L9|nlnz)BCRdL^$er_TYs1qpRk>|M6LtL!00pa8L_oZ=iFCtJ zX`pqyMBs@DsU9F2Lv00HZm&s3v+dZ z?a?>~g?h|I1#dx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@CocfWZ2GB6c8HU3=m{L`|I+Sd?{wJo{Z|>UW?q-PQGavb zE$eOnyO?(qGr8}v?<+r;e(3oa^zrVej8C6_1NVgU`<=UGpa1{>24YJ`L;(K){{a7> zy{D4^000SaNLh0L01m?d01m?e$8V@)00007bV*G`2jUD55&|V`TP&pj00RU`L_t(I z%WacOh}C5rhM(W}egFT=xz3q!oSeKwBEqB~X4GN|ClJYGHqj7Wa1lWlLI_#~;xtgW za#LZ8785a8O6jVLK_)qE0w)ob(h(AAnsFSD$8+YK|K_$rn{VNC}B?x`rapI z;wb@eb{&;(*k zXu@+%d*j$v=_h6J+jh3{t)Tvq4BgU(N}K%W-(gdV+30>CJ^K{q@d}DVG{qi{?ZB~D z^S$BUrl-3Ob%ukPCc1bUMtM8EC>7uRN}W#AZNiR4codF za4A{zI>YX7jRJwOsq4irG-cMP20M_9yokCKOsRcGTjf3pdos7mk<^ zM(z8T&T-(lto`^UR?Mw1DTyhlaf<8|>>*ExMAs-ROpB&xj|+ZxhMEL(ra*K)hwF8+ ziEC&Y;ofawcP)@@ULrrAQ|h@+YxkWmlqMu=_m-TRF9hA?37TQrIocI4iw*Q}9i6SC z&(;aUZJgY~zfiFCFXiqVOFs(9C4=wm1@n$VUk5MCXh;xAu+l=LfzI9}yj-$Nr$_Sr z;hq4XZ$h{|B>4Ffs!xO2q1bg9u!O(bAbgXE`8s#CWNZ4O0{jh$WL{&SUMK4S0000< KMNUMnLSTX!`8aC; literal 0 HcmV?d00001 diff --git a/public/icons/docs/rxjs/16@2x.png b/public/icons/docs/rxjs/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..a45cd5cb84184a412b136a825e6303f6d4fbcd0b GIT binary patch literal 5084 zcmV<26C>=2P)X+uL$Nkc;*P;zf(X>4Tx07wm;mUmQB*%pV-y*Itk5+Wca^cs2zAksTX z6$DXM^`x7XQc?|s+008spb1j2M!0f022SQPH-!CVp(%f$Br7!UytSOLJ{W@ZFO z_(THK{JlMynW#v{v-a*TfMm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X1O&zW0t^h@bp7u z92BdvDLulE)c*h&&kU)? Date: Tue, 18 Dec 2018 16:37:30 -0500 Subject: [PATCH 35/61] Add license info --- lib/docs/scrapers/pony.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/docs/scrapers/pony.rb b/lib/docs/scrapers/pony.rb index 702bc1ef..5f1bbc04 100644 --- a/lib/docs/scrapers/pony.rb +++ b/lib/docs/scrapers/pony.rb @@ -7,7 +7,9 @@ module Docs html_filters.push 'pony/container', 'pony/entries' options[:attribution] = <<-HTML - © 2018 Pony Developers + © 2016-2018, The Pony Developers
+ © 2014-2015, Causality Ltd.
+ Licensed under the BSD 2-Clause License HTML options[:trailing_slash] = false From 6614375671eeedb7634034a7e36f966b5072610e Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Sun, 11 Aug 2019 19:53:12 +0200 Subject: [PATCH 36/61] scala: finish scraper and filters --- lib/docs/filters/scala/clean_html.rb | 114 ++++++++++++----------- lib/docs/filters/scala/clean_html_210.rb | 32 ------- lib/docs/filters/scala/clean_html_212.rb | 36 ------- lib/docs/filters/scala/entries.rb | 48 +++++++++- lib/docs/scrapers/scala.rb | 98 ++++++++----------- 5 files changed, 145 insertions(+), 183 deletions(-) delete mode 100644 lib/docs/filters/scala/clean_html_210.rb delete mode 100644 lib/docs/filters/scala/clean_html_212.rb diff --git a/lib/docs/filters/scala/clean_html.rb b/lib/docs/filters/scala/clean_html.rb index 95097c80..0320932d 100644 --- a/lib/docs/filters/scala/clean_html.rb +++ b/lib/docs/filters/scala/clean_html.rb @@ -2,97 +2,107 @@ module Docs class Scala class CleanHtmlFilter < Filter def call + @doc = at_css('#content') + always + add_title - if slug == 'index' - root - else - other - end + doc end def always - # remove deprecated sections + # Remove deprecated sections css('.members').each do |members| header = members.at_css('h3') members.remove if header.text.downcase.include? 'deprecate' end - # Some of this is just for 2.12 - # These are things that provide interactive features, which are not supported yet. - css('#subpackage-spacer, #search, #mbrsel, .diagram-btn').remove - css('#footer').remove - css('.toggleContainer').remove + + css('#mbrsel, #footer').remove + + css('.diagram-container').remove + css('.toggleContainer > .toggle').each do |node| + title = node.at_css('span') + next if title.nil? + + content = node.at_css('.hiddenContent') + next if content.nil? + + title.name = 'dt' + + content.remove_attribute('class') + content.remove_attribute('style') + content.name = 'dd' + + attributes = at_css('.attributes') + unless attributes.nil? + title.parent = attributes + content.parent = attributes + end + end signature = at_css('#signature') - signature.replace %Q| -

#{signature.inner_html}

- | + signature.replace "

#{signature.inner_html}

" css('div.members > h3').each do |node| - change_tag! 'h2', node + node.name = 'h2' end css('div.members > ol').each do |list| list.css('li').each do |li| h3 = doc.document.create_element 'h3' + h3['id'] = li['name'].rpartition('#').last unless li['name'].nil? + li.prepend_child h3 li.css('.shortcomment').remove + modifier = li.at_css('.modifier_kind') - modifier.parent = h3 if modifier + modifier.parent = h3 unless modifier.nil? + + kind = li.at_css('.modifier_kind .kind') + kind.content = kind.content + ' ' unless kind.nil? + symbol = li.at_css('.symbol') - symbol.parent = h3 if symbol + symbol.parent = h3 unless symbol.nil? + li.swap li.children end + list.swap list.children end - pres = css('.fullcomment pre, .fullcommenttop pre') - pres.each do |pre| + css('.fullcomment pre, .fullcommenttop pre').each do |pre| pre['data-language'] = 'scala' + pre.content = pre.content end - pres.add_class 'language-scala' - - - - doc - - end - - def root - css('#filter').remove # these are filters to search through the types and packages - css('#library').remove # these are icons at the top - doc - end - def other - # these are sections of the documentation which do not seem useful + # Sections of the documentation which do not seem useful %w(#inheritedMembers #groupedMembers .permalink .hiddenContent .material-icons).each do |selector| css(selector).remove end - # This is the kind of thing we have, class, object, trait - kind = at_css('.modifier_kind .kind').content - # this image replacement doesn't do anything on 2.12 docs - img = at_css('img') - img.replace %Q|#{kind}| unless img.nil? - class_to_add = kind == 'object' ? 'value': 'type' + # Things that are not shown on the site, like deprecated members + css('li[visbl=prt]').remove + end + + def add_title + css('.permalink').remove - # for 2.10, 2.11, the kind class is associated to the body. we have to - # add it somewhere, so we do that with the #definition. - definition = css('#definition') - definition.css('.big_circle').remove - definition.add_class class_to_add + definition = at_css('#definition') + return if definition.nil? - # this is something that is not shown on the site, such as deprecated members - css('li[visbl=prt]').remove + type_full_name = {a: 'Annotation', c: 'Class', t: 'Trait', o: 'Object', p: 'Package'} + type = type_full_name[definition.at_css('.big-circle').text.to_sym] + name = CGI.escapeHTML definition.at_css('h1').text - doc - end + package = definition.at_css('#owner').text rescue '' + package = package + '.' unless name.empty? || package.empty? - private + other = definition.at_css('.morelinks').dup + other_content = other ? "

#{other.to_html}

" : '' - def change_tag!(new_tag, node) - node.replace %Q|<#{new_tag}>#{node.inner_html}| + title_content = root_page? ? 'Package root' : "#{type} #{package}#{name}".strip + title = "

#{title_content}

" + definition.replace title + other_content end end end diff --git a/lib/docs/filters/scala/clean_html_210.rb b/lib/docs/filters/scala/clean_html_210.rb deleted file mode 100644 index 3160f103..00000000 --- a/lib/docs/filters/scala/clean_html_210.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Docs - class Scala - class CleanHtml210Filter < Filter - def call - definition = at_css('#definition') - begin - type = definition.at_css('.img_kind').text - name = definition.at_css('h1').text.strip - - package = definition.at_css('#owner').text rescue '' - package = package + '.' unless name.empty? || name.start_with?('root') - - other = definition.at_css('.morelinks').dup - other_content = other ? "

#{other.to_html}

" : '' - - definition.replace %Q| -

#{type} #{package}#{name}

- #{other_content} - | - end if definition - - doc - end - - private - - def change_tag!(new_tag, node) - node.replace %Q|<#{new_tag}>#{node.inner_html}| - end - end - end -end diff --git a/lib/docs/filters/scala/clean_html_212.rb b/lib/docs/filters/scala/clean_html_212.rb deleted file mode 100644 index 7b4b1fe2..00000000 --- a/lib/docs/filters/scala/clean_html_212.rb +++ /dev/null @@ -1,36 +0,0 @@ -module Docs - class Scala - class CleanHtml212Filter < Filter - def call - css('.permalink').remove - - definition = at_css('#definition') - begin - type_full_name = {c: 'class', t: 'trait', o: 'object', 'p': 'package'} - type = type_full_name[definition.at_css('.big-circle').text.to_sym] - name = definition.at_css('h1').text - - package = definition.at_css('#owner').text rescue '' - package = package + '.' unless name.empty? || package.empty? - - other = definition.at_css('.morelinks').dup - other_content = other ? "

#{other.to_html}

" : '' - - definition.replace %Q| -

#{type} #{package}#{name}

- #{other_content} - | - - end if definition - - doc - end - - private - - def change_tag!(new_tag, node) - node.replace %Q|<#{new_tag}>#{node.inner_html}| - end - end - end -end diff --git a/lib/docs/filters/scala/entries.rb b/lib/docs/filters/scala/entries.rb index d328764c..98eb9781 100644 --- a/lib/docs/filters/scala/entries.rb +++ b/lib/docs/filters/scala/entries.rb @@ -1,14 +1,30 @@ module Docs class Scala class EntriesFilter < Docs::EntriesFilter + REPLACEMENTS = { + '$eq' => '=', + '$colon' => ':', + '$less' => '<', + } + def get_name - # this first condition is mainly for scala 212 docs, which - # have their package listing as index.html if is_package? symbol = at_css('#definition h1') symbol ? symbol.text.gsub(/\W+/, '') : "package" else - slug.split('/').last + name = slug.split('/').last + + # Some objects have inner objects, show ParentObject$.ChildObject$ instead of ParentObject$$ChildObject$ + name = name.gsub('$$', '$.') + + # If a dollar sign is used as separator between two characters, replace it with a dot + name = name.gsub(/([^$.])\$([^$.])/, '\1.\2') + + REPLACEMENTS.each do |key, value| + name = name.gsub(key, value) + end + + name end end @@ -26,6 +42,31 @@ module Docs true end + def additional_entries + entries = [] + + full_name = "#{type}.#{name}".remove('$') + css(".members li[name^=\"#{full_name}\"]").each do |node| + # Ignore packages + kind = node.at_css('.modifier_kind > .kind') + next if !kind.nil? && kind.content == 'package' + + # Ignore deprecated members + next unless node.at_css('.symbol > .name.deprecated').nil? + + id = node['name'].rpartition('#').last + member_name = node.at_css('.name') + + # Ignore members only existing of hashtags, we can't link to that + next if member_name.nil? || member_name.content.strip.remove('#').blank? + + member = "#{name}.#{member_name.content}()" + entries << [member, id] + end + + entries + end + private # For the package name, we use the slug rather than parsing the package @@ -40,7 +81,6 @@ module Docs end def parent_package - name = package_name parent = package_drop_last(package_name.split('.')) parent.empty? ? '_root_' : parent end diff --git a/lib/docs/scrapers/scala.rb b/lib/docs/scrapers/scala.rb index 6b6d6bb2..e831fa84 100644 --- a/lib/docs/scrapers/scala.rb +++ b/lib/docs/scrapers/scala.rb @@ -1,80 +1,60 @@ module Docs class Scala < FileScraper - include FixInternalUrlsBehavior - - self.name = 'scala' + self.name = 'Scala' self.type = 'scala' self.links = { home: 'http://www.scala-lang.org/', code: 'https://github.com/scala/scala' } - version '2.12 Library' do - self.release = '2.12.3' - self.dir = '/Users/Thibaut/DevDocs/Docs/Scala212/api/scala-library' # https://downloads.lightbend.com/scala/2.12.3/scala-docs-2.12.3.zip - self.base_url = 'http://www.scala-lang.org/api/2.12.3/' + options[:container] = '#content-container' + options[:attribution] = <<-HTML + © 2002-2019 EPFL, with contributions from Lightbend. + HTML + + # https://downloads.lightbend.com/scala/2.13.0/scala-docs-2.13.0.zip + # Extract api/scala-library into docs/scala~2.13_library + version '2.13 Library' do + self.release = '2.13.0' + self.base_url = 'https://www.scala-lang.org/api/2.13.0/' self.root_path = 'index.html' - options[:attribution] = <<-HTML - Scala programming documentation. Copyright (c) 2003-2017 EPFL, with contributions from Lightbend. - HTML - html_filters.push 'scala/entries', 'scala/clean_html', 'scala/clean_html_212' + + html_filters.push 'scala/entries', 'scala/clean_html' end - version '2.12 Reflection' do - self.release = '2.12.3' - self.dir = '/Users/Thibaut/DevDocs/Docs/Scala212/api/scala-reflect' # https://downloads.lightbend.com/scala/2.12.3/scala-docs-2.12.3.zip - self.base_url = 'http://www.scala-lang.org/api/2.12.3/scala-reflect/' + # https://downloads.lightbend.com/scala/2.13.0/scala-docs-2.13.0.zip + # Extract api/scala-reflect into docs/scala~2.13_reflection + version '2.13 Reflection' do + self.release = '2.13.0' + self.base_url = 'https://www.scala-lang.org/api/2.13.0/scala-reflect/' self.root_path = 'index.html' - options[:attribution] = <<-HTML - Scala programming documentation. Copyright (c) 2003-2017 EPFL, with contributions from Lightbend. - HTML - html_filters.push 'scala/entries', 'scala/clean_html', 'scala/clean_html_212' + + html_filters.push 'scala/entries', 'scala/clean_html' end - version '2.11 Library' do - self.release = '2.11.8' - self.dir = '/Users/Thibaut/DevDocs/Docs/Scala211/api/scala-library' # https://downloads.lightbend.com/scala/2.11.8/scala-docs-2.11.8.zip - self.base_url = 'http://www.scala-lang.org/api/2.11.8/' - self.root_path = 'package.html' - options[:skip_patterns] = [/^index.html/, /index\/index-/] - options[:attribution] = <<-HTML - Scala programming documentation. Copyright (c) 2003-2016 EPFL, with contributions from Lightbend. - HTML - html_filters.push 'scala/entries', 'scala/clean_html', 'scala/clean_html_210' + # https://downloads.lightbend.com/scala/2.12.6/scala-docs-2.12.6.zip + # Extract api/scala-library into docs/scala~2.12_library + version '2.12 Library' do + self.release = '2.12.6' + self.base_url = 'https://www.scala-lang.org/api/2.12.6/' + self.root_path = 'index.html' + + html_filters.push 'scala/entries', 'scala/clean_html' end - version '2.11 Reflection' do - self.release = '2.11.8' - self.dir = '/Users/Thibaut/DevDocs/Docs/Scala211/api/scala-reflect' # https://downloads.lightbend.com/scala/2.11.8/scala-docs-2.11.8.zip - self.base_url = 'http://www.scala-lang.org/api/2.11.8/scala-reflect/' - self.root_path = 'package.html' - options[:skip_patterns] = [/^index.html/, /index\/index-/] - options[:attribution] = <<-HTML - Scala programming documentation. Copyright (c) 2003-2016 EPFL, with contributions from Lightbend. - HTML - html_filters.push 'scala/entries', 'scala/clean_html', 'scala/clean_html_210' + # https://downloads.lightbend.com/scala/2.12.6/scala-docs-2.12.6.zip + # Extract api/scala-reflect into docs/scala~2.12_reflection + version '2.12 Reflection' do + self.release = '2.12.6' + self.base_url = 'https://www.scala-lang.org/api/2.12.6/scala-reflect/' + self.root_path = 'index.html' + + html_filters.push 'scala/entries', 'scala/clean_html' end - version '2.10' do - self.release = '2.10.6' - self.dir = '/Users/Thibaut/DevDocs/Docs/Scala210' # https://downloads.lightbend.com/scala/2.10.6/scala-docs-2.10.6.zip - self.base_url = 'http://www.scala-lang.org/api/2.10.6/' - self.root_path = 'package.html' - options[:skip_patterns] = [/^index.html/, /index\/index-/] - options[:attribution] = <<-HTML - Scala programming documentation. Copyright (c) 2003-2013 EPFL, with contributions from Typesafe. - HTML - html_filters.push 'scala/entries', 'scala/clean_html', 'scala/clean_html_210' + def get_latest_version(opts) + doc = fetch_doc('https://www.scala-lang.org/api/current/', opts) + doc.at_css('#doc-version').content end end end From e566036f54231232769a5288088b8452db2d6106 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Sun, 11 Aug 2019 21:26:41 +0200 Subject: [PATCH 37/61] scala: fix license and update entries filter --- .../javascripts/templates/pages/about_tmpl.coffee | 6 ++++++ lib/docs/filters/scala/entries.rb | 6 ++---- lib/docs/scrapers/scala.rb | 15 ++++++++------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 0981b9a3..81e1e5b7 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -637,6 +637,12 @@ credits = [ 'MIT', 'https://raw.githubusercontent.com/sass/sass/stable/MIT-LICENSE' ], [ + 'Scala', + '2002-2019 EPFL, with contributions from Lightbend', + 'Apache', + 'https://raw.githubusercontent.com/scala/scala-lang/master/license.md' + ], + [ 'scikit-image', '2011 the scikit-image team', 'BSD', diff --git a/lib/docs/filters/scala/entries.rb b/lib/docs/filters/scala/entries.rb index 98eb9781..5eff47fb 100644 --- a/lib/docs/filters/scala/entries.rb +++ b/lib/docs/filters/scala/entries.rb @@ -17,14 +17,12 @@ module Docs # Some objects have inner objects, show ParentObject$.ChildObject$ instead of ParentObject$$ChildObject$ name = name.gsub('$$', '$.') - # If a dollar sign is used as separator between two characters, replace it with a dot - name = name.gsub(/([^$.])\$([^$.])/, '\1.\2') - REPLACEMENTS.each do |key, value| name = name.gsub(key, value) end - name + # If a dollar sign is used as separator between two characters, replace it with a dot + name.gsub(/([^$.])\$([^$.])/, '\1.\2') end end diff --git a/lib/docs/scrapers/scala.rb b/lib/docs/scrapers/scala.rb index e831fa84..dc268960 100644 --- a/lib/docs/scrapers/scala.rb +++ b/lib/docs/scrapers/scala.rb @@ -9,7 +9,8 @@ module Docs options[:container] = '#content-container' options[:attribution] = <<-HTML - © 2002-2019 EPFL, with contributions from Lightbend. + © 2002-2019 EPFL, with contributions from Lightbend.
+ Licensed under the Apache License, Version 2.0. HTML # https://downloads.lightbend.com/scala/2.13.0/scala-docs-2.13.0.zip @@ -32,21 +33,21 @@ module Docs html_filters.push 'scala/entries', 'scala/clean_html' end - # https://downloads.lightbend.com/scala/2.12.6/scala-docs-2.12.6.zip + # https://downloads.lightbend.com/scala/2.12.9/scala-docs-2.12.9.zip # Extract api/scala-library into docs/scala~2.12_library version '2.12 Library' do - self.release = '2.12.6' - self.base_url = 'https://www.scala-lang.org/api/2.12.6/' + self.release = '2.12.9' + self.base_url = 'https://www.scala-lang.org/api/2.12.9/' self.root_path = 'index.html' html_filters.push 'scala/entries', 'scala/clean_html' end - # https://downloads.lightbend.com/scala/2.12.6/scala-docs-2.12.6.zip + # https://downloads.lightbend.com/scala/2.12.9/scala-docs-2.12.9.zip # Extract api/scala-reflect into docs/scala~2.12_reflection version '2.12 Reflection' do - self.release = '2.12.6' - self.base_url = 'https://www.scala-lang.org/api/2.12.6/scala-reflect/' + self.release = '2.12.9' + self.base_url = 'https://www.scala-lang.org/api/2.12.9/scala-reflect/' self.root_path = 'index.html' html_filters.push 'scala/entries', 'scala/clean_html' From 78168366cf67c0fc3dbff9e6c64425fbc74a5a1e Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Mon, 12 Aug 2019 00:32:37 +0200 Subject: [PATCH 38/61] wordpress: finish scraper and filters --- .../templates/pages/about_tmpl.coffee | 6 ++++++ lib/docs/filters/wordpress/clean_html.rb | 9 ++++++++- lib/docs/filters/wordpress/entries.rb | 12 +----------- lib/docs/scrapers/wordpress.rb | 10 +++++----- public/icons/docs/wordpress/16.png | Bin 958 -> 1513 bytes public/icons/docs/wordpress/16@2x.png | Bin 3284 -> 1703 bytes 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 81e1e5b7..37d14eea 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -728,6 +728,12 @@ credits = [ 'CC BY', 'https://creativecommons.org/licenses/by/4.0/' ], [ + 'Wordpress', + '2003-2019 WordPress Foundation', + 'GPLv2+', + 'https://wordpress.org/about/license/' + ], + [ 'Yarn', '2016-present Yarn Contributors', 'BSD', diff --git a/lib/docs/filters/wordpress/clean_html.rb b/lib/docs/filters/wordpress/clean_html.rb index 42ca5f29..32cf3b3f 100644 --- a/lib/docs/filters/wordpress/clean_html.rb +++ b/lib/docs/filters/wordpress/clean_html.rb @@ -7,12 +7,19 @@ module Docs return doc end + article = at_css('article[id^="post-"]') + @doc = at_css('article[id^="post-"]') unless article.nil? + css('hr', '.screen-reader-text', '.table-of-contents', '.anchor', '.toc-jump', '.source-code-links', '.user-notes', '.show-more', '.hide-more').remove br = //i + header = at_css('h1') + header.content = header.content.strip + doc.prepend_child header + # Add PHP code highlighting css('pre').each do |node| node['data-language'] = 'php' @@ -29,4 +36,4 @@ module Docs end end end -end \ No newline at end of file +end diff --git a/lib/docs/filters/wordpress/entries.rb b/lib/docs/filters/wordpress/entries.rb index bfcd10b3..ba539d67 100644 --- a/lib/docs/filters/wordpress/entries.rb +++ b/lib/docs/filters/wordpress/entries.rb @@ -1,12 +1,6 @@ module Docs class Wordpress class EntriesFilter < Docs::EntriesFilter - def breadcrumbs - @breadcrumbs ||= css('.breadcrumbs .trail-inner a') - .map(&:content) - .map(&:strip) - end - def get_name at_css('.breadcrumbs .trail-end').content end @@ -18,12 +12,8 @@ module Docs 'Hooks' elsif subpath.starts_with?('functions') 'Functions' - elsif breadcrumbs.size > 1 - breadcrumbs.drop(1).join(': ') - else - at_css('.breadcrumbs .trail-end').content end end end end -end \ No newline at end of file +end diff --git a/lib/docs/scrapers/wordpress.rb b/lib/docs/scrapers/wordpress.rb index 472013ac..58e42cb8 100644 --- a/lib/docs/scrapers/wordpress.rb +++ b/lib/docs/scrapers/wordpress.rb @@ -2,7 +2,7 @@ module Docs class Wordpress < UrlScraper self.name = 'WordPress' self.type = 'wordpress' - self.release = '4.9.4' + self.release = '5.2.2' self.base_url = 'https://developer.wordpress.org/reference/' self.initial_paths = %w( functions/ @@ -15,10 +15,10 @@ module Docs code: 'https://github.com/WordPress/WordPress' } - html_filters.push 'wordpress/clean_html', 'wordpress/entries' + html_filters.push 'wordpress/entries', 'wordpress/clean_html' options[:container] = '#content-area' - options[:trailing_slash] = true + options[:trailing_slash] = false options[:only_patterns] = [ /\Afunctions\//, /\Ahooks\//, @@ -32,8 +32,8 @@ module Docs ] options[:attribution] = <<-HTML - © 2003–2018 WordPress Foundation
+ © 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License. HTML end -end \ No newline at end of file +end diff --git a/public/icons/docs/wordpress/16.png b/public/icons/docs/wordpress/16.png index 13f3fa64dd7aee3835861516bd4a5e51de297ac7..0b3dc1cd28a48509d8df1e745359bc9fad981b7c 100644 GIT binary patch literal 1513 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstU$g(vPY0F z14ES>14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>JBa>64!Xr+uTYzM8|MjeJL1pfd3FZ$%42Qbw>E(!7j^RP8GVfOb# z#xSQsJ29Sp7vy;NZ{$*NFD$M~Y5$wp@y*?(v^Zz(7G{UfOPxNK*3Hhznf+Fe@5Cft z!ILFN=j0UCmbZRxNo#*y__402Ane0oZpS_I4{jkHBI2M=WH=O_QxDN3=(Xh{R<^0mk?LfLta?DQOv5Ie7&|NoGc%k*rF}DynMg8k$<#I=XBu z4D5RP28KqDfxy_r)XbcN!NStY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SB0Ue7&R0yn_R*d@4c2e(bu0P z&3}(f%dgEu&y19sJNEU}*vV~{KtTqkrA6qC>rrE=gOrn5OQOSW3LO9TW`uD`bCwC! zSzyETQ}=c>oc&H6rh`tK_ucju-A>2LHb(LUo`ioHonE}{3%l7c1uuMf@%ZHj&xeWi z4xya&3&B|7-0iAxbsiB7CRZVyu&5(jQ7rkmka{+mo*cTC_6<)`h_z&jkoix50RVA1 VT=~ZhHl+Xn002ovPDHLkV1hBW(}Ms2 diff --git a/public/icons/docs/wordpress/16@2x.png b/public/icons/docs/wordpress/16@2x.png index dd7147c74e1ad91ffb33d0f9ed0c4c6fd73ad031..9de430fec4074445ff3c114ebcd8166f51341c7e 100644 GIT binary patch delta 1687 zcmV;I259-z8K(`9B!2{FK}|sb0I`n?{9y$E001CkNK#Dz0D2|>0Dy!50Qvv`0D$NK z0Cg|`0P0`>06Lfe02gqax=}m;000JJOGiWi{{a60|De66lK=n!32#P5a{vGU2mk;8 z2mt<|zN-KL00(qQO+^Re2n+xi22I)unE(I)33hNnX8-^IFn<6505AZ~?u=Ie00n_b zL_t(o!^PKYjFwjs2k_s#tSl8QMky4QOGBxmptTUBT4)T?wUuI2A~A*-Yho0mF}fyeM$?7<;Cnd%cU9SiYl^x;9=h6gZuu0Z}HfW=oYS4x3t_#m#u7JM%vhDs?D z(m@|ynA?tLa0epdpQV&}cso|&SJ;Td5ne z26xmT#x<}vao`qwCn9de8*nRDCC|@QCSnQt@o+@kp(g6bup5VF%$noSf&Dd$Tbyse zoe{CAlz;LLd>0EYz;RnnV-Sx+gxivu4Vacbja#&InTQB{A~$Zpjrazp{Flz*H+UC@ z26t{Zy>GTW{k2#S5!0BCzye^sdfItg!p2NPiRl2USD!O z4tq)|$0BO0h#ty_VSEYSN}u=lL`0NQ)~TiTuz#AEpA#{vl!9UvLoA>|@;$L_wjZDE$6Op!T z!CNvQn2LMws+P`)MD6Dh(d5};3}YlIUf)sc`mu=k6W)WRjfGOmF}0C&%aXRUk&%%j z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Z4?iiCOXc2sBxt6U zy5ErCmg%iK3lp+_nYhxA=FGkCFPM_I4;Vepr7REMhQE;Y+n;hX>m7)Z7bV8Vs5dVy zDO65%To&4AJCU3y{2KY`dAt18=zzNLn!hxNKqpGYiAw96e;PLe*$qZq9wEGHnS2d{ zR1|ad3NZ7_*igB`aT@ym1mul1||jVtZ=vlAVpnKI1ODwDPOr4ZW+z+m%~N z=NzrdjT+bVPPAp+T|X1~e!SGm1^eRSF~#gI$*6qS>+-w2K)*#en%Mp8u)h`VFGG!y zLgLDtV8qH(TdJeRlU(iKXTSf|8{-t9>`KKrT_>|ycg@8u1j&ssHtgShQP9r6!7gzWPl+WDp zURpm5&DZe-P*dBecbX;|Nd6N=nhAHur^(UWW|H)lgo-2SOw*^{Uqeb>*4^&M_2sMN tt53>4{%xmS%S_yChvl^|A7`O_LZHMPRuh>`*WdilFvD1(OH5s({|%@}uC4$8 From 934cee4ae2246bd8a888428d7569b323539007f6 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Mon, 12 Aug 2019 00:44:53 +0200 Subject: [PATCH 39/61] wordpress: implement get_latest_version --- lib/docs/scrapers/wordpress.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/docs/scrapers/wordpress.rb b/lib/docs/scrapers/wordpress.rb index 58e42cb8..b1bf46c9 100644 --- a/lib/docs/scrapers/wordpress.rb +++ b/lib/docs/scrapers/wordpress.rb @@ -35,5 +35,10 @@ module Docs © 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License. HTML + + def get_latest_version(opts) + doc = fetch_doc('https://wordpress.org/download/releases/', opts) + doc.at_css('.releases.latest td').content + end end end From 11234ecb454ff837ca1b3fa18ae338cb0793df54 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Mon, 12 Aug 2019 02:02:16 +0200 Subject: [PATCH 40/61] cypress: finish scraper and filters --- .../templates/pages/about_tmpl.coffee | 6 ++++ lib/docs/filters/cypress/clean_html.rb | 15 +++++++-- lib/docs/filters/cypress/entries.rb | 7 ---- lib/docs/scrapers/cypress.rb | 33 ++++++++++--------- 4 files changed, 36 insertions(+), 25 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 37d14eea..5e9dc6cc 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -202,6 +202,12 @@ credits = [ 'Apache', 'https://raw.githubusercontent.com/crystal-lang/crystal/master/LICENSE' ], [ + 'Cypress', + '2017 Cypress.io', + 'MIT', + 'https://raw.githubusercontent.com/cypress-io/cypress-documentation/develop/LICENSE.md' + ], + [ 'D', '1999-2018 The D Language Foundation', 'Boost', diff --git a/lib/docs/filters/cypress/clean_html.rb b/lib/docs/filters/cypress/clean_html.rb index 6a36d24c..9b93b313 100644 --- a/lib/docs/filters/cypress/clean_html.rb +++ b/lib/docs/filters/cypress/clean_html.rb @@ -4,12 +4,21 @@ module Docs class Cypress class CleanHtmlFilter < Filter def call + article_div = at_css('#article > div') + @doc = article_div unless article_div.nil? + + header = at_css('h1.article-title') + doc.prepend_child(header) unless header.nil? + css('.article-edit-link').remove - css('#sidebar').remove - css('article footer').remove - css('#article-toc').remove + css('.article-footer').remove css('.article-footer-updated').remove + css('pre').each do |node| + node.content = node.content + node['data-language'] = 'javascript' + end + doc end end diff --git a/lib/docs/filters/cypress/entries.rb b/lib/docs/filters/cypress/entries.rb index a854acd7..664f4da7 100644 --- a/lib/docs/filters/cypress/entries.rb +++ b/lib/docs/filters/cypress/entries.rb @@ -8,7 +8,6 @@ module Docs core-concepts cypress-api events - examples getting-started guides overview @@ -30,12 +29,6 @@ module Docs end end end - - def additional_entries - css('.sidebar-li > a').map do |node| - [node['href']] - end - end end end end diff --git a/lib/docs/scrapers/cypress.rb b/lib/docs/scrapers/cypress.rb index e5433b22..56380630 100644 --- a/lib/docs/scrapers/cypress.rb +++ b/lib/docs/scrapers/cypress.rb @@ -2,32 +2,35 @@ module Docs class Cypress < UrlScraper - # Follow the instructions on https://github.com/cypress-io/cypress-documentation/blob/develop/CONTRIBUTING.md - # to run the cypress documentation server locally in the following URL: - # self.base_url = 'http://localhost:2222' - self.base_url = 'https://docs.cypress.io' - self.name = 'Cypress' self.type = 'cypress' + self.release = '3.4.1' + self.base_url = 'https://docs.cypress.io' self.root_path = '/api/api/table-of-contents.html' + self.links = { + home: 'https://www.cypress.io/', + code: 'https://github.com/cypress-io/cypress', + } - html_filters.push 'cypress/clean_html', 'cypress/entries' + html_filters.push 'cypress/entries', 'cypress/clean_html' - options[:root_title] = 'Cypress' options[:container] = '#content' - + options[:max_image_size] = 300_000 options[:include_default_entry] = true - options[:skip_link] = lambda do |link| + options[:skip_patterns] = [/examples\//] + options[:skip_link] = ->(link) { href = link.attr(:href) - - EntriesFilter::SECTIONS.none? { |section| href.match?("/#{section}/") } - end + href.nil? ? true : EntriesFilter::SECTIONS.none? { |section| href.match?("/#{section}/") } + } options[:attribution] = <<-HTML - © 2018 Cypress.io - - Licensed under the - MIT License. + © 2017 Cypress.io
+ Licensed under the MIT License. HTML + + def get_latest_version(opts) + get_latest_github_release('cypress-io', 'cypress', opts) + end end end From 991ee5ab7fe85c554acc733da7d3cc18fbad2905 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Mon, 12 Aug 2019 02:07:52 +0200 Subject: [PATCH 41/61] cypress: update icon source --- public/icons/docs/cypress/SOURCE | 1 + public/icons/docs/cypress/SOURCE.ico | Bin 32038 -> 0 bytes 2 files changed, 1 insertion(+) create mode 100644 public/icons/docs/cypress/SOURCE delete mode 100644 public/icons/docs/cypress/SOURCE.ico diff --git a/public/icons/docs/cypress/SOURCE b/public/icons/docs/cypress/SOURCE new file mode 100644 index 00000000..3ea99830 --- /dev/null +++ b/public/icons/docs/cypress/SOURCE @@ -0,0 +1 @@ +https://github.com/cypress-io/cypress-documentation/raw/develop/themes/cypress/source/img/favicon.ico diff --git a/public/icons/docs/cypress/SOURCE.ico b/public/icons/docs/cypress/SOURCE.ico deleted file mode 100644 index 45749a770368dbe9f806622df654187b7cd93144..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32038 zcmeI4cg$5q7Qi2I&4xdSYc~6bAw-QK!GeO=*Mg$PhS+fJh`l#l5u*ZjL`3Yk_J|!D zBK8tQMZ~D6h=^YhQ4tXl5fO3r{Dyb#o_D{QTi*Bh_}tw|&YO8Nr_P;vX6~(2+ExBk z`O9A_64tAn^ruQ?cT(%E{QscjKPGwIx>f&ou2c^GTcy&o=gR+GcBxc;->y>WB7b4A zoy=z4$irD7B<{)!|npN2+R;zRt3`Jb+@=SEoJQmMhmPEa1o#koc00Q*FrRp zJo1Q}K7G0yIB=ll32wrp%F~u7=|c`V#69`slkWH5e|HyLa6ys}4LV4Sy?5eoef8B>ZljGhQXbG~UAZ1Tdbp22{@CL!UcA`L z8!%vi#~nFxq+79Kg)ckou)~y|SnJshA3ofdgDd$CnJVjp4?b{{CQWkRfB(I^>#n;j zJLj zLrWdFZr!@Mci(;2>pFk_d|zLK2M>0?{`#w%GG&V5yKle!*3FtVOaJ>eDfIsNb?w^K zopHt)?&_dd0O(Ghq?Zf$_AK#e%1VN7KVlATsJ%e2{YH4! zv|qymJ-jUuI?BLF+CH=vq)gi+b-Szzq=WspQgN;&z&Nv>Ku-Z3XNLH(OEOHbI%cIs z&kh2I3;au9vcP-+?8cUP0+R(O1E)h4uQFxAt8eHu>TeN7AA0uwK;RZjh zMQGs}ou|-A%CQ@~LbAa-^UO1a^gm(g(xr~^DZ&HZ!FrJV_5!8roO$D!XP$9C{P07f z1asPuAwyz1Afs7(ki206F`C?b#_9X-zdzA|v3>X5caPBx6U1bE61nuTmb7y(hqhqD zLk~R^laH*VZ%UfJ+6;H+op*M3-g&2+F=K{rW6ZP6IhS94x$EA&do%n|qefZrj`^PX zEyNp{)Pcln2{ap9PCM;1w`9qZ8h-ZA=bwM>Hr;g78r~m%_@PDd>61@BxdzARf=pyH zUe@3+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NYiophfpzsROZnmEV6}MfE!Y z-Ss)PB(B!MAE_OnYeQ_e^(H(=2xRrOwoo?0>fGqG*w4Jce9{(dwK||vUE_S&IubdZ z1tztjIzX4g_nXVw8^afwtd&>ieOY7|TGPgCXlcI4XU{ZPpsu~M(AhRzG>t4|X6|KL zYFin4(WQd`K9r9HirP^Y58lWK?%&JkyDD)-Ki+?4t|;VJ7QC!_fCs$V^!v}T`V_r8 p3iK7YNPu~HiohHJd+tn{Jj%cU7n+VSzKzOHe-GgQ|NpmY;NLnW=MDe> From 22094f7dcf2e00823300a3e48e19b5a94bbf6ff1 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Mon, 12 Aug 2019 13:10:41 +0200 Subject: [PATCH 42/61] Fix #1049 --- assets/javascripts/lib/page.coffee | 4 ++-- assets/javascripts/views/layout/document.coffee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/javascripts/lib/page.coffee b/assets/javascripts/lib/page.coffee index ba2f2647..ea20000b 100644 --- a/assets/javascripts/lib/page.coffee +++ b/assets/javascripts/lib/page.coffee @@ -208,12 +208,12 @@ track = -> # Only ask for consent once per browser session Cookies.set('analyticsConsentAsked', '1') - new app.views.Notif 'AnalyticsConsent', autoHide: null + new app.views.Notif 'AnalyticsConsent', autoHide: false return @resetAnalytics = -> for cookie in document.cookie.split(/;\s?/) name = cookie.split('=')[0] - if name[0] == '_' + if name[0] == '_' && name[1] != '_' Cookies.expire(name) return diff --git a/assets/javascripts/views/layout/document.coffee b/assets/javascripts/views/layout/document.coffee index 597dfe37..a10d0b3c 100644 --- a/assets/javascripts/views/layout/document.coffee +++ b/assets/javascripts/views/layout/document.coffee @@ -80,6 +80,6 @@ class app.views.Document extends app.View when 'reboot' then app.reboot() when 'hard-reload' then app.reload() when 'reset' then app.reset() if confirm('Are you sure you want to reset DevDocs?') - when 'accept-analytics' then Cookies.set('analyticsConsent', '1') && app.reboot() - when 'decline-analytics' then Cookies.set('analyticsConsent', '0') && app.reboot() + when 'accept-analytics' then Cookies.set('analyticsConsent', '1', expires: 1e8) && app.reboot() + when 'decline-analytics' then Cookies.set('analyticsConsent', '0', expires: 1e8) && app.reboot() return From f25c62ede416593a63bc81fbcb9b2efd476dbacd Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Mon, 12 Aug 2019 13:21:15 +0200 Subject: [PATCH 43/61] Revert autoHide change for consistency --- assets/javascripts/lib/page.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/javascripts/lib/page.coffee b/assets/javascripts/lib/page.coffee index ea20000b..91d73432 100644 --- a/assets/javascripts/lib/page.coffee +++ b/assets/javascripts/lib/page.coffee @@ -208,7 +208,7 @@ track = -> # Only ask for consent once per browser session Cookies.set('analyticsConsentAsked', '1') - new app.views.Notif 'AnalyticsConsent', autoHide: false + new app.views.Notif 'AnalyticsConsent', autoHide: null return @resetAnalytics = -> From c5136b1af67b3e1f01869c3b7ba8b5ca5ec41462 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 11:57:56 +0200 Subject: [PATCH 44/61] Update contributing guidelines on updating docs --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 99fd8584..0f84b7c0 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -58,9 +58,9 @@ In addition to the [guidelines for contributing code](#contributing-code-and-fea ## Updating existing documentations -Please don't submit a pull request updating the version number of a documentation, unless a change is required in the scraper and you've verified that it works. +Please don't submit a pull request updating only version number and/or the attribution of a documentation. Do feel free to create a pull request if a bigger change is required in the scraper and you've verified that it works. If you do make a pull request and you happen to update `options[:attribution]`, make sure to also update the documentation's entry in the array in [`assets/javascripts/templates/pages/about_tmpl.coffee`](../assets/javascripts/templates/pages/about_tmpl.coffee) with correct license information. -To ask that an existing documentation be updated, first check the last two [documentation versions reports](https://github.com/freeCodeCamp/devdocs/issues?utf8=%E2%9C%93&q=Documentation+versions+report+is%3Aissue+author%3Adevdocs-bot+sort%3Acreated-desc). Only create an issue if the documentation has been wrongly marked as up-to-date. +To ask that an existing documentation be updated, first check the last [documentation versions reports](https://github.com/freeCodeCamp/devdocs/issues?utf8=%E2%9C%93&q=Documentation+versions+report+is%3Aissue+author%3Adevdocs-bot+sort%3Acreated-desc). Only create an issue if the documentation has been wrongly marked as up-to-date. ## Coding conventions From aae955b446886610e3b11bcec448706640e1f34a Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 12:35:35 +0200 Subject: [PATCH 45/61] Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0f84b7c0..d5b62836 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -58,7 +58,7 @@ In addition to the [guidelines for contributing code](#contributing-code-and-fea ## Updating existing documentations -Please don't submit a pull request updating only version number and/or the attribution of a documentation. Do feel free to create a pull request if a bigger change is required in the scraper and you've verified that it works. If you do make a pull request and you happen to update `options[:attribution]`, make sure to also update the documentation's entry in the array in [`assets/javascripts/templates/pages/about_tmpl.coffee`](../assets/javascripts/templates/pages/about_tmpl.coffee) with correct license information. +Please don't submit a pull request updating only the version number and/or the attribution of a documentation. Do feel free to create a pull request if a bigger change is required in the scraper and you've verified that it works. If you do make a pull request and you happen to update `options[:attribution]`, make sure to also update the documentation's entry in the array in [`assets/javascripts/templates/pages/about_tmpl.coffee`](../assets/javascripts/templates/pages/about_tmpl.coffee) with correct license information. To ask that an existing documentation be updated, first check the last [documentation versions reports](https://github.com/freeCodeCamp/devdocs/issues?utf8=%E2%9C%93&q=Documentation+versions+report+is%3Aissue+author%3Adevdocs-bot+sort%3Acreated-desc). Only create an issue if the documentation has been wrongly marked as up-to-date. From 35a9d83fb1ae6bb76c4cb9d621a19c758a205ac6 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 12:47:03 +0200 Subject: [PATCH 46/61] Revert CONTRIBUTING.md changes --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d5b62836..151fdb48 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -58,7 +58,7 @@ In addition to the [guidelines for contributing code](#contributing-code-and-fea ## Updating existing documentations -Please don't submit a pull request updating only the version number and/or the attribution of a documentation. Do feel free to create a pull request if a bigger change is required in the scraper and you've verified that it works. If you do make a pull request and you happen to update `options[:attribution]`, make sure to also update the documentation's entry in the array in [`assets/javascripts/templates/pages/about_tmpl.coffee`](../assets/javascripts/templates/pages/about_tmpl.coffee) with correct license information. +Please don't submit a pull request updating the version number of a documentation, unless a change is required in the scraper and you've verified that it works. To ask that an existing documentation be updated, first check the last [documentation versions reports](https://github.com/freeCodeCamp/devdocs/issues?utf8=%E2%9C%93&q=Documentation+versions+report+is%3Aissue+author%3Adevdocs-bot+sort%3Acreated-desc). Only create an issue if the documentation has been wrongly marked as up-to-date. From de88cc251871343b77433c17dbbd5f0265ce1d7f Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 14:32:04 +0200 Subject: [PATCH 47/61] Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 151fdb48..0c53b8e9 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -58,9 +58,9 @@ In addition to the [guidelines for contributing code](#contributing-code-and-fea ## Updating existing documentations -Please don't submit a pull request updating the version number of a documentation, unless a change is required in the scraper and you've verified that it works. +Please don't submit a pull request updating only the version number and/or the attribution of a documentation. Do submit a pull request if a bigger change is required in the scraper and you've verified that it works. -To ask that an existing documentation be updated, first check the last [documentation versions reports](https://github.com/freeCodeCamp/devdocs/issues?utf8=%E2%9C%93&q=Documentation+versions+report+is%3Aissue+author%3Adevdocs-bot+sort%3Acreated-desc). Only create an issue if the documentation has been wrongly marked as up-to-date. +To ask that an existing documentation be updated, first check the latest [documentation versions report](https://github.com/freeCodeCamp/devdocs/issues?utf8=%E2%9C%93&q=Documentation+versions+report+is%3Aissue+author%3Adevdocs-bot+sort%3Acreated-desc). Only create an issue if the documentation has been wrongly marked as up-to-date. ## Coding conventions From f3d5a6eae324c6a97e8d5e849db1d98fb0f6f69c Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 16:32:40 +0200 Subject: [PATCH 48/61] salt_stack: finish scraper and filters --- .../templates/pages/about_tmpl.coffee | 6 ++++ lib/docs/filters/salt_stack/clean_html.rb | 11 +++++++ lib/docs/filters/salt_stack/entries.rb | 13 +++++++- lib/docs/scrapers/salt_stack.rb | 32 +++++++++++++------ 4 files changed, 51 insertions(+), 11 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 5e9dc6cc..dea5c4da 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -638,6 +638,12 @@ credits = [ 'MIT', 'https://raw.githubusercontent.com/rust-lang/rust/master/LICENSE-MIT' ], [ + 'Salt Stack', + '2019 SaltStack', + 'Apache', + 'https://raw.githubusercontent.com/saltstack/salt/develop/LICENSE' + ], + [ 'Sass', '2006-2016 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein', 'MIT', diff --git a/lib/docs/filters/salt_stack/clean_html.rb b/lib/docs/filters/salt_stack/clean_html.rb index 0f084519..8c5cb6ca 100644 --- a/lib/docs/filters/salt_stack/clean_html.rb +++ b/lib/docs/filters/salt_stack/clean_html.rb @@ -4,6 +4,17 @@ module Docs def call css('.headerlink').remove + css('div[class^="highlight-"]').each do |node| + node.name = 'pre' + node['data-language'] = node['class'].scan(/highlight-([a-z]+)/i)[0][0] + node.content = node.content.strip + end + + css('.function > dt').each do |node| + node.name = 'h3' + node.content = node.content + end + doc end end diff --git a/lib/docs/filters/salt_stack/entries.rb b/lib/docs/filters/salt_stack/entries.rb index 23b8f46f..d346fa29 100644 --- a/lib/docs/filters/salt_stack/entries.rb +++ b/lib/docs/filters/salt_stack/entries.rb @@ -16,12 +16,23 @@ module Docs end def get_type - slug.split('/', 2).first + slug.split('/', 3)[1] end def include_default_entry? slug.split('/').last.start_with? 'salt' end + + def additional_entries + entries = [] + + css('.function > h3').each do |node| + name = node.content.remove('salt.').split('(')[0] + '()' + entries << [name, node['id']] + end + + entries + end end end end diff --git a/lib/docs/scrapers/salt_stack.rb b/lib/docs/scrapers/salt_stack.rb index ae4e47f3..390dd7bb 100644 --- a/lib/docs/scrapers/salt_stack.rb +++ b/lib/docs/scrapers/salt_stack.rb @@ -1,8 +1,19 @@ module Docs - class SaltStack < UrlScraper - self.type = 'salt_stack' - self.release = '2018.3.2' - self.base_url = 'https://docs.saltstack.com/en/latest/ref/' + # The official documentation website is heavily rate-limited + # + # The documentation can be generated like this (replace 2019.2 with the correct tag): + # $ git clone https://github.com/saltstack/salt.git --branch 2019.2 --depth 1 + # $ cd salt/doc + # $ pip install sphinx + # $ make html + # + # The generated html can be found in salt/doc/_build/html + class SaltStack < FileScraper + self.type = 'simple' + self.slug = 'salt_stack' + self.release = '2019.2.0' + self.base_url = 'https://docs.saltstack.com/en/latest/' + self.root_path = 'ref/index.html' self.links = { home: 'https://www.saltstack.com/', code: 'https://github.com/saltstack/salt' @@ -10,15 +21,16 @@ module Docs html_filters.push 'salt_stack/clean_html', 'salt_stack/entries' - options[:only_patterns] = [ - %r{^[^/]+/all/} - ] - - options[:container] = '.body-content' + options[:only_patterns] = [/all\//] + options[:container] = '.body-content > .section' options[:attribution] = <<-HTML - © 2018 SaltStack.
+ © 2019 SaltStack.
Licensed under the Apache License, Version 2.0. HTML + + def get_latest_version(opts) + get_latest_github_release('saltstack', 'salt', opts) + end end end From da1200dbb4da5943ba7b7254abbaffca7604bc33 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 16:42:35 +0200 Subject: [PATCH 49/61] salt_stack: simplify root page --- lib/docs/filters/salt_stack/clean_html.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/docs/filters/salt_stack/clean_html.rb b/lib/docs/filters/salt_stack/clean_html.rb index 8c5cb6ca..37e2a3b6 100644 --- a/lib/docs/filters/salt_stack/clean_html.rb +++ b/lib/docs/filters/salt_stack/clean_html.rb @@ -2,6 +2,11 @@ module Docs class SaltStack class CleanHtmlFilter < Filter def call + if root_page? + doc.inner_html = '

SaltStack

' + return doc + end + css('.headerlink').remove css('div[class^="highlight-"]').each do |node| From 5dec35b914fc104f16a08df7d98e7800f8e5c3ed Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 17:13:28 +0200 Subject: [PATCH 50/61] saltstack: salt_stack -> saltstack --- lib/docs/scrapers/salt_stack.rb | 2 +- public/icons/docs/{salt_stack => saltstack}/16.png | Bin .../icons/docs/{salt_stack => saltstack}/16@2x.png | Bin public/icons/docs/{salt_stack => saltstack}/SOURCE | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename public/icons/docs/{salt_stack => saltstack}/16.png (100%) rename public/icons/docs/{salt_stack => saltstack}/16@2x.png (100%) rename public/icons/docs/{salt_stack => saltstack}/SOURCE (100%) diff --git a/lib/docs/scrapers/salt_stack.rb b/lib/docs/scrapers/salt_stack.rb index 390dd7bb..3af77753 100644 --- a/lib/docs/scrapers/salt_stack.rb +++ b/lib/docs/scrapers/salt_stack.rb @@ -10,7 +10,7 @@ module Docs # The generated html can be found in salt/doc/_build/html class SaltStack < FileScraper self.type = 'simple' - self.slug = 'salt_stack' + self.slug = 'saltstack' self.release = '2019.2.0' self.base_url = 'https://docs.saltstack.com/en/latest/' self.root_path = 'ref/index.html' diff --git a/public/icons/docs/salt_stack/16.png b/public/icons/docs/saltstack/16.png similarity index 100% rename from public/icons/docs/salt_stack/16.png rename to public/icons/docs/saltstack/16.png diff --git a/public/icons/docs/salt_stack/16@2x.png b/public/icons/docs/saltstack/16@2x.png similarity index 100% rename from public/icons/docs/salt_stack/16@2x.png rename to public/icons/docs/saltstack/16@2x.png diff --git a/public/icons/docs/salt_stack/SOURCE b/public/icons/docs/saltstack/SOURCE similarity index 100% rename from public/icons/docs/salt_stack/SOURCE rename to public/icons/docs/saltstack/SOURCE From ce5f182014555e5086f121dce1e3deec92d08d68 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 17:42:20 +0200 Subject: [PATCH 51/61] composer: finish scraper and filters --- assets/javascripts/templates/pages/about_tmpl.coffee | 4 ++-- lib/docs/filters/composer/entries.rb | 3 --- lib/docs/scrapers/composer.rb | 11 ++++++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 710d4be7..4a2a722c 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -188,9 +188,9 @@ credits = [ 'https://raw.githubusercontent.com/jashkenas/coffeescript/master/LICENSE' ], [ 'Composer', - '2012-2018 Nils Adermann, Jordi Boggiano', + 'Nils Adermann, Jordi Boggiano', 'MIT', - 'https://github.com/composer/composer/blob/master/LICENSE' + 'https://raw.githubusercontent.com/composer/composer/master/LICENSE' ], [ 'Cordova', '2012-2018 The Apache Software Foundation', diff --git a/lib/docs/filters/composer/entries.rb b/lib/docs/filters/composer/entries.rb index 7547dd38..d3116756 100644 --- a/lib/docs/filters/composer/entries.rb +++ b/lib/docs/filters/composer/entries.rb @@ -3,15 +3,12 @@ module Docs class EntriesFilter < Docs::EntriesFilter def get_name title = at_css('h1').content - title = "#{Integer(subpath[1]) + 1}. #{title}" if type == 'Book' - title end def get_type return 'Articles' if subpath.start_with?('articles/') - 'Book' end diff --git a/lib/docs/scrapers/composer.rb b/lib/docs/scrapers/composer.rb index beade9cb..ade5ca83 100644 --- a/lib/docs/scrapers/composer.rb +++ b/lib/docs/scrapers/composer.rb @@ -1,8 +1,8 @@ module Docs class Composer < UrlScraper - self.name = 'Composer' self.type = 'simple' - + self.release = '1.9.0' + self.base_url = 'https://getcomposer.org/doc/' self.links = { home: 'https://getcomposer.org', code: 'https://github.com/composer/composer' @@ -10,9 +10,6 @@ module Docs html_filters.push 'composer/clean_html', 'composer/entries' - self.release = '1.7.2' - self.base_url = 'https://getcomposer.org/doc/' - options[:container] = '#main' options[:skip_patterns] = [ @@ -23,5 +20,9 @@ module Docs © Nils Adermann, Jordi Boggiano
Licensed under the MIT License. HTML + + def get_latest_version(opts) + get_latest_github_release('composer', 'composer', opts) + end end end From 1c3a9761c6028a37082c4fb3e1a8bb353382551c Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 18:14:58 +0200 Subject: [PATCH 52/61] vue-router: finish scraper and filters --- .../templates/pages/about_tmpl.coffee | 4 +- lib/docs/filters/vue_router/clean_html.rb | 2 +- lib/docs/filters/vue_router/entries.rb | 40 +++++++++---------- lib/docs/scrapers/vue_router.rb | 14 ++++--- public/icons/docs/vue_router/SOURCE | 2 +- 5 files changed, 32 insertions(+), 30 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index c22b737c..67fade42 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -736,9 +736,9 @@ credits = [ 'https://raw.githubusercontent.com/vuejs/vue/master/LICENSE' ], [ 'Vue Router', - '2013-2018 Evan You, Vue.js contributors', + '2013-present Evan You', 'MIT', - 'https://github.com/vuejs/vue-router/blob/dev/LICENSE' + 'https://raw.githubusercontent.com/vuejs/vue-router/dev/LICENSE' ], [ 'Vulkan', '2014-2017 Khronos Group Inc.
Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc.', diff --git a/lib/docs/filters/vue_router/clean_html.rb b/lib/docs/filters/vue_router/clean_html.rb index 6377b0d4..19c6e7ae 100644 --- a/lib/docs/filters/vue_router/clean_html.rb +++ b/lib/docs/filters/vue_router/clean_html.rb @@ -11,4 +11,4 @@ module Docs end end end -end \ No newline at end of file +end diff --git a/lib/docs/filters/vue_router/entries.rb b/lib/docs/filters/vue_router/entries.rb index e8eb2279..b38fed28 100644 --- a/lib/docs/filters/vue_router/entries.rb +++ b/lib/docs/filters/vue_router/entries.rb @@ -3,16 +3,13 @@ module Docs class EntriesFilter < Docs::EntriesFilter def get_name name = at_css('h1').content - name.remove! '# ' - name end def get_type return 'Other Guides' if subpath.start_with?('guide/advanced') return 'Basic Guides' if subpath.start_with?('guide') || subpath.start_with?('installation') - 'API Reference' end @@ -21,7 +18,7 @@ module Docs end def additional_entries - return [] unless subpath.start_with?('api') + return [] unless subpath.start_with?('api') entries = [ ['', 'router-link', 'API Reference'], @@ -31,7 +28,7 @@ module Docs ] css('h3').each do |node| - entryName = node.content.strip + entry_name = node.content.strip # Get the previous h2 title title = node @@ -39,33 +36,36 @@ module Docs title = title.content.strip title.remove! '# ' - entryName.remove! '# ' + entry_name.remove! '# ' - if title == "Router Construction Options" - entryName = "RouterOptions.#{entryName}" - elsif title == " Props" - entryName = " `#{entryName}` prop" - elsif title == " Props" - entryName = " `#{entryName}` prop" - elsif title == "Router Instance Methods" - entryName = "#{entryName}()" + case title + when 'Router Construction Options' + entry_name = "RouterOptions.#{entry_name}" + when ' Props' + entry_name = " `#{entry_name}` prop" + when ' Props' + entry_name = " `#{entry_name}` prop" + when 'Router Instance Methods' + entry_name = "#{entry_name}()" end - unless title == "Component Injections" || node['id'] == 'applying-active-class-to-outer-element' || node['id'] == 'route-object-properties' - entries << [entryName, node['id'], 'API Reference'] + entry_name = entry_name.split(' API ')[0] if entry_name.start_with?('v-slot') + + unless title == "Component Injections" || node['id'] == 'route-object-properties' + entries << [entry_name, node['id'], 'API Reference'] end end css('#route-object-properties + ul > li > p:first-child > strong').each do |node| - entryName = node.content.strip - id = "route-object-#{entryName.remove('$route.')}" + entry_name = node.content.strip + id = "route-object-#{entry_name.remove('$route.')}" node['id'] = id - entries << [entryName, node['id'], 'API Reference'] + entries << [entry_name, node['id'], 'API Reference'] end entries end end end -end \ No newline at end of file +end diff --git a/lib/docs/scrapers/vue_router.rb b/lib/docs/scrapers/vue_router.rb index a029466b..9f617944 100644 --- a/lib/docs/scrapers/vue_router.rb +++ b/lib/docs/scrapers/vue_router.rb @@ -1,9 +1,10 @@ module Docs class VueRouter < UrlScraper - self.slug = 'vue_router' self.name = 'Vue Router' + self.slug = 'vue_router' self.type = 'simple' - + self.release = '3.1.2' + self.base_url = 'https://router.vuejs.org/' self.links = { home: 'https://router.vuejs.org', code: 'https://github.com/vuejs/vue-router' @@ -11,17 +12,18 @@ module Docs html_filters.push 'vue_router/entries', 'vue_router/clean_html' - self.release = '3.0.1' - self.base_url = 'https://router.vuejs.org/' - options[:skip_patterns] = [ # Other languages /^(zh|ja|ru|kr|fr)\//, ] options[:attribution] = <<-HTML - © 2013–2018 Evan You, Vue.js contributors
+ © 2013–present Evan You
Licensed under the MIT License. HTML + + def get_latest_version(opts) + get_latest_github_release('vuejs', 'vue-router', opts) + end end end diff --git a/public/icons/docs/vue_router/SOURCE b/public/icons/docs/vue_router/SOURCE index 97bd9e03..6999e8c5 100644 --- a/public/icons/docs/vue_router/SOURCE +++ b/public/icons/docs/vue_router/SOURCE @@ -1 +1 @@ -http://vuejs.org/ +https://github.com/vuejs/vuejs.org/blob/master/assets/logo.ai From b34dbb25f80e15c7e709c524ce3cd149e205acb3 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 18:25:57 +0200 Subject: [PATCH 53/61] vue-router: fix notes --- lib/docs/filters/vue_router/clean_html.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/docs/filters/vue_router/clean_html.rb b/lib/docs/filters/vue_router/clean_html.rb index 19c6e7ae..71c1a132 100644 --- a/lib/docs/filters/vue_router/clean_html.rb +++ b/lib/docs/filters/vue_router/clean_html.rb @@ -7,6 +7,13 @@ module Docs # Remove unneeded elements css('.bit-sponsor, .header-anchor').remove + css('.custom-block').each do |node| + node.name = 'blockquote' + + title = node.at_css('.custom-block-title') + title.name = 'strong' unless title.nil? + end + doc end end From 40defddb6cdea03f9b66579843da7ac70fa5449a Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Tue, 13 Aug 2019 23:52:21 +0200 Subject: [PATCH 54/61] vuex: finish scraper and filters --- .../templates/pages/about_tmpl.coffee | 14 ++++---- lib/docs/filters/vuex/clean_html.rb | 5 ++- lib/docs/filters/vuex/entries.rb | 35 ++++++++++--------- lib/docs/scrapers/vuex.rb | 13 +++---- public/icons/docs/vuex/SOURCE | 2 +- 5 files changed, 37 insertions(+), 32 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 51d76c61..07c92ad8 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -729,6 +729,11 @@ credits = [ '2010-2018 Mitchell Hashimoto', 'MPL', 'https://raw.githubusercontent.com/mitchellh/vagrant/master/website/LICENSE.md' + ], [ + 'Vue Router', + '2013-present Evan You', + 'MIT', + 'https://raw.githubusercontent.com/vuejs/vue-router/dev/LICENSE' ], [ 'Vue.js', '2013-2018 Evan You, Vue.js contributors', @@ -736,14 +741,9 @@ credits = [ 'https://raw.githubusercontent.com/vuejs/vue/master/LICENSE' ], [ 'Vuex', - '2015-2018 Evan You, Vue.js contributors', + '2015-present Evan You', 'MIT', - 'https://raw.githubusercontent.com/vuejs/vuex/master/LICENSE' - ], [ - 'Vue Router', - '2013-present Evan You', - 'MIT', - 'https://raw.githubusercontent.com/vuejs/vue-router/dev/LICENSE' + 'https://raw.githubusercontent.com/vuejs/vuex/dev/LICENSE' ], [ 'Vulkan', '2014-2017 Khronos Group Inc.
Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc.', diff --git a/lib/docs/filters/vuex/clean_html.rb b/lib/docs/filters/vuex/clean_html.rb index f62870cc..4aad55a9 100644 --- a/lib/docs/filters/vuex/clean_html.rb +++ b/lib/docs/filters/vuex/clean_html.rb @@ -4,6 +4,9 @@ module Docs def call @doc = at_css('.content') + # Remove video from root page + css('a[href="#"]').remove if root_page? + # Remove unneeded elements css('.header-anchor').remove @@ -11,4 +14,4 @@ module Docs end end end -end \ No newline at end of file +end diff --git a/lib/docs/filters/vuex/entries.rb b/lib/docs/filters/vuex/entries.rb index 72c8486e..04846fd2 100644 --- a/lib/docs/filters/vuex/entries.rb +++ b/lib/docs/filters/vuex/entries.rb @@ -8,10 +8,10 @@ module Docs # Add index on guides unless subpath.start_with?('api') - sidebarLink = at_css('.sidebar-link.active') - allLinks = css('.sidebar-link:not([href="/"]):not([href="../index"])') + sidebar_link = at_css('.sidebar-link.active') + all_links = css('.sidebar-link:not([href="/"]):not([href="../index"])') - index = allLinks.index(sidebarLink) + index = all_links.index(sidebar_link) name.prepend "#{index + 1}. " if index end @@ -28,7 +28,7 @@ module Docs end def additional_entries - return [] unless subpath.start_with?('api') + return [] unless subpath.start_with?('api') entries = [ ['Component Binding Helpers', 'component-binding-helpers', 'API Reference'], @@ -36,7 +36,7 @@ module Docs ] css('h3').each do |node| - entryName = node.content.strip + entry_name = node.content.strip # Get the previous h2 title title = node @@ -44,25 +44,26 @@ module Docs title = title.content.strip title.remove! '# ' - entryName.remove! '# ' + entry_name.remove! '# ' - unless entryName.start_with?('router.') - if title == "Vuex.Store Constructor Options" - entryName = "StoreOptions.#{entryName}" - elsif title == "Vuex.Store Instance Properties" - entryName = "Vuex.Store.#{entryName}" - elsif title == "Vuex.Store Instance Methods" - entryName = "Vuex.Store.#{entryName}()" - elsif title == "Component Binding Helpers" - entryName = "#{entryName}()" + unless entry_name.start_with?('router.') + case title + when "Vuex.Store Constructor Options" + entry_name = "StoreOptions.#{entry_name}" + when "Vuex.Store Instance Properties" + entry_name = "Vuex.Store.#{entry_name}" + when "Vuex.Store Instance Methods" + entry_name = "Vuex.Store.#{entry_name}()" + when "Component Binding Helpers" + entry_name = "#{entry_name}()" end end - entries << [entryName, node['id'], 'API Reference'] + entries << [entry_name, node['id'], 'API Reference'] end entries end end end -end \ No newline at end of file +end diff --git a/lib/docs/scrapers/vuex.rb b/lib/docs/scrapers/vuex.rb index 774e989f..57e761ce 100644 --- a/lib/docs/scrapers/vuex.rb +++ b/lib/docs/scrapers/vuex.rb @@ -1,8 +1,8 @@ module Docs class Vuex < UrlScraper - self.name = 'Vuex' self.type = 'simple' - + self.release = '3.1.1' + self.base_url = 'https://vuex.vuejs.org/' self.links = { home: 'https://vuex.vuejs.org', code: 'https://github.com/vuejs/vuex' @@ -10,17 +10,18 @@ module Docs html_filters.push 'vuex/entries', 'vuex/clean_html' - self.release = '3.0.1' - self.base_url = 'https://vuex.vuejs.org/' - options[:skip_patterns] = [ # Other languages /^(zh|ja|ru|kr|fr|ptbr)\//, ] options[:attribution] = <<-HTML - © 2015–2018 Evan You, Vue.js contributors
+ © 2015–present Evan You
Licensed under the MIT License. HTML + + def get_latest_version(opts) + get_npm_version('vuex', opts) + end end end diff --git a/public/icons/docs/vuex/SOURCE b/public/icons/docs/vuex/SOURCE index 97bd9e03..6999e8c5 100644 --- a/public/icons/docs/vuex/SOURCE +++ b/public/icons/docs/vuex/SOURCE @@ -1 +1 @@ -http://vuejs.org/ +https://github.com/vuejs/vuejs.org/blob/master/assets/logo.ai From eb82f6024cf25e8c468b5198404b75f7015fe457 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Wed, 14 Aug 2019 02:28:43 +0200 Subject: [PATCH 55/61] pony: finish scraper and filters --- .../templates/pages/about_tmpl.coffee | 6 ++++ lib/docs/filters/pony/clean_html.rb | 15 ++++++++++ lib/docs/filters/pony/container.rb | 9 ------ lib/docs/filters/pony/entries.rb | 26 ++++++++++++++++-- lib/docs/scrapers/pony.rb | 19 +++++++++---- public/icons/docs/pony/16.png | Bin 1979 -> 1360 bytes 6 files changed, 59 insertions(+), 16 deletions(-) create mode 100644 lib/docs/filters/pony/clean_html.rb delete mode 100644 lib/docs/filters/pony/container.rb diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 07c92ad8..ac86b701 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -568,6 +568,12 @@ credits = [ 'CC BY', 'https://creativecommons.org/licenses/by/3.0/' ], [ + 'Pony', + '2016-2018, The Pony Developers & 2014-2015, Causality Ltd.', + 'BSD', + 'https://raw.githubusercontent.com/ponylang/ponyc/master/LICENSE' + ], + [ 'PostgreSQL', '1996-2018 The PostgreSQL Global Development Group
© 1994 The Regents of the University of California', 'PostgreSQL', diff --git a/lib/docs/filters/pony/clean_html.rb b/lib/docs/filters/pony/clean_html.rb new file mode 100644 index 00000000..665d1048 --- /dev/null +++ b/lib/docs/filters/pony/clean_html.rb @@ -0,0 +1,15 @@ +module Docs + class Pony + class CleanHtmlFilter < Filter + def call + css('.headerlink').remove + + css('pre').each do |node| + node.content = node.content + end + + doc + end + end + end +end diff --git a/lib/docs/filters/pony/container.rb b/lib/docs/filters/pony/container.rb deleted file mode 100644 index f29db7d4..00000000 --- a/lib/docs/filters/pony/container.rb +++ /dev/null @@ -1,9 +0,0 @@ -module Docs - class Pony - class ContainerFilter < Filter - def call - css('article') - end - end - end -end diff --git a/lib/docs/filters/pony/entries.rb b/lib/docs/filters/pony/entries.rb index 0dbc81c8..296f2090 100644 --- a/lib/docs/filters/pony/entries.rb +++ b/lib/docs/filters/pony/entries.rb @@ -2,11 +2,33 @@ module Docs class Pony class EntriesFilter < Docs::EntriesFilter def get_name - context[:html_title].sub(/ - .*/, '') + title = context[:html_title].sub(/ - .*/, '').split(' ').last + title = "1. #{type}" if title == 'Package' + title end def get_type - subpath.split('-')[0][0..-1] + subpath.split(/-([^a-z])/)[0][0..-1].sub('-', '/') + end + + def additional_entries + return [] if root_page? || name.start_with?("1. ") + + entries = [] + + css('h3').each do |node| + member_name = node.content + + is_field = member_name.start_with?('let ') + member_name = member_name[4..-1] if is_field + + member_name = member_name.scan(/^([a-zA-Z0-9_]+)/)[0][0] + member_name += '()' unless is_field + + entries << ["#{name}.#{member_name}", node['id']] + end + + entries end end end diff --git a/lib/docs/scrapers/pony.rb b/lib/docs/scrapers/pony.rb index 5f1bbc04..24df881d 100644 --- a/lib/docs/scrapers/pony.rb +++ b/lib/docs/scrapers/pony.rb @@ -1,18 +1,27 @@ module Docs class Pony < UrlScraper - self.type = 'pony' - self.release = '0.25.0' + self.type = 'simple' + self.release = '0.30.0' self.base_url = 'https://stdlib.ponylang.io/' + self.links = { + home: 'https://www.ponylang.io/', + code: 'https://github.com/ponylang/ponyc' + } - html_filters.push 'pony/container', 'pony/entries' + html_filters.push 'pony/clean_html', 'pony/entries' options[:attribution] = <<-HTML © 2016-2018, The Pony Developers
© 2014-2015, Causality Ltd.
- Licensed under the BSD 2-Clause License + Licensed under the BSD 2-Clause License. HTML + options[:container] = 'article' options[:trailing_slash] = false - options[:skip_patterns] = [/src/] + options[:skip_patterns] = [/src/, /stdlib--index/] + + def get_latest_version(opts) + get_latest_github_release('ponylang', 'ponyc', opts) + end end end diff --git a/public/icons/docs/pony/16.png b/public/icons/docs/pony/16.png index daed6509fb0efbcee6aceaa42047dd39ed731f03..c5b30dade6843b0a39575e97a0fc6147f79346b6 100644 GIT binary patch literal 1360 zcmZ`(c~FyA5Z^Bc34uT;R|HYe8c`q(0cr>-3M7Oxgvb#RjsO9q%4q~dKm<#n%Akl4 zFnCnJQCq9U;DA!Fr53FqtyqyVT8mKeXvMoCrSHSBo&M3^?6>=N-@Z4y`+M_MNhM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)0ayCylurMht~Q57Va4VC$Q2@a{Wrv!G=m_x$n! z5JSiA9+oa?yV0+gKtb!x8AY{Waey7$J9y-w2YB?6hlj`B-uf1QUi~-?=>`C*l?t!F zwwVnttYu$!H*@Bl&Vjx@cJ1ty6nc7Cdd|53jGr)(S6+OPMN8`6mMuS@36mxbuQPkjT*5Hqa~EE8Sa}Wu zxayi~0a(z|%JR>D0e~P30J!!W*Yl&5KO0KI(b~2YfY!DpYuaU&*=WUr=`< z2#BJn4geTapML7hSv2MIY*^Pm1W-TUmMuS@WGcmimR6eb`B4E5+dpo|fv;bGBiDcH zCICKse;WX6pL>R#T{{@EU>Kk@ILN|9ZLDj59uXNH7ZKt(CYef&Dn6T}(Ua1YA^M@zS#y92g+g(7?3mGXO{=68z#f53%8ex+ABbIiLAwwXnYZ zc?OC_X3w3=m@!Q}{r7cbvf1IqXU;l}Og2k4+sOFw6aJNTkYv}+E&#*`W5y=U_aFV^ z<3DU|Ya5mF(~g%nZsdx~E?wDMakqYaA27$KxLd$Wd9)fK9~#Cvs5&JQU?8I1!2uu{ z2q&uGs}dO@69{>Q!N^enO0lv>psB%Up@YFdIId!OqvqHRR21y~GT)(off*6r*aUY5 zhN)JG1H)KPNEahsv&z1Th{}s*n~T zoAR0M6p3|cK_LT-S8$nt3ypv;UDfv>vRndLZV>LX~Gn6FsT}!?l1xtL(Fm z11gj~ArUJbMo2dXoEtm#M#}y`80!gRl0Fj)6>h6ow$~gVlw$s7>do2DQ64Er1Q?2< zgFS&^a$uMd*MWM Date: Wed, 14 Aug 2019 02:40:51 +0200 Subject: [PATCH 56/61] pony: remove horizontal lines --- lib/docs/filters/pony/clean_html.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/docs/filters/pony/clean_html.rb b/lib/docs/filters/pony/clean_html.rb index 665d1048..9260f226 100644 --- a/lib/docs/filters/pony/clean_html.rb +++ b/lib/docs/filters/pony/clean_html.rb @@ -3,6 +3,7 @@ module Docs class CleanHtmlFilter < Filter def call css('.headerlink').remove + css('hr').remove css('pre').each do |node| node.content = node.content From 0b1adb5291b4f0e54fe7c2520148b7ef1cabf170 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Wed, 14 Aug 2019 17:36:06 +0200 Subject: [PATCH 57/61] Fix #1054 --- views/service-worker.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/service-worker.js.erb b/views/service-worker.js.erb index aa234c19..722cd3fe 100644 --- a/views/service-worker.js.erb +++ b/views/service-worker.js.erb @@ -50,7 +50,7 @@ self.addEventListener('fetch', event => { <%# The index page will make sure the correct documentation or a proper offline page is shown %> const pathname = url.pathname; const filename = pathname.substr(1 + pathname.lastIndexOf('/')).split(/\#|\?/g)[0]; - if (url.origin === location.origin && !filename.includes('.')) { + if (url.origin === location.origin && !['.css', '.js', '.json', '.png', '.ico', '.svg', '.xml'].some(ext => filename.endsWith(ext))) { const cachedIndex = await caches.match('/'); if (cachedIndex) return cachedIndex; } From c8f30b213f46486a5c527de3cca8eddaa28cf01c Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 14 Aug 2019 18:53:21 +0200 Subject: [PATCH 58/61] Update the Godot icon This updates the Godot icon to the official icon used since Godot 3.0. --- public/icons/docs/godot/16.png | Bin 751 -> 642 bytes public/icons/docs/godot/16@2x.png | Bin 1585 -> 1415 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/public/icons/docs/godot/16.png b/public/icons/docs/godot/16.png index c574a60d1b295b5bd6ef27aa0102e02a9ef8112b..5497dfaf3d27d8450eaad27d2499f559e83c4aa8 100644 GIT binary patch literal 642 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZOo>JNh~@Fl_AS{*%bcz`!UK;1l8s6nF30@6xl+ zvum$g&jI(IeeT`+9Xs|;+;uZ~?n$T4z3x2+JV4_6NkwiwAaf?|z6nH0b58)-a0E2U zwR@ijHZy^`oICdcWj%WjH6w(MF+1A}2_oI%M$I~1SEf9)Ar t+?~Uy z&$g{XY;&~s?%B3)-<$Q}w{4Ua^GnZctm~@h?*6{lkp3=Dx)0ne8@7j&np-Y$^$YE|ck7Y>;9wB-T=doqWR-7y}V@~WUITlBy--M9% z&x&5d>GV}pmpzBq-h3B}5|?3~>%j545ljx`@o8WSo_~4l5ga^n3>){g*xxx$rZEPsAoqxR zx~+a@sDQQGu3_ztI!y3nKu$4@Vlp$BwPWA}c*WLQY}{3g8KnExp{Ax~@%*DwnVNd- z^Ru0Z@PBS3(>(~Ky0AE2#HO7!2-4nnu@mncX>y!}=^WuSNY|h01!eFPsqC|Jcg+lB z2j4%@j-`nr)^ES&C~V91VL1hG7BSe8=|%8T7v4VH=rH>5R0kHu@?%fw;vwf7B$KUmT0f#XR UU{RvMy8r+H07*qoM6N<$f)(L+P5=M^ diff --git a/public/icons/docs/godot/16@2x.png b/public/icons/docs/godot/16@2x.png index 8047384df823bd537ad58c6e84d48df527e1fbb9..64cdf210e5a600bfcf830f4f5fe653990ac95efb 100644 GIT binary patch literal 1415 zcmbtTeN>WH7=J-cYh|w1vC~=8dD6Z-m6@nnDu^O}a1dLDiXWBJtc0y}+D2O1Ohj~= zC9S0nh=u@1z$f<6PRd1AEHe@G>0ZSqTK8M`(tOj=XdXO?{lB?yZ5=z?-t>4 zm<{W;tpfmH12z;*fUNUsx3hvqG>ZnVE>49KA_3r%8vx`L0Du{C_ z3M&<1=z2vs*K}_{#9^rQsdvb`Pat@SBFgcxF!!O%PNBg+alqJpUG} zNBm!)>4IPg#e%2`F`+^{F|&B`mtF{HngGIoSyTO=cw!aY5k0Od5N#oA+PhVwJQHwGLbXLhkgAL;^JguFHThT zKsTwCyd=fN1r&C$rBm`}Lq6WVfdNQ_7lKvaKxWHvWt}?X5``^S3=cK-Pvy5N4SHP^ zKFaG5A_Numw6o^~vlsVMmwtY^U7=O0RIJ(>K^Iuis*Eh_)EburVo;@0g%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ziYUtGBX&GBZcB2*orxz8^jZ<4M^e$Lp$1beXCL;&593^Ppysnd8KbD?5-0eK&s=BG zvl4)6%z!)>vCBda9h5AiiXBWMZ_m)1C&?Lr#~osx1{7*JRWe zojcR8iAD{XYO2G^h{Nd34P+LtBM+WOv#jx}&Kj?eK1!#ju{-$`_GA&xevov_6p0Xd z@wWKm7|Ny`w>1T7>S=vv9J?hMyMK~SqRNDTn;csapuWm1B)6F#fz5Hp5s-cc$;U5Y z^6qp!8&ZnhT%b2#Rtnv8CgNlh5@E7$>_|9)fy@-6(i={EN#?#Ey9X`ih9U0AMO~YX(Uz_`5rMy*@uc1+N?vc?FW9zmQv|FgpyEqf)60y_{3xWh=K<2R7zcbrheaq6G>q4F9RHzo5(IN47wklS7v@?<@`NDh!F zvWT=KZ&}8xeYvIxTo0J->id~LLbWzL_aH;aP|}mM<0kW3?1PWYcK?Tc f?b@G-QWQS{a#}6TTP5K=00000NkvXXu0mjf{3;WQ From 22f7bcf987f320f0076ca2c02196953b64a6b39d Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Thu, 15 Aug 2019 03:17:18 +0200 Subject: [PATCH 59/61] Fix fetch issues with browser extension resources --- views/service-worker.js.erb | 42 ++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/views/service-worker.js.erb b/views/service-worker.js.erb index 722cd3fe..4a0bd9d0 100644 --- a/views/service-worker.js.erb +++ b/views/service-worker.js.erb @@ -11,6 +11,34 @@ const urlsToCache = [ '<%= doc_index_urls.join "',\n '" %>', ]; +<%# Clone a request with the mode set to 'cors' %> +function corsify(request) { + const options = { + mode: 'cors', + }; + + const keys = [ + 'body', + 'cache', + 'credentials', + 'headers', + 'integrity', + 'keepalive', + 'method', + 'redirect', + 'referrer', + 'referrerPolicy', + 'signal', + 'window', + ]; + + for (const key of keys) { + options[key] = request[key]; + } + + return new Request(request.url, options); +} + <%# Set-up the cache %> self.addEventListener('install', event => { self.skipWaiting(); @@ -36,9 +64,11 @@ self.addEventListener('fetch', event => { if (cachedResponse) return cachedResponse; try { - const response = await fetch(event.request); + const response = await fetch(corsify(event.request)); - if (!response.ok) { + <%# If the status code is 0 it means the response is opaque %> + <%# If the response is opaque it's not possible to read whether it is successful or not, so we assume it is %> + if (!response.ok && response.status !== 0) { throw new Error(`The HTTP request failed with status code ${response.status}`); } @@ -46,11 +76,13 @@ self.addEventListener('fetch', event => { } catch (err) { const url = new URL(event.request.url); - <%# Attempt to return the index page from the cache if the user is visiting a url like devdocs.io/offline or devdocs.io/javascript/global_objects/array/find %> - <%# The index page will make sure the correct documentation or a proper offline page is shown %> const pathname = url.pathname; const filename = pathname.substr(1 + pathname.lastIndexOf('/')).split(/\#|\?/g)[0]; - if (url.origin === location.origin && !['.css', '.js', '.json', '.png', '.ico', '.svg', '.xml'].some(ext => filename.endsWith(ext))) { + const extensions = ['.html', '.css', '.js', '.json', '.png', '.ico', '.svg', '.xml']; + + <%# Attempt to return the index page from the cache if the user is visiting a url like devdocs.io/offline or devdocs.io/javascript/global_objects/array/find %> + <%# The index page will make sure the correct documentation or a proper offline page is shown %> + if (url.origin === location.origin && !extensions.some(ext => filename.endsWith(ext))) { const cachedIndex = await caches.match('/'); if (cachedIndex) return cachedIndex; } From 17528d984575fe6d7a586987a7936a06d695c588 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Fri, 16 Aug 2019 16:49:12 +0200 Subject: [PATCH 60/61] rxjs: finish scraper and filters --- .../templates/pages/about_tmpl.coffee | 20 ++-- lib/docs/filters/rxjs/clean_html.rb | 54 ++++++++-- lib/docs/filters/rxjs/entries.rb | 12 ++- lib/docs/scrapers/rxjs.rb | 102 +++++++++--------- public/icons/docs/rxjs/16.png | Bin 5356 -> 1521 bytes public/icons/docs/rxjs/SOURCE | 2 +- 6 files changed, 117 insertions(+), 73 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index ac86b701..892c4284 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -211,8 +211,7 @@ credits = [ '2017 Cypress.io', 'MIT', 'https://raw.githubusercontent.com/cypress-io/cypress-documentation/develop/LICENSE.md' - ], - [ + ], [ 'D', '1999-2018 The D Language Foundation', 'Boost', @@ -572,8 +571,7 @@ credits = [ '2016-2018, The Pony Developers & 2014-2015, Causality Ltd.', 'BSD', 'https://raw.githubusercontent.com/ponylang/ponyc/master/LICENSE' - ], - [ + ], [ 'PostgreSQL', '1996-2018 The PostgreSQL Global Development Group
© 1994 The Regents of the University of California', 'PostgreSQL', @@ -648,13 +646,17 @@ credits = [ '2010 The Rust Project Developers', 'MIT', 'https://raw.githubusercontent.com/rust-lang/rust/master/LICENSE-MIT' + ], [ + 'RxJS', + '2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors', + 'Apache', + 'https://raw.githubusercontent.com/ReactiveX/rxjs/master/LICENSE.txt' ], [ 'Salt Stack', '2019 SaltStack', 'Apache', 'https://raw.githubusercontent.com/saltstack/salt/develop/LICENSE' - ], - [ + ], [ 'Sass', '2006-2016 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein', 'MIT', @@ -664,8 +666,7 @@ credits = [ '2002-2019 EPFL, with contributions from Lightbend', 'Apache', 'https://raw.githubusercontent.com/scala/scala-lang/master/license.md' - ], - [ + ], [ 'scikit-image', '2011 the scikit-image team', 'BSD', @@ -765,8 +766,7 @@ credits = [ '2003-2019 WordPress Foundation', 'GPLv2+', 'https://wordpress.org/about/license/' - ], - [ + ], [ 'Yarn', '2016-present Yarn Contributors', 'BSD', diff --git a/lib/docs/filters/rxjs/clean_html.rb b/lib/docs/filters/rxjs/clean_html.rb index 1056b1a6..864c201b 100644 --- a/lib/docs/filters/rxjs/clean_html.rb +++ b/lib/docs/filters/rxjs/clean_html.rb @@ -7,6 +7,11 @@ module Docs at_css('h1').content = 'RxJS Documentation' end + if at_css('h1').nil? + title = subpath.rpartition('/').last.titleize + doc.prepend_child("

#{title}

") + end + css('br', 'hr', '.material-icons', '.header-link', '.breadcrumb').remove css('.content', 'article', '.api-header', 'section', '.instance-member').each do |node| @@ -65,6 +70,16 @@ module Docs if node['class'] && node['class'].include?('api-heading') node.name = 'h3' + + unless node.ancestors('.instance-method').empty? + matches = node.inner_html.scan(/([^(& ]+)[(&]/) + + unless matches.empty? || matches[0][0] == 'constructor' + node['name'] = matches[0][0] + node['id'] = node['name'].downcase + '-' + end + end + node.inner_html = "#{node.inner_html}" end @@ -77,25 +92,48 @@ module Docs node.remove_attribute('class') end - css('h1[class]').remove_attr('class') - css('table[class]').remove_attr('class') - css('table[width]').remove_attr('width') - css('tr[style]').remove_attr('style') + css('td > .overloads').each do |node| + node.replace node.at_css('.detail-contents') + end + + css('td.short-description p').each do |node| + signature = node.parent.parent.next_element.at_css('h3[id]') + signature.after(node) unless signature.nil? + end - if at_css('.api-type-label.module') - at_css('h1').content = subpath.remove('api/') + css('.method-table').each do |node| + node.replace node.at_css('tbody') end - css('th h3').each do |node| - node.name = 'span' + css('.api-body > table > caption').each do |node| + node.name = 'center' + lift_out_of_table node end + css('.api-body > table > tbody > tr:not([class]) > td > *').each do |node| + lift_out_of_table node + end + + css('.api-body > table').each do |node| + node.remove if node.content.strip.blank? + end + + css('h1[class]').remove_attr('class') + css('table[class]').remove_attr('class') + css('table[width]').remove_attr('width') + css('tr[style]').remove_attr('style') + css('code code').each do |node| node.before(node.children).remove end doc end + + def lift_out_of_table(node) + table = node.ancestors('table').first + table.previous_element.after(node) + end end end end diff --git a/lib/docs/filters/rxjs/entries.rb b/lib/docs/filters/rxjs/entries.rb index 020ce1eb..c6e488fb 100644 --- a/lib/docs/filters/rxjs/entries.rb +++ b/lib/docs/filters/rxjs/entries.rb @@ -2,22 +2,28 @@ module Docs class Rxjs class EntriesFilter < Docs::EntriesFilter def get_name - name = at_css('h1').content + title = at_css('h1') + name = title.nil? ? subpath.rpartition('/').last.titleize : title.content name.prepend "#{$1}. " if subpath =~ /\-pt(\d+)/ + name += '()' unless at_css('.api-type-label.function').nil? name end def get_type if slug.start_with?('guide') 'Guide' - elsif at_css('.api-type-label.module') - name.split('/').first elsif slug.start_with?('api/') slug.split('/').second else 'Miscellaneous' end end + + def additional_entries + css('h3[id]').map do |node| + ["#{name}.#{node['name']}()", node['id']] + end + end end end end diff --git a/lib/docs/scrapers/rxjs.rb b/lib/docs/scrapers/rxjs.rb index 1825fc80..e5ea1051 100644 --- a/lib/docs/scrapers/rxjs.rb +++ b/lib/docs/scrapers/rxjs.rb @@ -4,11 +4,26 @@ module Docs class Rxjs < UrlScraper self.name = 'RxJS' self.type = 'rxjs' + self.release = '6.5.2' + self.base_url = 'https://rxjs.dev/' + self.root_path = 'guide/overview' self.links = { home: 'https://rxjs.dev/', code: 'https://github.com/ReactiveX/rxjs' } + html_filters.push 'rxjs/clean_html', 'rxjs/entries' + + options[:follow_links] = false + options[:only_patterns] = [/guide\//, /api\//] + options[:skip_patterns] = [/api\/([^\/]+)\.json/] + options[:fix_urls_before_parse] = ->(url) do + url.sub! %r{\Aguide/}, '/guide/' + url.sub! %r{\Aapi/}, '/api/' + url.sub! %r{\Agenerated/}, '/generated/' + url + end + options[:max_image_size] = 256_000 options[:attribution] = <<-HTML @@ -16,69 +31,54 @@ module Docs Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0. HTML - module Common - private + def get_latest_version(opts) + json = fetch_json('https://rxjs.dev/generated/navigation.json', opts) + json['__versionInfo']['raw'] + end - def initial_urls - initial_urls = [] + private - Request.run "#{self.class.base_url}generated/navigation.json" do |response| - data = JSON.parse(response.body) - dig = ->(entry) do - initial_urls << url_for("generated/docs/#{entry['url']}.json") if entry['url'] && entry['url'] != 'api' - entry['children'].each(&dig) if entry['children'] - end - data['SideNav'].each(&dig) - end + def initial_urls + initial_urls = [] - Request.run "#{self.class.base_url}generated/docs/api/api-list.json" do |response| - data = JSON.parse(response.body) - dig = ->(entry) do - initial_urls << url_for("generated/docs/#{entry['path']}.json") if entry['path'] - initial_urls << url_for("generated/docs/api/#{entry['name']}.json") if entry['name'] && !entry['path'] - entry['items'].each(&dig) if entry['items'] - end - data.each(&dig) + Request.run "#{self.class.base_url}generated/navigation.json" do |response| + data = JSON.parse(response.body) + dig = ->(entry) do + initial_urls << url_for("generated/docs/#{entry['url']}.json") if entry['url'] && entry['url'] != 'api' + entry['children'].each(&dig) if entry['children'] end - - initial_urls + data['SideNav'].each(&dig) end - def handle_response(response) - if response.mime_type.include?('json') - begin - response.options[:response_body] = JSON.parse(response.body)['contents'] - rescue JSON::ParserError - response.options[:response_body] = '' - end - response.headers['Content-Type'] = 'text/html' - response.url.path = response.url.path.sub('/generated/docs/', '/').remove('.json') - response.effective_url.path = response.effective_url.path.sub('/generated/docs/', '/').remove('.json') + Request.run "#{self.class.base_url}generated/docs/api/api-list.json" do |response| + data = JSON.parse(response.body) + dig = ->(entry) do + initial_urls << url_for("generated/docs/#{entry['path']}.json") if entry['path'] + initial_urls << url_for("generated/docs/api/#{entry['name']}.json") if entry['name'] && !entry['path'] + entry['items'].each(&dig) if entry['items'] end - super + data.each(&dig) end - end - version do - self.release = '6.3.3' - self.base_url = 'https://rxjs.dev/' - self.root_path = 'guide/overview' - - html_filters.push 'rxjs/clean_html', 'rxjs/entries' - - options[:follow_links] = false - options[:only_patterns] = [/\Aguide/, /\Aapi/] - options[:fix_urls_before_parse] = ->(url) do - url.sub! %r{\Aguide/}, '/guide/' - url.sub! %r{\Aapi/}, '/api/' - url.sub! %r{\Agenerated/}, '/generated/' - url + initial_urls.select do |url| + options[:only_patterns].any? { |pattern| url =~ pattern } && + options[:skip_patterns].none? { |pattern| url =~ pattern } end - - include Docs::Rxjs::Common end - private + def handle_response(response) + if response.mime_type.include?('json') + begin + response.options[:response_body] = JSON.parse(response.body)['contents'] + rescue JSON::ParserError + response.options[:response_body] = '' + end + response.headers['Content-Type'] = 'text/html' + response.url.path = response.url.path.sub('/generated/docs/', '/').remove('.json') + response.effective_url.path = response.effective_url.path.sub('/generated/docs/', '/').remove('.json') + end + super + end def parse(response) response.body.gsub! 'Z~!tni*7$tmRtL~dU*gFMgdVVKo?tzst4BC z0#AGa`vjnWSn}CfQviAS%o*O!tbl^60Zl^?1vMZk0}&J{=~zWkKyf1tTr##&_yj;* zfTVJ`Q(!rg%c0qXm?*?PgCht3R?t>x42bT=eu~u;NgR?XDhvqQgUb|?DYRYCHbZj@ zVits4a2eSAW=Ebvd;#e$q>~V`A>=_UkVz#nav!7uiKAgbL7G7_ARGr@BX2NF%Fde3PAEfo)~?=19(M1SOKya!d+1K`&|odfO#_~-U1jV62uxFm3ot#s`}H4h<3;Hn{p zgUbSU4BQd$=fU3wUjnWcd@FeB20jze`nKp2mOW{~o7Psne`2WiTB! zr}%Y!N!E(Nz?`x+M)XSWESIa<2d(y0=2L3uFwk2Q%q|)zZPG0i?zD7QtsQ&4F~Ho^ z$~|y4M^qi`!V$709+#=3Ldj>R61v`&;!xuf&=v&~tTB&7$Cr636KlGP6Mu z`rQjGQw=olQ0$1egK`?Hb6qebt<%udQ5+v%*xlf#K;Q7<4kn~o?`Z zY>=CigZF?tvOcos1|x@j#D^nCeKh)G#U~~#H68P*&1a>b+uA9|jvGJ0j4^yMagzNX zlc(IfKlRJ6zBVz3!?dyoc4plyui5aP^WEHs zKJ(@;Sh#5MqwjtFu;g)lgMUDvMNsh4Wy?cWti-A(p-;nBzZD+Qn~7DeS&Mbg8h==C zxuFmGZrt?F=EyCG+S(Mo?Omqmy_olZ{3&)j;&wc5-nlEjpW389#|t9C07=uL)g>f; zusbPv&)$@M7?`^M=d=R{52YXe<;c-v8OL#AP-fQ2Q`x7_{F-z2-1!T+82sCiyo;Cg zms_t~y_SFd#!$fOruD7c1-};-72mmAGHiIFD!hJ(qu)Me#7LF1k1D`V6=?4t9>@Ze zwswtBGCp#jT+*8c}U`41q`E9N=_z|Gmy JDPx*%^xvy8X{i7J literal 5356 zcmV zaB^>EX>4U6ba`-PAZ2)IW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W-(gdV+30>CJ^K{q@d}DVG{qi{?ZB~D z^S$BUrl-3Ob%ukPCc1bUMtM8EC>7uRN}W#AZNiR4codF za4A{zI>YX7jRJwOsq4irG-cMP20M_9yokCKOsRcGTjf3pdos7mk<^ zM(z8T&T-(lto`^UR?Mw1DTyhlaf<8|>>*ExMAs-ROpB&xj|+ZxhMEL(ra*K)hwF8+ ziEC&Y;ofawcP)@@ULrrAQ|h@+YxkWmlqMu=_m-TRF9hA?37TQrIocI4iw*Q}9i6SC z&(;aUZJgY~zfiFCFXiqVOFs(9C4=wm1@n$VUk5MCXh;xAu+l=LfzI9}yj-$Nr$_Sr z;hq4XZ$h{|B>4Ffs!xO2q1bg9u!O(bAbgXE`8s#CWNZ4O0{jh$WL{&SUMK4S0000< KMNUMnLSTX!`8aC; diff --git a/public/icons/docs/rxjs/SOURCE b/public/icons/docs/rxjs/SOURCE index 536eb88a..2a3b3084 100644 --- a/public/icons/docs/rxjs/SOURCE +++ b/public/icons/docs/rxjs/SOURCE @@ -1 +1 @@ -http://reactivex.io/ +https://github.com/ReactiveX/reactivex.github.io/blob/develop/favicon.ico From d5f4a76fc2a9b78cf0e174076dc223d6e34c7762 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Fri, 16 Aug 2019 17:25:16 +0200 Subject: [PATCH 61/61] rxjs: fix Observable link on root page --- lib/docs/scrapers/rxjs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/docs/scrapers/rxjs.rb b/lib/docs/scrapers/rxjs.rb index e5ea1051..e6f57961 100644 --- a/lib/docs/scrapers/rxjs.rb +++ b/lib/docs/scrapers/rxjs.rb @@ -18,7 +18,7 @@ module Docs options[:only_patterns] = [/guide\//, /api\//] options[:skip_patterns] = [/api\/([^\/]+)\.json/] options[:fix_urls_before_parse] = ->(url) do - url.sub! %r{\Aguide/}, '/guide/' + url.sub! %r{\A(\.\/)?guide/}, '/guide/' url.sub! %r{\Aapi/}, '/api/' url.sub! %r{\Agenerated/}, '/generated/' url