px_process_airframes: add image path as optional argument for markdown output

usage:
./px_process_airframes.py -m -i ../image/path
This commit is contained in:
Beat Küng
2017-07-14 11:57:11 +02:00
parent 63af349bba
commit 41e53ef949
2 changed files with 14 additions and 5 deletions
+4 -2
View File
@@ -1,8 +1,9 @@
from xml.sax.saxutils import escape
import codecs
import os
class MarkdownTablesOutput():
def __init__(self, groups, board):
def __init__(self, groups, board, image_path):
result = ("# Airframes Reference\n"
"> **Note** **This list is auto-generated from the source code**.\n"
"> \n"
@@ -28,7 +29,8 @@ class MarkdownTablesOutput():
image_name = group.GetImageName()
result += '<div>\n'
if image_name != 'AirframeUnknown':
result += '<img src="../../assets/airframes/types/%s.svg" width="29%%" style="max-height: 180px;"/>\n' % (image_name)
image_name = os.path.join(image_path, image_name)
result += '<img src="%s.svg" width="29%%" style="max-height: 180px;"/>\n' % (image_name)
# check if all outputs are equal for the group: if so, show them
# only once