-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added substitution to LayerType - added `--no-fail` to read - added glob and convert_{length, angle, page_size} to expr symbols - disabled numpy from expr - grid now sets page size - fixed logging to print fully substituted arguments - added args logging to @block_processor - added example for interactive grid - doc: renamed metadata section to properties
- Loading branch information
Showing
12 changed files
with
296 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Ask user for some information, using sensible defaults. | ||
eval "files=glob(input('Files [*.svg]? ') or '*.svg')" # glob() creates a list of file based on a pattern | ||
eval "cols=int(input('Number of columns [3]? ') or 3)" | ||
eval "rows=ceil(len(files)/cols)" # the number of rows depends on the number of files | ||
eval "col_width=convert_length(input('Column width [10cm]? ') or '10cm')" # convert_length() converts string like '3cm' to pixels | ||
eval "row_height=convert_length(input('Row height [10cm]? ') or '10cm')" | ||
eval "margin=convert_length(input('Margin [0.5cm]? ') or '0.5cm')" | ||
eval "output_path=input('Output path [output.svg]? ') or 'output.svg'" | ||
|
||
# Create a grid with provided parameters. | ||
grid -o %col_width% %row_height% %cols% %rows% | ||
|
||
# Read the `_i`-th file. The last row may be incomplete so we use an empty path and `--no-fail`. | ||
read --no-fail "%files[_i] if _i < len(files) else ''%" | ||
|
||
# Layout the file in the cell. | ||
layout -m %margin% %col_width%x%row_height% | ||
end | ||
|
||
# wWrite the output file. | ||
write "%output_path%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.