From 0484200fade64baa467fe07ae7abd401cad0931e Mon Sep 17 00:00:00 2001 From: Flo Greistorfer Date: Tue, 17 Sep 2024 13:19:24 +0200 Subject: [PATCH] update README --- README.md | 3 +- help.svg | 142 +++++++++++++++++++------------------- modules/argumentparser.py | 12 ++-- 3 files changed, 79 insertions(+), 78 deletions(-) diff --git a/README.md b/README.md index 7fcd446..f34d4ec 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,14 @@ Python script to generate static HTML files for website galleries. - `Pillow` library - `rich_argparse` library - `cairosvg` library (for SVG to PNG icon conversion) +- `python-json-logger` library (for logging) ## Installation Install the required libraries using pip: ```sh -pip install numpy tqdm Jinja2 Pillow rich-argparse cairosvg +pip install numpy tqdm Jinja2 Pillow rich-argparse cairosvg python-json-logger ``` ## Usage diff --git a/help.svg b/help.svg index bfc9ace..28735f2 100644 --- a/help.svg +++ b/help.svg @@ -19,118 +19,118 @@ font-weight: 700; } - .terminal-3756623299-matrix { + .terminal-2271905219-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-3756623299-title { + .terminal-2271905219-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-3756623299-r1 { fill: #ff8700 } -.terminal-3756623299-r2 { fill: #c5c8c6 } -.terminal-3756623299-r3 { fill: #808080 } -.terminal-3756623299-r4 { fill: #68a0b3 } -.terminal-3756623299-r5 { fill: #00af87 } + .terminal-2271905219-r1 { fill: #ff8700 } +.terminal-2271905219-r2 { fill: #c5c8c6 } +.terminal-2271905219-r3 { fill: #808080 } +.terminal-2271905219-r4 { fill: #68a0b3 } +.terminal-2271905219-r5 { fill: #00af87 } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -142,40 +142,40 @@ - + - - Usage:builder.py [-h-pROOT-wURL-tTITLE [-r] [-n] [-lLICENSE] [-aAUTHOR] [-eEXTENSION] [-m] -                  [--theme-pathPATH] [--use-fancy-folders] [--ignore-other-files] [--exclude-folderFOLDER] -                  [--version] - -Generate HTML files for a static image hosting website. - -Options: --h--helpshow this help message and exit --p--root-directoryROOT -Root directory containing the images. --w--web-root-urlURL -Base URL of the web root for the image hosting site. --t--site-titleTITLE -Title of the image hosting site. --r--regenerate-thumbnails -Regenerate thumbnails even if they already exist. --n--non-interactive-mode -Run in non-interactive mode, disabling progress bars. --l--license-typeLICENSE -Specify the license type for the images. --a--author-nameAUTHOR -Name of the author of the images. --e--file-extensionsEXTENSION -File extensions to include (can be specified multiple times). --m--web-manifestGenerate a web manifest file. ---theme-pathPATHPath to the CSS theme file. ---use-fancy-foldersEnable fancy folder view instead of the default Apache directory listing. ---ignore-other-filesIgnore files that do not match the specified extensions. ---exclude-folderFOLDER -Folders to exclude from processing, globs supported (can be specified multiple times). ---versionshow program's version number and exit + + Usage:builder.py [-h] [-aAUTHOR] [-eEXTENSION] [-lLICENSE] [-m] [-n-pROOT [-r-tTITLE-wURL +                  [--exclude-folderFOLDER] [--ignore-other-files] [--theme-pathPATH] [--use-fancy-folders] +                  [--version] + +Generate HTML files for a static image hosting website. + +Options: +-h--helpshow this help message and exit +-a--author-nameAUTHOR +Name of the author of the images. +-e--file-extensionsEXTENSION +File extensions to include (can be specified multiple times). +-l--license-typeLICENSE +Specify the license type for the images. +-m--web-manifestGenerate a web manifest file. +-n--non-interactive-mode +Run in non-interactive mode, disabling progress bars. +-p--root-directoryROOT +Root directory containing the images. +-r--regenerate-thumbnails +Regenerate thumbnails even if they already exist. +-t--site-titleTITLE +Title of the image hosting site. +-w--web-root-urlURL +Base URL of the web root for the image hosting site. +--exclude-folderFOLDER +Folders to exclude from processing, globs supported (can be specified multiple times). +--ignore-other-filesIgnore files that do not match the specified extensions. +--theme-pathPATHPath to the CSS theme file. +--use-fancy-foldersEnable fancy folder view instead of the default Apache directory listing. +--versionshow program's version number and exit diff --git a/modules/argumentparser.py b/modules/argumentparser.py index e300bb0..cd62c5a 100644 --- a/modules/argumentparser.py +++ b/modules/argumentparser.py @@ -99,12 +99,6 @@ def parse_arguments(version: str) -> Args: """ # fmt: off parser = argparse.ArgumentParser(description="Generate HTML files for a static image hosting website.", formatter_class=RichHelpFormatter) - parser.add_argument("--exclude-folder", help="Folders to exclude from processing, globs supported (can be specified multiple times).", action="append", dest="exclude_folders", metavar="FOLDER") - parser.add_argument("--generate-help-preview", action=HelpPreviewAction, path="help.svg") - parser.add_argument("--ignore-other-files", help="Ignore files that do not match the specified extensions.", action="store_true", default=False, dest="ignore_other_files") - parser.add_argument("--theme-path", help="Path to the CSS theme file.", default=DEFAULT_THEME_PATH, type=str, dest="theme_path", metavar="PATH") - parser.add_argument("--use-fancy-folders", help="Enable fancy folder view instead of the default Apache directory listing.", action="store_true", default=False, dest="use_fancy_folders") - parser.add_argument("--version", action="version", version=f"%(prog)s {version}") parser.add_argument("-a", "--author-name", help="Name of the author of the images.", default=DEFAULT_AUTHOR, type=str, dest="author_name", metavar="AUTHOR") parser.add_argument("-e", "--file-extensions", help="File extensions to include (can be specified multiple times).", action="append", dest="file_extensions", metavar="EXTENSION") parser.add_argument("-l", "--license-type", help="Specify the license type for the images.", choices=["cc-zero", "cc-by", "cc-by-sa", "cc-by-nd", "cc-by-nc", "cc-by-nc-sa", "cc-by-nc-nd"], default=None, dest="license_type", metavar="LICENSE") @@ -114,6 +108,12 @@ def parse_arguments(version: str) -> Args: parser.add_argument("-r", "--regenerate-thumbnails", help="Regenerate thumbnails even if they already exist.", action="store_true", default=False, dest="regenerate_thumbnails") parser.add_argument("-t", "--site-title", help="Title of the image hosting site.", required=True, type=str, dest="site_title", metavar="TITLE") parser.add_argument("-w", "--web-root-url", help="Base URL of the web root for the image hosting site.", required=True, type=str, dest="web_root_url", metavar="URL") + parser.add_argument("--exclude-folder", help="Folders to exclude from processing, globs supported (can be specified multiple times).", action="append", dest="exclude_folders", metavar="FOLDER") + parser.add_argument("--generate-help-preview", action=HelpPreviewAction, path="help.svg", ) + parser.add_argument("--ignore-other-files", help="Ignore files that do not match the specified extensions.", action="store_true", default=False, dest="ignore_other_files") + parser.add_argument("--theme-path", help="Path to the CSS theme file.", default=DEFAULT_THEME_PATH, type=str, dest="theme_path", metavar="PATH") + parser.add_argument("--use-fancy-folders", help="Enable fancy folder view instead of the default Apache directory listing.", action="store_true", default=False, dest="use_fancy_folders") + parser.add_argument("--version", action="version", version=f"%(prog)s {version}") parsed_args = parser.parse_args() # fmt: on _args = Args(