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:
@@ -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 = ""
|
||||
|
Reference in New Issue
Block a user