Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 55cd8362 authored by Deepak Khatri's avatar Deepak Khatri :dog:
Browse files

Add oshw: option for boards

parent 8f92b487
No related merge requests found
Showing
with 23 additions and 27 deletions
{% for board, path, oshw_id in oshw_details %} {% for board, path, oshw_id in oshw_details %}
{% if '/'+path+'/' in pagename %} {% if path in pagename %}
<div class="card bg-light mt-4 text-center"> <div class="card bg-light mt-4 text-center">
<div class="card-header"> <div class="card-header">
{{board}} {{board}}
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
<p class="card-text text-dark"> <p class="card-text text-dark">
<a href="https://certification.oshwa.org/{{ oshw_id|lower }}.html" target="_blank"> <a href="https://certification.oshwa.org/{{ oshw_id|lower }}.html" target="_blank">
{% if pages_slug %} {% if pages_slug %}
<img src="{{docs_url}}/_static/images/oshw/{{board}}_{{path | replace('/', '@')}}_{{oshw_id}}.svg" alt="{{board}} OSHW mark"/> <img src="{{docs_url}}/_static/images/oshw/{{board}}_{{oshw_id}}.svg" alt="{{board}} OSHW mark"/>
{% else %} {% else %}
<img src="../../../../_static/images/oshw/{{board}}_{{path | replace('/', '@')}}_{{oshw_id}}.svg" alt="{{board}} OSHW mark"/> <img src="../../../../_static/images/oshw/{{board}}_{{oshw_id}}.svg" alt="{{board}} OSHW mark"/>
{% endif %} {% endif %}
</a> </a>
</p> </p>
......
...@@ -33,12 +33,14 @@ for (dirpath, dirnames, filenames) in os.walk(rst_epilog_path): ...@@ -33,12 +33,14 @@ for (dirpath, dirnames, filenames) in os.walk(rst_epilog_path):
latex_documents = [] latex_documents = []
pdf_paths = [] pdf_paths = []
pdf_list = [] pdf_list = []
oshw_details = []
with open('conf.yml', 'r') as conf_file: with open('conf.yml', 'r') as conf_file:
conf_data = yaml.safe_load(conf_file) conf_data = yaml.safe_load(conf_file)
pdf_build_all = True pdf_build_all = True
if(conf_data["pdf_build"] != "all"): if(conf_data["pdf_build"] != "all"):
pdf_list = conf_data["pdf_build"].split(",") for name in conf_data["pdf_build"].split(","):
pdf_list.append(name.lstrip())
pdf_build_all = False pdf_build_all = False
for type, data in conf_data.items(): for type, data in conf_data.items():
...@@ -49,32 +51,19 @@ with open('conf.yml', 'r') as conf_file: ...@@ -49,32 +51,19 @@ with open('conf.yml', 'r') as conf_file:
path = data['path'] path = data['path']
pdf = data.get('pdf', False) pdf = data.get('pdf', False)
# PDF build details
if(pdf and (name in pdf_list or pdf_build_all)): if(pdf and (name in pdf_list or pdf_build_all)):
pdf_paths.append(path) pdf_paths.append(path)
tex_name = '-'.join(path.split('/')[1:]) tex_name = '-'.join(path.split('/')[1:])
latex_documents.append((path+"/index", tex_name+".tex", "", author, "manual")) latex_documents.append((path+"/index", tex_name+".tex", "", author, "manual"))
# Board OSHWA certification information # OSHW mark details
oshw_logos_path = "_static/images/oshw/" oshw_data = data.get('oshw', False)
oshw_details = [] if oshw_data:
for (dirpath, dirnames, filenames) in os.walk(oshw_logos_path): for oshw_mark_file in data['oshw'].split(','):
for filename in filenames: if oshw_mark_file.endswith('.svg'):
if filename.endswith('.svg'): board, oshw_id = oshw_mark_file.lstrip().split(".")[0].split('_')
oshw_logo_name = filename.split(".")[0] oshw_details.append([board, path, oshw_id])
board, path, oshw_id = oshw_logo_name.split('_')
path = path.replace('@','/')
oshw_details.append([board, path, oshw_id])
# Unique boards path information
# boards_path = []
# for board, path, oshw_id in oshw_details:
# for (dirpath, dirnames, filenames) in os.walk("boards"):
# if '/'+path+'/' in dirpath+'/':
# if path+'/' not in dirpath:
# boards_path.append(dirpath)
# boards_path = set(boards_path)
# print(boards_path)
# -- General configuration -- # -- General configuration --
......
...@@ -5,17 +5,24 @@ ...@@ -5,17 +5,24 @@
# all: If you want to build PDFs of all the listed boards, books, projects, etc. # all: If you want to build PDFs of all the listed boards, books, projects, etc.
# #
# name1,name2,name3: If you want to build PDF for specific boards, books, projects, etc. # name1,name2,name3: If you want to build PDF for specific boards, books, projects, etc.
# Example: pdf_build: BeagleBone Black,BeagleBone AI-64 # Example: pdf_build: BeagleBone Black, BeagleBone AI-64
# Note: there is now space after comma!
pdf_build: all pdf_build: all
# Boards # Boards
#
# Example:
# boards:
# name:
# path: <board path for index.rst>
# pdf: True/False
# oshw: <comma seprated file names from _static/images/oshw folder>
boards: boards:
BeagleBone Black: BeagleBone Black:
path: boards/beaglebone/black path: boards/beaglebone/black
pdf: True pdf: True
oshw: BeagleBone Black_US000236.svg, BeagleBone Black Wireless_US000011.svg
BeagleBone AI-64: BeagleBone AI-64:
path: boards/beaglebone/ai-64 path: boards/beaglebone/ai-64
pdf: True pdf: True
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment