From c939b2eba2b75667ec18584bd226174a1bb53bf8 Mon Sep 17 00:00:00 2001 From: Hasan al Rasyid Date: Tue, 22 Mar 2022 11:04:28 +0900 Subject: [PATCH] include script --- manuscript.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/manuscript.md b/manuscript.md index ef77d5c..a9982b4 100644 --- a/manuscript.md +++ b/manuscript.md @@ -492,6 +492,20 @@ sysrun(["wget 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c sysrun(["wget 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Bismillah.svg/640px-Bismillah.svg.png' -O _build/auto/pyImage.png"]) ~~~ +Instead of writing it into the body of the CodeBlock, we can put the script in another file, call it in the main manuscript and put the caption as the CodeBlock text. +The implementation of this mechanism is shown in Figure \ref{fig:pySrc}. + +``` +~~~{.script .py .img #fig:pySrc size=0.6 src=script/pyScript1.py file=pyImageS} +This image came from pyScript1.py that called using `src`. +~~~ +``` + +~~~{.script .py .img #fig:pySrc size=0.6 src=script/pyScript1.py file=pyImageS} +This image came from pyScript1.py that called using `src`. +~~~ + + The same rules apply to `.img .md .lib` of SHELL (`.sh`). Under the hood, pubsEngine will run the script under `zsh`. The library will be saved in `_build/temp/lib/sh`.