Skip to content

Commit c0dbaaf

Browse files
authored
Merge pull request #1403 from MasterEnoc/twig
Update Twig to 3.1.1 and update previous versions
2 parents 23a0004 + 71d2b49 commit c0dbaaf

File tree

6 files changed

+29
-6
lines changed

6 files changed

+29
-6
lines changed

assets/javascripts/templates/pages/about_tmpl.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ credits = [
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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ module Docs
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 @@ def call
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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,33 @@ class Twig < UrlScraper
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'
1818

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

3237
def get_latest_version(opts)
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

343 Bytes
Loading
-626 Bytes
Loading

public/icons/docs/twig/SOURCE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
http://twig.sensiolabs.org/images/twig-logo.png
1+
https://twig.symfony.com/images/logo.png

0 commit comments

Comments
 (0)