History

Merge pull request #1403 from MasterEnoc/twig

Update Twig to 3.1.1 and update previous versions

Simon Legner committed 5 years ago

Commit c0dbaaf2 parents 23a0004 71d2b496 files · +27 −4Browse files

Unified · Split

6 files
  1. assets/javascripts/templates/pages/about_tmpl.coffee +1 −1
  2. lib/docs/filters/twig/clean_html.rb +18 −1
  3. lib/docs/scrapers/twig.rb +9 −3
  4. public/icons/docs/twig/16.png +0 −0
  5. public/icons/docs/twig/16@2x.png +0 −0
  6. public/icons/docs/twig/SOURCE +1 −1
assets/javascripts/templates/pages/about_tmpl.coffee+1−1
@@ -798,7 +798,7 @@ credits = [ · 797 unmodified lines
798798 'https://raw.githubusercontent.com/python-trio/trio/master/LICENSE.MIT'
799799 ], [
800800 'Twig',
801− '2009-2018 The Twig Team',
801+ '2009-2020 The Twig Team',
802802 'BSD',
803803 'https://twig.symfony.com/license'
804804 ], [
lib/docs/filters/twig/clean_html.rb+18−1
@@ -2,7 +2,8 @@ module Docs · 1 unmodified line
22 class Twig
33 class CleanHtmlFilter < Filter
44 def call
5− css('.infobar', '.offline-docs', '.headerlink').remove
5+
6+ css('.infobar', '.offline-docs', '.headerlink', '.linenos').remove
67
78 css('.builtin-reference', '.admonition-wrapper', 'h1 > code', 'h2 > code', '.body-web', '.reference em').each do |node|
89 node.before(node.children).remove
@@ -33,7 +34,23 @@ module Docs · 24 unmodified lines
3334 node['style'] = 'text-align: center'
3435 end
3536
37+ # syntax highlight
38+ css('.highlight').each do |node|
39+ node.css('pre').each do |subnode|
40+ subnode['data-language'] = 'php'
41+ subnode.add_class('highlight')
42+ end
43+ end
44+
45+ # fix code blocks style
46+ css('.highlighttable').each do |node|
47+ code = node.at_css('pre')
48+ node.before(code)
49+ node.remove
50+ end
51+
3652 doc
53+
3754 end
3855 end
3956 end
lib/docs/scrapers/twig.rb+9−3
@@ -11,7 +11,7 @@ module Docs · 10 unmodified lines
1111 options[:attribution] = <<-HTML
1212 &copy; 2009&ndash;2018 by the Twig Team<br>
1313 Licensed under the three clause BSD license.<br>
14− The Twig logo is &copy; 2010&ndash;2018 Symfony
14+ The Twig logo is &copy; 2010&ndash;2020 Symfony
1515 HTML
1616
1717 html_filters.push 'twig/clean_html', 'twig/entries'
@@ -19,13 +19,18 @@ module Docs · 1 unmodified line
1919 options[:container] = 'div.bd > div.content'
2020 options[:skip] = %w(deprecated.html advanced_legacy.html)
2121
22+ version '3' do
23+ self.release = '3.1.1'
24+ self.base_url = 'https://twig.symfony.com/doc/3.x/'
25+ end
26+
2227 version '2' do
23− self.release = '2.5.0'
28+ self.release = '2.14.1'
2429 self.base_url = 'https://twig.symfony.com/doc/2.x/'
2530 end
2631
2732 version '1' do
28− self.release = '1.34.3'
33+ self.release = '1.44.1'
2934 self.base_url = 'https://twig.symfony.com/doc/1.x/'
3035 end
3136
@@ -33,5 +38,6 @@ module Docs · 1 unmodified line
3338 tags = get_github_tags('twigphp', 'Twig', opts)
3439 tags[0]['name'][1..-1]
3540 end
41+
3642 end
3743 end
public/icons/docs/twig/16.png+0−0

Binary file not shown.

public/icons/docs/twig/16@2x.png+0−0

Binary file not shown.

public/icons/docs/twig/SOURCE+1−1
@@ -1 +1 @@
1−http://twig.sensiolabs.org/images/twig-logo.png
1+https://twig.symfony.com/images/logo.png