1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-06 07:27:23 +02:00

Project blurb can now be split with into sections with markdown horizonal rules

made with asterisks.
If an image is include in the first section the default image is supressed.
This commit is contained in:
Chris Palmer
2020-12-28 20:49:37 +00:00
parent 31bfa3b268
commit 8d22940506
3 changed files with 26 additions and 127 deletions

View File

@@ -39,8 +39,6 @@ def _scrape_blurb(lines):
if b:
break
text += t
if len(text):
text += '\n'
return text
def scrape_blurb(scad_file):
@@ -49,6 +47,16 @@ def scrape_blurb(scad_file):
lines = file.readlines()
return _scrape_blurb(lines)
def split_blurb(lines):
""" Split blurb on horizontal rules."""
blurbs = [""]
for line in lines.split('\n')[:-1]:
if line == "***":
blurbs.append("")
else:
blurbs[-1] += line + '\n'
return blurbs
def scrape_module_blurb(lines):
""" Find the Markup lines before the last function or module. """
text = ""