File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 121121
122122 if 'site' in package ['badges' ]:
123123 if 'site' not in package :
124- package ['site' ] = '{}.org' .format (package ['repo_name' ])
125- package ['site_protocol' ] = 'https'
124+ package ['site' ] = f'https://{ package ["repo_name" ]} .org'
126125 else :
127- package ['site_protocol' ], package [ ' site' ] = package ['site' ].rstrip ('/' ). split ( ':/ /' )
126+ package ['site' ] = package ['site' ].rstrip ('/' )
128127
129- template = Template ((here / 'template.rst' ).read_text ())
128+ template = Template ((here / 'template.rst' ).read_text (),
129+ lstrip_blocks = True , trim_blocks = True )
130130
131131config = sorted (config , key = lambda i : i ['name' ])
132132
Original file line number Diff line number Diff line change 11.. raw :: html
22
33 <div >
4- <table id =" packages" >
5- {% for section in config %}
6- <tr >
7- <th colspan =5 >
8- {% with section_id = section.name | lower | replace(" ", "-") %}
9- <h3 id =" {{ section_id }}" >
10- {{ section.name }}
11- <a class =" headerlink" href =" #{{ section_id }}" title =" Permalink to this headline" >#</a >
12- </h3 >
13- {% endwith %}
14- </th >
15- </tr >
4+ <table id =" packages" >
5+ {% for section in config %}
6+ <tr >
7+ <th colspan =5 >
8+ {% with section_id = section.name | lower | replace(" ", "-") %}
9+ <h3 id =" {{ section_id }}" >
10+ {{ section.name }}
11+ <a class =" headerlink" href =" #{{ section_id }}" title =" Permalink to this headline" >#</a >
12+ </h3 >
13+ {% endwith %}
14+ </th >
15+ </tr >
1616
1717 {% for package in section.packages %}
1818 <tr >
19-
2019 <td >
2120 <a href =" https://github.com/{{ package.repo }}" >
2221 <img src =" _static/badges/github-gray.svg" >
3635 <img src =" _static/badges/conda-blue.svg" >
3736 </a >
3837 {% endif %}
39- </td >
38+ </td >
4039
41- <td >
42- {% if 'site' in package.badges %}
43- <a href =" {{ package.site_protocol}}://{{ package.site }}" >{{ package.name }}</a >
44- {% else %}
45- <a href =" https://github.com/{{ package.repo }}" >{{ package.name }}</a >
46- {% endif %}
47- </td >
48- <td >
49- {{ package.description }}
50- </td >
51-
40+ <td >
41+ {% if 'site' in package.badges %}
42+ <a href =" {{ package.site }}" >{{ package.name }}</a >
43+ {% else %}
44+ <a href =" https://github.com/{{ package.repo }}" >{{ package.name }}</a >
45+ {% endif %}
46+ </td >
47+ <td >
48+ {{ package.description }}
49+ </td >
5250
5351 </tr >
5452 {% endfor %}
55- {% endfor %}
53+ {% endfor %}
5654 </table >
57- </div >
55+ </div >
You can’t perform that action at this time.
0 commit comments