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
Branches
Tags
1 merge request!89Docs updates - chapter restructuring, images, and more
Showing
with 23 additions and 27 deletions
{% 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-header">
{{board}}
......@@ -8,9 +8,9 @@
<p class="card-text text-dark">
<a href="https://certification.oshwa.org/{{ oshw_id|lower }}.html" target="_blank">
{% 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 %}
<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 %}
</a>
</p>
......
......@@ -33,12 +33,14 @@ for (dirpath, dirnames, filenames) in os.walk(rst_epilog_path):
latex_documents = []
pdf_paths = []
pdf_list = []
oshw_details = []
with open('conf.yml', 'r') as conf_file:
conf_data = yaml.safe_load(conf_file)
pdf_build_all = True
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
for type, data in conf_data.items():
......@@ -49,32 +51,19 @@ with open('conf.yml', 'r') as conf_file:
path = data['path']
pdf = data.get('pdf', False)
# PDF build details
if(pdf and (name in pdf_list or pdf_build_all)):
pdf_paths.append(path)
tex_name = '-'.join(path.split('/')[1:])
latex_documents.append((path+"/index", tex_name+".tex", "", author, "manual"))
# Board OSHWA certification information
oshw_logos_path = "_static/images/oshw/"
oshw_details = []
for (dirpath, dirnames, filenames) in os.walk(oshw_logos_path):
for filename in filenames:
if filename.endswith('.svg'):
oshw_logo_name = filename.split(".")[0]
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)
# OSHW mark details
oshw_data = data.get('oshw', False)
if oshw_data:
for oshw_mark_file in data['oshw'].split(','):
if oshw_mark_file.endswith('.svg'):
board, oshw_id = oshw_mark_file.lstrip().split(".")[0].split('_')
oshw_details.append([board, path, oshw_id])
# -- General configuration --
......
......@@ -5,17 +5,24 @@
# 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.
# Example: pdf_build: BeagleBone Black,BeagleBone AI-64
# Note: there is now space after comma!
# Example: pdf_build: BeagleBone Black, BeagleBone AI-64
pdf_build: all
# Boards
#
# Example:
# boards:
# name:
# path: <board path for index.rst>
# pdf: True/False
# oshw: <comma seprated file names from _static/images/oshw folder>
boards:
BeagleBone Black:
path: boards/beaglebone/black
pdf: True
oshw: BeagleBone Black_US000236.svg, BeagleBone Black Wireless_US000011.svg
BeagleBone AI-64:
path: boards/beaglebone/ai-64
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