mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-02 22:07:25 +02:00
Updated tutorials.
This commit is contained in:
@@ -15,7 +15,7 @@ done
|
|||||||
if [[ "$FILES" != "" ]]; then
|
if [[ "$FILES" != "" ]]; then
|
||||||
PREVIEW_LIBS="$FILES"
|
PREVIEW_LIBS="$FILES"
|
||||||
else
|
else
|
||||||
PREVIEW_LIBS="Shapes2d Shapes3d Transforms Distributors Mutators Paths FractalTree"
|
PREVIEW_LIBS="Shapes2d Shapes3d Transforms Distributors Mutators Attachments Paths FractalTree"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dir="$(basename $PWD)"
|
dir="$(basename $PWD)"
|
||||||
|
@@ -14,7 +14,7 @@ imgmgr = ImageManager()
|
|||||||
|
|
||||||
|
|
||||||
def img_started(req):
|
def img_started(req):
|
||||||
print(" {}... ".format(os.path.basename(req.src_file)), end='')
|
print(" {}... ".format(os.path.basename(req.image_file)), end='')
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ def processFile(infile, outfile=None, imgroot=""):
|
|||||||
|
|
||||||
outdata = []
|
outdata = []
|
||||||
with open(infile, "r") as f:
|
with open(infile, "r") as f:
|
||||||
script = []
|
script = ["include <BOSL2/std.scad>"]
|
||||||
extyp = ""
|
extyp = ""
|
||||||
in_script = False
|
in_script = False
|
||||||
imgnum = 0
|
imgnum = 0
|
||||||
@@ -67,26 +67,24 @@ def processFile(infile, outfile=None, imgroot=""):
|
|||||||
extyp = line.split("-")[1]
|
extyp = line.split("-")[1]
|
||||||
else:
|
else:
|
||||||
extyp = ""
|
extyp = ""
|
||||||
line = "```openscad"
|
|
||||||
script = []
|
|
||||||
show_script = "ImgOnly" not in extyp
|
show_script = "ImgOnly" not in extyp
|
||||||
|
script = ["include <BOSL2/std.scad>"]
|
||||||
imgnum = imgnum + 1
|
imgnum = imgnum + 1
|
||||||
if show_script:
|
|
||||||
outdata.append(line)
|
|
||||||
elif in_script:
|
elif in_script:
|
||||||
if show_script:
|
|
||||||
outdata.append(line)
|
|
||||||
if line == "```":
|
if line == "```":
|
||||||
in_script = False
|
in_script = False
|
||||||
imgfile = "{}_{}.png".format(fileroot, imgnum)
|
imgfile = os.path.join(imgroot, "{}_{}.png".format(fileroot, imgnum))
|
||||||
imgmgr.new_request(
|
imgmgr.new_request(
|
||||||
fileroot+".md", linenum,
|
fileroot+".md", linenum,
|
||||||
imgfile, script, extyp,
|
imgfile, script, extyp,
|
||||||
starting_cb=img_started,
|
starting_cb=img_started,
|
||||||
completion_cb=img_completed
|
completion_cb=img_completed
|
||||||
)
|
)
|
||||||
outdata.append("".format(imgnum, imgroot + imgfile))
|
if show_script:
|
||||||
script = []
|
outdata.append("```openscad")
|
||||||
|
outdata.extend(script)
|
||||||
|
outdata.append("```")
|
||||||
|
outdata.append("".format(imgnum, imgfile))
|
||||||
show_script = True
|
show_script = True
|
||||||
extyp = ""
|
extyp = ""
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user