From 7a483c5f5f3a8c601d5d7c8bfc40f8df651cf5f0 Mon Sep 17 00:00:00 2001 From: MasterEnoc Date: Fri, 4 Dec 2020 19:06:25 -0600 Subject: [PATCH 1/3] Update Twig to 3.1.1 and update previous versions --- .../templates/pages/about_tmpl.coffee | 2 +- lib/docs/scrapers/twig.rb | 12 +++++++++--- public/icons/docs/twig/16.png | Bin 772 -> 613 bytes public/icons/docs/twig/16@2x.png | Bin 2411 -> 1041 bytes public/icons/docs/twig/SOURCE | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index afaf37a3..4e992a97 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -783,7 +783,7 @@ credits = [ 'https://raw.githubusercontent.com/python-trio/trio/master/LICENSE.MIT' ], [ 'Twig', - '2009-2018 The Twig Team', + '2009-2020 The Twig Team', 'BSD', 'https://twig.symfony.com/license' ], [ diff --git a/lib/docs/scrapers/twig.rb b/lib/docs/scrapers/twig.rb index e52ff6bd..aa7b8a6c 100755 --- a/lib/docs/scrapers/twig.rb +++ b/lib/docs/scrapers/twig.rb @@ -11,7 +11,7 @@ module Docs options[:attribution] = <<-HTML © 2009–2018 by the Twig Team
Licensed under the three clause BSD license.
- The Twig logo is © 2010–2018 Symfony + The Twig logo is © 2010–2020 Symfony HTML html_filters.push 'twig/clean_html', 'twig/entries' @@ -19,13 +19,18 @@ module Docs options[:container] = 'div.bd > div.content' options[:skip] = %w(deprecated.html advanced_legacy.html) + version '3' do + self.release = '3.1.1' + self.base_url = 'https://twig.symfony.com/doc/3.x/' + end + version '2' do - self.release = '2.5.0' + self.release = '2.14.1' self.base_url = 'https://twig.symfony.com/doc/2.x/' end version '1' do - self.release = '1.34.3' + self.release = '1.44.1' self.base_url = 'https://twig.symfony.com/doc/1.x/' end @@ -33,5 +38,6 @@ module Docs tags = get_github_tags('twigphp', 'Twig', opts) tags[0]['name'][1..-1] end + end end diff --git a/public/icons/docs/twig/16.png b/public/icons/docs/twig/16.png index 4ed5a5bad755b9452a6351ff98a02a3e61d69dc5..8824ffc96251a44483d0e4955924ec567738dd2d 100644 GIT binary patch literal 613 zcmeAS@N?(olHy`uVBq!ia0vp^{6H+g!3-q-bzC(AQY`6?zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIdW!{_@yeSZG;@1MW_{+zx!=l-(;AHF`>a3uTxzyE*#{yuec;gO4z|NZ~B;b`%_ zr^n~-NP6@B&YwTu{`~#<>(7^OKfiRXihlNL_us!izy5sr<;SznKOdfdytZb(&8xS& z|NZ;(@!Qk;Z;l?gHKk}a-?NMQuIx{ESQ(l1 zjRaq<0t!v?ba4#fxbEA3UF?tnk8|qs3kFdd)$2EXZ~On>=*|+~i_U&3r!CDJL>nXc zrbeljt2mmeedBVSAG07(>u@>iGB48~uiHabufA~0W1F+dtf2Etqu=`dk~;YM+pp$_ zCw_iRv6`(fke+c`^xACQqiO3TcH7GLsXsKfdR!E`{WtTicgFMd>+1KNy2xfZ<7c!> zLZkN~`6gR-euHVt9s*sbTH+c}l9E`GYL#4+3Zxi}42%qP4UKdSOhXI|tqcsTOf9v6 zq=7;D50OL^4Y~O#nQ4`{HHa-;a~G&V5@bVgep*R+Vo@rCV@iHfs)A>3VtQ&&YGO)d T;mK4`+%tH(`njxgN@xNAk**_N literal 772 zcmV+f1N;1mP)ObvgK~O zPm*C-+??Ux4Q=AuWu$fk#L;R5rbgkC)3&qi>cixWUUbx-qAz~FpBVrks-n5Wpmsk5=lsLo;m|!V1mK`O&SYlt2p)L; zau%#FJEX*DK6x}vHz|Yq5@h*m>%655l7A$5na#~S7E2>o**zZPyqlD5CCv=4(3rWw?uO+WX;kjgQD-JGPzP zlS(m6x7^AH-@U+V-#yL2le?0Oml&$-%Eah)7>R#Ze8A^_Ts>F2Bl669JLM1x8r?Q~s*+MA)cnj;Uc5#l1MV`owLaW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^(0`vxXI?f z%ex={ASc(qyIKCKIK&yLaJFVJbLQ;>-hcEfL=CL^&*gCEX(~Shgmt&z;`%=Cee%cr z(?`F~+2SEpA?)~qqiMw1E6(PB#rvQA3|+ru(Z0l_xs5diZGXeX{9ki`U(V*gM>pJ1 zxI-#G!6m)kB&~{Lx?#?v`5&l}x7^V6c*ynY&zP^@V@NH9&;PY!AmEf0##9tJ zjjFJUpK!JQ7uGrT&FZ5($SqQIIlxJt#Xqy?KOo{5RmThz$gsed%5;3lcobN**=+q! zY-YK*j}cEypV5W;C{X%iyxrd(&>m;4Q%Iz=7Vj*L+$P3l=A5hcPq^+&!XT{IJ(>bd zxr_BvZaPaCR+J*tm7y&AOae z6^Ai<2oVvBn1sj*h)R+qDnW$gMibM-0DUX;eM+zfu~?hUO@SCkbc$o34;?YKppnuV z%32tgj;8jT01$xzF<`|ZQX>cuQRz1;f`WC{d5<$9xMpeyJ!n#fUQF(!s6YTosG1C5 z0uWGDtSC*Pl+G|6dnO}~_nZGA0>)${0X-mqBBB_PY$L{dXhsHO1$X-K@S7kLL7#2L zW+wy~28|Gn5(Pj7L=r**KoANKquMaa=2hh}7Ek~|1VDj+0wO3P$rsibBebh{b+HWZ z#>Cu2HP3`J?o zD0?Wpiz>MW`L{6YW#002ovPDHLkV1lVLjBfw{ diff --git a/public/icons/docs/twig/SOURCE b/public/icons/docs/twig/SOURCE index e9916089..5d9a6be0 100644 --- a/public/icons/docs/twig/SOURCE +++ b/public/icons/docs/twig/SOURCE @@ -1 +1 @@ -http://twig.sensiolabs.org/images/twig-logo.png +https://twig.sensiolabs.org/images/twig-logo.png From 978f3e891dd9746647ea6bb4cd5c7b624e89b20e Mon Sep 17 00:00:00 2001 From: MasterEnoc Date: Sun, 6 Dec 2020 20:03:29 -0600 Subject: [PATCH 2/3] Change the logo of twig to the correct one --- public/icons/docs/twig/16.png | Bin 613 -> 1115 bytes public/icons/docs/twig/16@2x.png | Bin 1041 -> 1785 bytes public/icons/docs/twig/SOURCE | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/public/icons/docs/twig/16.png b/public/icons/docs/twig/16.png index 8824ffc96251a44483d0e4955924ec567738dd2d..fd97016c3901f51bf749320452e58c5b9b90f5bb 100644 GIT binary patch literal 1115 zcmZWnc~BEq9DWG~Fey{5Or@pHm{zJl!6lrABNHT&REQjbVxc29<9GlXr!B2hqzF~( zVAWbtC|89_LFFh!AV4&C2p~x|n~;zMLXuLjLSa1GN+0-Fr#s*Ko!|F+Z+G9h1a_<& z@ogdiz>UR>NrHY8TqIW~Xz3CEkf7U8K#!*b&{0MDJBtAG?K#Y(cmPV?2cWbZfETb- z>Hy#r0>E4*0MzRMY%QwkON;;jr%#CEFvRLekt!V0MCu3;jMd?e1^#aftxGEyOeJWP z*3KB6q^-ALcMW_w^;YNZE@7xl8?|1676Qs6BxvN2GQ49ju)YWBmPSa?Xo&`5uS63A z1EDGu^2O>Xg)X|epVHV5CorWbONM?30Rt%-D^}BlDk>yPQO2N>UfUD&P{meYNf2@@ zQH~|Zv~g0D35Q70eNZLWvgO*Oy52qfG0wOldqkHZ$I_I#k4JPV3M?671mh^M#I-<| zs?=vFvGlrLTDLSqYyM28&y(r09vSk-CNoF%hsGvzCXB~))8$Jm==fybxS;^1nyKQt zUV76|nr6C8pgAJb9oLw+6UO7JsX~qEQ%E-1Z!9fqQ1ch4`Af`l#$dhBG8kLKKVWv$ zb;t{Z+G71o1!gIQOoO$`Z2!?V-wD61arQFAl<9mAEjNjs4E?JI@8m>qAvocjJ+{5EWfKvPBe;1TrTgvLw%HZu z?CxDuot8-R@gO?kcI-PTx%SP8po|%|b1R8}zt_kMf~Uh}?~jeCb?#s4fXT)p=E0Nju5VdeIB=uJ0~TGltayft z^)3{}CK3%srg{ a`Tqq0!LI~`UT0oH0bnuMF?XUf%l-u&fgKkB delta 524 zcmcc3@svfeGr-TCmrII^fq{Y7)59eQNb>`+00%RW{MT{SY@(uFJ;Uk%pAgso|Ns93 zfxkfd@84e!pYQ+l`T5_!fBydabNc3-`_B%1`1)kSk?jBf{{Q{^`_#>aM=nnO_y6C9 zqs8~09-qG>>CO8)fBt;?^Y`bkKVQE6{L-~5`q``9fB*jc`t#+NAJ0Dje0cux+M4+` zuiozd_wUcgZ%^;PIeOsMl%m;uU+TYJdi?gxfopSby*M^uli`=|_x}F-`{>Q-6^D~A zJla^ci1EeSbFV&LKX!e>+t2r|KG^m7+l$k;uC)R^z?kIi?!wT)D(eB{u$OrHy0Smv zVP$02Hxhic3Me$m)5S4_u3f2*y?dn==R^tx851g)32-Fcj_XW z<&2-vE(wj^hvb`V+4&8oEqe%bo@$9}L`h2GC#5QQ<|d}62BjvZR2H60wE-$(@O1Ta JS?83{1OP3~4-NnT diff --git a/public/icons/docs/twig/16@2x.png b/public/icons/docs/twig/16@2x.png index 731f3488d6741056471ec0246be13d54818d1484..952f229433ca3b9c801ca70ee623eae25541e016 100644 GIT binary patch delta 1696 zcmV;R24DG+2>A^miBL{Q4GJ0x0000DNk~Le0000W0000N2nGNE0BQwI;gKOee*gwz zOGiWi{{a60|De66lK=n!32;bRa{vGf6951U69E94oEQKA00(qQO+^Rf3(KnE==&50}or2$TSD?;k&UYk=@ZP}WUgQwN+J zFKrmzE zid7(JfM0^}uY`DA0taM9e*q{Li?n`oZ|mXEFIG>F`d>J-#WTMG+7_ry@(cz*2e2hW zEwzy>E|r8|sYG}KrXZ~axK=lzZcF=YHb4E<(W3kNX3eL5me@$J2e1Gz2QUMC?q`|H zRQEZH*_Qy2E_(CsgF6loAKw1tOPlZ_cuR22v$l4&Hx9;CkHh)+e?!uCNZTcC7qshV z*WoG|u8?s34pt4&5`HsKERP2a0f(( zzn&9;3=~TPRFbLzc7&#+t&?$UeQiBIIoU7zmG5?CeRBTZ3gA4Yek)--i7e#EawIyk z6Xrn506p4927Gj6PkENdbmC2U3xB?Uj30mSIf7V|v;eRme^`^&5n;`N4bR%1bQ^KC zdW88hUAZ=GLIy!#0KDnbLZrPE%SFaW!rVP2XU>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cQvDE9d7SX5k6YKf74 zjFzFiqOz)5Xqah@f74Z4hx&%bCb-Q9VrXtbYa7}-I=kRDyW;5X0ebuT2L^|%!W_dR zaA9<8d}7jLd615&Y0O}DZhk?Y?{~gLi%ZL5c4c*K-FgJV#^x5bv9r6kFQ~~f9pLcj z_ynhC=NHyl&A{c=HE?r#cmLqD1j+H}eR6u9UtZtdxrvHgC5?~IFE_+SP4oAaiTQkn z^~Z?@*JYbLM$IxsLgH90FVFgh?W7NxA+0000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oe Ud2z{QJOBUy07*qoM6N<$f+W!xFaQ7m diff --git a/public/icons/docs/twig/SOURCE b/public/icons/docs/twig/SOURCE index 5d9a6be0..d5ed9786 100644 --- a/public/icons/docs/twig/SOURCE +++ b/public/icons/docs/twig/SOURCE @@ -1 +1 @@ -https://twig.sensiolabs.org/images/twig-logo.png +https://twig.symfony.com/images/logo.png From 71d2b494856e8e3258f136dfae30b5cb2838fac1 Mon Sep 17 00:00:00 2001 From: MasterEnoc Date: Tue, 8 Dec 2020 12:04:56 -0600 Subject: [PATCH 3/3] Fix code blocks style and add syntax highlight --- lib/docs/filters/twig/clean_html.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/docs/filters/twig/clean_html.rb b/lib/docs/filters/twig/clean_html.rb index 0669950f..3754e80a 100644 --- a/lib/docs/filters/twig/clean_html.rb +++ b/lib/docs/filters/twig/clean_html.rb @@ -2,7 +2,8 @@ module Docs class Twig class CleanHtmlFilter < Filter def call - css('.infobar', '.offline-docs', '.headerlink').remove + + css('.infobar', '.offline-docs', '.headerlink', '.linenos').remove css('.builtin-reference', '.admonition-wrapper', 'h1 > code', 'h2 > code', '.body-web', '.reference em').each do |node| node.before(node.children).remove @@ -33,7 +34,23 @@ module Docs node['style'] = 'text-align: center' end + # syntax highlight + css('.highlight').each do |node| + node.css('pre').each do |subnode| + subnode['data-language'] = 'php' + subnode.add_class('highlight') + end + end + + # fix code blocks style + css('.highlighttable').each do |node| + code = node.at_css('pre') + node.before(code) + node.remove + end + doc + end end end