generate-resources: moved the RST template to a separate file
Signed-off-by: Grzegorz Latosinski <glatosinski@antmicro.com>
This commit is contained in:
parent
5a151a7f76
commit
c4ed34efb0
|
@ -20,7 +20,7 @@ ICCAD 2020
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
**Conference Dates:** 2nd November 2020 to 5th November 2020
|
**Conference Dates:** 2nd November 2020 to 5th November 2020
|
||||||
|
|
||||||
* `https://iccad.com/event_details?id=305-8-D <https://iccad.com/event_details?id=305-8-D>`__
|
* `https://iccad.com/event_details?id=305-8-D <https://iccad.com/event_details?id=305-8-D>`__
|
||||||
|
|
||||||
WOSET 2020
|
WOSET 2020
|
||||||
|
@ -108,3 +108,4 @@ Courses
|
||||||
|
|
||||||
* `VLSI Systems Design course main page <https://inst.eecs.berkeley.edu/~cs250/fa20/>`__
|
* `VLSI Systems Design course main page <https://inst.eecs.berkeley.edu/~cs250/fa20/>`__
|
||||||
* `Lab - Intro to OpenLane and Skywater 130 <https://inst.eecs.berkeley.edu/~cs250/fa20/labs/lab1/>`__
|
* `Lab - Intro to OpenLane and Skywater 130 <https://inst.eecs.berkeley.edu/~cs250/fa20/labs/lab1/>`__
|
||||||
|
|
||||||
|
|
|
@ -70,4 +70,8 @@ setup(
|
||||||
'Bug Reports': 'https://github.com/google/skywater-pdk/issues',
|
'Bug Reports': 'https://github.com/google/skywater-pdk/issues',
|
||||||
'Source': 'https://github.com/google/skywater-pdk/',
|
'Source': 'https://github.com/google/skywater-pdk/',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
package_data = {
|
||||||
|
'skywater_pdk': ['templates/resources.template.rst'],
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -18,111 +18,17 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
import argparse
|
import argparse
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import errno
|
import errno
|
||||||
from jinja2 import Template
|
from jinja2 import Template
|
||||||
|
import importlib.resources as resources
|
||||||
|
|
||||||
|
sys.path.insert(0, os.path.abspath(__file__ + '../'))
|
||||||
|
|
||||||
resources_rst_template = """Further Resources
|
from skywater_pdk import templates
|
||||||
=================
|
|
||||||
|
|
||||||
|
|
||||||
News Articles
|
|
||||||
-------------
|
|
||||||
|
|
||||||
{% for _, row in news_articles.iterrows() -%}
|
|
||||||
* `{{ row["Article"] }} <{{ row["Link"] }}>`__
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
Conferences
|
|
||||||
-----------
|
|
||||||
{% for _, row in conferences.iterrows() -%}
|
|
||||||
|
|
||||||
{% if row["Conference"] %}
|
|
||||||
{{ row["Conference"] }}
|
|
||||||
{{ '~' * row["Conference"]|length }}
|
|
||||||
|
|
||||||
{% endif -%}
|
|
||||||
{% if row["Description"] -%}
|
|
||||||
{{ row["Description"] }}
|
|
||||||
|
|
||||||
{% endif -%}
|
|
||||||
{% if row["Related link"] -%}
|
|
||||||
* `{{ row["Related link"] }} <{{ row["Related link"] }}>`__
|
|
||||||
{% endif -%}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
Talk Series
|
|
||||||
-----------
|
|
||||||
{% for _, row in talk_series.iterrows() -%}
|
|
||||||
{% if row["Talk series"] %}
|
|
||||||
{{ row["Talk series"] }}
|
|
||||||
{{ '~' * row["Talk series"]|length }}
|
|
||||||
{% if row["Description"] %}
|
|
||||||
{{ row["Description"] }}
|
|
||||||
{% endif -%}
|
|
||||||
{% if row["Page"] %}
|
|
||||||
**Page**: {{ row["Page"] }}
|
|
||||||
{% endif -%}
|
|
||||||
{% endif %}
|
|
||||||
{{ row["Title"] }}
|
|
||||||
{{ '^' * row["Title"]|length }}
|
|
||||||
|
|
||||||
{% if row["Presenter"] -%}
|
|
||||||
**Presenter**: {{ row["Presenter"] }}
|
|
||||||
{% endif -%}
|
|
||||||
{% if row["Talk details"] -%}
|
|
||||||
**Details**: {{ row["Talk details"] }}
|
|
||||||
{% endif -%}
|
|
||||||
{% if row["Video link"] -%}
|
|
||||||
{% if row["Video"] -%}
|
|
||||||
**Video**: `{{ row["Video"] }} <{{ row["Video link"] }}>`__
|
|
||||||
{% else -%}
|
|
||||||
**Video**: `{{ row["Video link"] }} <{{ row["Video link"] }}>`__
|
|
||||||
{% endif -%}
|
|
||||||
{% endif -%}
|
|
||||||
{% if row["Slides PPTX link"] -%}
|
|
||||||
{% if row["Slides PPTX"] -%}
|
|
||||||
**Video**: `{{ row["Slides PPTX"] }} <{{ row["Slides PPTX link"] }}>`__
|
|
||||||
{% else -%}
|
|
||||||
**Video**: `{{ row["Slides PPTX link"] }} <{{ row["Slides PPTX link"] }}>`__
|
|
||||||
{% endif -%}
|
|
||||||
{% endif -%}
|
|
||||||
{% if row["Slides PDF link"] -%}
|
|
||||||
{% if row["Slides PDF"] -%}
|
|
||||||
**Video**: `{{ row["Slides PDF"] }} <{{ row["Slides PDF link"] }}>`__
|
|
||||||
{% else -%}
|
|
||||||
**Video**: `{{ row["Slides PDF link"] }} <{{ row["Slides PDF link"] }}>`__
|
|
||||||
{% endif -%}
|
|
||||||
{% endif -%}
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
LinkedIn Posts
|
|
||||||
--------------
|
|
||||||
|
|
||||||
{% for _, row in linkedin.iterrows() -%}
|
|
||||||
* `{{ row["Title"] }} <{{ row["Link"] }}>`__
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
Courses
|
|
||||||
-------
|
|
||||||
|
|
||||||
{% for _, row in courses.iterrows() -%}
|
|
||||||
{% if row["Courses"] %}
|
|
||||||
{{ row["Courses"] }}
|
|
||||||
{{ '~' * row["Courses"]|length }}
|
|
||||||
{% endif -%}
|
|
||||||
{% if row["Link"] -%}
|
|
||||||
{% if row["Link title"] -%}
|
|
||||||
* `{{ row["Link title"] }} <{{ row["Link"] }}>`__
|
|
||||||
{% else -%}
|
|
||||||
* `{{ row["Link"] }} <{{ row["Link"] }}>`__
|
|
||||||
{% endif -%}
|
|
||||||
{% endif -%}
|
|
||||||
{% endfor %}
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
def parse_entries(filepath, sheet_name, cols=None):
|
def parse_entries(filepath, sheet_name, cols=None):
|
||||||
|
@ -183,17 +89,21 @@ def main(argv):
|
||||||
linkedin = parse_entries(input_file, 'LinkedIn Posts')
|
linkedin = parse_entries(input_file, 'LinkedIn Posts')
|
||||||
courses = parse_entries(input_file, 'Courses')
|
courses = parse_entries(input_file, 'Courses')
|
||||||
|
|
||||||
tm = Template(resources_rst_template)
|
with resources.path(templates, 'resources.template.rst') as resourcepath:
|
||||||
resources_rst_content = tm.render(
|
with open(resourcepath, 'r') as resourcetemplate:
|
||||||
news_articles=news_articles,
|
resources_rst_template = resourcetemplate.read()
|
||||||
talk_series=talk_series,
|
|
||||||
conferences=conferences,
|
|
||||||
linkedin=linkedin,
|
|
||||||
courses=courses
|
|
||||||
)
|
|
||||||
|
|
||||||
with open(args.output, 'w') as out:
|
tm = Template(resources_rst_template)
|
||||||
out.write(resources_rst_content)
|
resources_rst_content = tm.render(
|
||||||
|
news_articles=news_articles,
|
||||||
|
talk_series=talk_series,
|
||||||
|
conferences=conferences,
|
||||||
|
linkedin=linkedin,
|
||||||
|
courses=courses
|
||||||
|
)
|
||||||
|
|
||||||
|
with open(args.output, 'w') as out:
|
||||||
|
out.write(resources_rst_content)
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
Further Resources
|
||||||
|
=================
|
||||||
|
|
||||||
|
|
||||||
|
News Articles
|
||||||
|
-------------
|
||||||
|
|
||||||
|
{% for _, row in news_articles.iterrows() -%}
|
||||||
|
* `{{ row["Article"] }} <{{ row["Link"] }}>`__
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
Conferences
|
||||||
|
-----------
|
||||||
|
{% for _, row in conferences.iterrows() -%}
|
||||||
|
|
||||||
|
{% if row["Conference"] %}
|
||||||
|
{{ row["Conference"] }}
|
||||||
|
{{ '~' * row["Conference"]|length }}
|
||||||
|
|
||||||
|
{% endif -%}
|
||||||
|
{% if row["Description"] -%}
|
||||||
|
{{ row["Description"] }}
|
||||||
|
|
||||||
|
{% endif -%}
|
||||||
|
{% if row["Related link"] -%}
|
||||||
|
* `{{ row["Related link"] }} <{{ row["Related link"] }}>`__
|
||||||
|
{% endif -%}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
Talk Series
|
||||||
|
-----------
|
||||||
|
{% for _, row in talk_series.iterrows() -%}
|
||||||
|
{% if row["Talk series"] %}
|
||||||
|
{{ row["Talk series"] }}
|
||||||
|
{{ '~' * row["Talk series"]|length }}
|
||||||
|
{% if row["Description"] %}
|
||||||
|
{{ row["Description"] }}
|
||||||
|
{% endif -%}
|
||||||
|
{% if row["Page"] %}
|
||||||
|
**Page**: {{ row["Page"] }}
|
||||||
|
{% endif -%}
|
||||||
|
{% endif %}
|
||||||
|
{{ row["Title"] }}
|
||||||
|
{{ '^' * row["Title"]|length }}
|
||||||
|
|
||||||
|
{% if row["Presenter"] -%}
|
||||||
|
**Presenter**: {{ row["Presenter"] }}
|
||||||
|
{% endif -%}
|
||||||
|
{% if row["Talk details"] -%}
|
||||||
|
**Details**: {{ row["Talk details"] }}
|
||||||
|
{% endif -%}
|
||||||
|
{% if row["Video link"] -%}
|
||||||
|
{% if row["Video"] -%}
|
||||||
|
**Video**: `{{ row["Video"] }} <{{ row["Video link"] }}>`__
|
||||||
|
{% else -%}
|
||||||
|
**Video**: `{{ row["Video link"] }} <{{ row["Video link"] }}>`__
|
||||||
|
{% endif -%}
|
||||||
|
{% endif -%}
|
||||||
|
{% if row["Slides PPTX link"] -%}
|
||||||
|
{% if row["Slides PPTX"] -%}
|
||||||
|
**Video**: `{{ row["Slides PPTX"] }} <{{ row["Slides PPTX link"] }}>`__
|
||||||
|
{% else -%}
|
||||||
|
**Video**: `{{ row["Slides PPTX link"] }} <{{ row["Slides PPTX link"] }}>`__
|
||||||
|
{% endif -%}
|
||||||
|
{% endif -%}
|
||||||
|
{% if row["Slides PDF link"] -%}
|
||||||
|
{% if row["Slides PDF"] -%}
|
||||||
|
**Video**: `{{ row["Slides PDF"] }} <{{ row["Slides PDF link"] }}>`__
|
||||||
|
{% else -%}
|
||||||
|
**Video**: `{{ row["Slides PDF link"] }} <{{ row["Slides PDF link"] }}>`__
|
||||||
|
{% endif -%}
|
||||||
|
{% endif -%}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
LinkedIn Posts
|
||||||
|
--------------
|
||||||
|
|
||||||
|
{% for _, row in linkedin.iterrows() -%}
|
||||||
|
* `{{ row["Title"] }} <{{ row["Link"] }}>`__
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
Courses
|
||||||
|
-------
|
||||||
|
|
||||||
|
{% for _, row in courses.iterrows() -%}
|
||||||
|
{% if row["Courses"] %}
|
||||||
|
{{ row["Courses"] }}
|
||||||
|
{{ '~' * row["Courses"]|length }}
|
||||||
|
{% endif -%}
|
||||||
|
{% if row["Link"] -%}
|
||||||
|
{% if row["Link title"] -%}
|
||||||
|
* `{{ row["Link title"] }} <{{ row["Link"] }}>`__
|
||||||
|
{% else -%}
|
||||||
|
* `{{ row["Link"] }} <{{ row["Link"] }}>`__
|
||||||
|
{% endif -%}
|
||||||
|
{% endif -%}
|
||||||
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in New Issue