|
19 | 19 | PEP_TEMPLATE = 'pages/pep-page.html'
|
20 | 20 | pep_url = lambda num: 'dev/peps/pep-{}/'.format(num)
|
21 | 21 |
|
| 22 | +# To simplify syntax highlighting, all literal blocks (those produced by ::) |
| 23 | +# in the following PEPs will be automatically highlighted using Python lexer. |
| 24 | +# PEP editors/authors could make simple PRs extending this list. |
| 25 | +# This will be not needed when PEPs are moved to RtD and all code blocks are |
| 26 | +# formatted using .. code:: language. |
22 | 27 | PURE_PYTHON_PEPS = [483, 484, 526]
|
23 | 28 |
|
24 | 29 | def get_peps_last_updated():
|
@@ -146,15 +151,15 @@ def convert_pep_page(pep_number, content):
|
146 | 151 | pep_content = BeautifulSoup(data['content'], 'lxml')
|
147 | 152 | body_links = pep_content.find_all("a")
|
148 | 153 | # Fix highlighting code
|
149 |
| - code_blocks = pep_content.find_all("pre", class_="code") |
| 154 | + code_blocks = pep_content.find_all('pre', class_='code') |
150 | 155 | for cb in code_blocks:
|
151 | 156 | del cb['class']
|
152 | 157 | div = pep_content.new_tag('div')
|
153 | 158 | div['class'] = ['highlight']
|
154 | 159 | cb.wrap(div)
|
155 | 160 | # Highlight existing pure-Python PEPs
|
156 | 161 | if int(pep_number) in PURE_PYTHON_PEPS:
|
157 |
| - literal_blocks = pep_content.find_all("pre", class_="literal-block") |
| 162 | + literal_blocks = pep_content.find_all('pre', class_='literal-block') |
158 | 163 | for lb in literal_blocks:
|
159 | 164 | block = lb.string
|
160 | 165 | if block:
|
|
0 commit comments