From 850366459b748e9b9a70dcdc2c2bea3a1c575353 Mon Sep 17 00:00:00 2001 From: Tim Lim Date: Tue, 4 Oct 2022 21:41:58 +0800 Subject: [PATCH] Add Moment.js Timezone (0.5.37) --- .../templates/pages/about_tmpl.coffee | 5 +++ assets/stylesheets/application.css.scss | 1 + .../stylesheets/pages/_moment_timezone.scss | 5 +++ .../filters/moment_timezone/clean_html.rb | 29 +++++++++++++++++ lib/docs/filters/moment_timezone/entries.rb | 23 ++++++++++++++ lib/docs/scrapers/moment_timezone.rb | 30 ++++++++++++++++++ public/icons/docs/moment_timezone/16.png | Bin 0 -> 1377 bytes public/icons/docs/moment_timezone/16@2x.png | Bin 0 -> 1717 bytes public/icons/docs/moment_timezone/SOURCE | 1 + 9 files changed, 94 insertions(+) create mode 100644 assets/stylesheets/pages/_moment_timezone.scss create mode 100644 lib/docs/filters/moment_timezone/clean_html.rb create mode 100644 lib/docs/filters/moment_timezone/entries.rb create mode 100644 lib/docs/scrapers/moment_timezone.rb create mode 100644 public/icons/docs/moment_timezone/16.png create mode 100644 public/icons/docs/moment_timezone/16@2x.png create mode 100644 public/icons/docs/moment_timezone/SOURCE diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index cda606e4..2b5a4fb2 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -581,6 +581,11 @@ credits = [ 'JS Foundation and other contributors', 'MIT', 'https://raw.githubusercontent.com/moment/moment/master/LICENSE' + ], [ + 'Moment.js Timezone', + 'JS Foundation and other contributors', + 'MIT', + 'https://raw.githubusercontent.com/moment/moment-timezone/master/LICENSE' ], [ 'Mongoose', '2010 LearnBoost', diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 8a6221b6..d6189c5d 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -87,6 +87,7 @@ 'pages/mkdocs', 'pages/modernizr', 'pages/moment', + 'pages/moment_timezone', 'pages/nginx', 'pages/node', 'pages/npm', diff --git a/assets/stylesheets/pages/_moment_timezone.scss b/assets/stylesheets/pages/_moment_timezone.scss new file mode 100644 index 00000000..b30da34d --- /dev/null +++ b/assets/stylesheets/pages/_moment_timezone.scss @@ -0,0 +1,5 @@ +._moment_timezone { + > h2 { @extend %block-heading; } + > h3 { @extend %block-label, %label-blue; } + code { @extend %label; } +} diff --git a/lib/docs/filters/moment_timezone/clean_html.rb b/lib/docs/filters/moment_timezone/clean_html.rb new file mode 100644 index 00000000..e6e0b6d1 --- /dev/null +++ b/lib/docs/filters/moment_timezone/clean_html.rb @@ -0,0 +1,29 @@ +module Docs + class MomentTimezone + class CleanHtmlFilter < Filter + def call + # Set id attributes on headings + css('a.docs-section-target', 'a.docs-method-target').each do |node| + node.next_element['id'] = node['id'] + node.remove + end + + css('> article', '.docs-method-prose', '.docs-method-signature', 'h2 > a', 'h3 > a', 'pre > code').each do |node| + node.before(node.children).remove + end + + css('.docs-method-edit', 'hr').remove + + css('pre').each do |node| + if node.content =~ /\A + Licensed under the MIT License. + HTML + + def get_latest_version(opts) + get_github_tags('moment', 'moment-timezone', opts)[0]['name'] + end + end +end diff --git a/public/icons/docs/moment_timezone/16.png b/public/icons/docs/moment_timezone/16.png new file mode 100644 index 0000000000000000000000000000000000000000..29c6b987285c5851ede8830fc59b20b48bee1a81 GIT binary patch literal 1377 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|T2doC(|mmy zw18|523AHP24;{FAY@>aVqgWc85q16rQz%#Mh&PMCI*J~Oa>OHnkXO*0v4nJa0`PlBg3pY5xV%QuQiw3qZOUY$~jP%-qzHM1_jnoV;SI3R@+x3M(KRB&@Hb09I0xZL1XF8=&Bv zUzDm~re~mMpk&9TprBw=l#*r@P?Wt5Z@Sn2DRmzV368|&p4rRy77T3YHG z80i}s=>k>g7FXt#Bv$C=6)QswftllyTAW;zSx}Ohp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q1x4w;yAYt8`NPTwM7lRGMSe;1gKSlsODa1RyvBrFj#n_4qNWK<9p2XMW zzJ`icJiSQ+%rXq82EdWzXJ%&c-I4BH7+SKTpir-448~$i##VOqiUN`a;$@WRibmET z7drGJ-5Zv&Go^H8ph!vMM^>bHsd~eZC7Q1>xM*c;+cjLh@)HRm4?me)$(WWo4-sMM zh1{Dsuo7QjBHVr$(^yHKD3EN-$0@}bX2nW0;jy1%U^2}%z%G$cy)uDoI4+}F>b=d# z^*8ZDHpLpD;4_r+K;b=_maexXEeQE5ce75`ZOa2omu0=d!KE|6jw6ppaSg|16t2__ zmSxV;$6**W8RH4*K;!(2WK#K_y2{P0%dQKdn=u$m>#)yMPf``7nNHWcxFlaf2&a4% z0nm*o-w`#<%Wx%mn2G&UJu#t2niEsbOD|_ZwcB@J>6Sd-k*zC zRG;~OD9g1Gu^RC%eVAw??&_zRHiCQG8+YU5G|>nibMg9re4hUcgc&?W0xcuC00000 LNkvXXu0mjfdNwsg literal 0 HcmV?d00001 diff --git a/public/icons/docs/moment_timezone/SOURCE b/public/icons/docs/moment_timezone/SOURCE new file mode 100644 index 00000000..f3616477 --- /dev/null +++ b/public/icons/docs/moment_timezone/SOURCE @@ -0,0 +1 @@ +https://momentjs.com/static/img/moment-timezone-favicon.png \ No newline at end of file