# HG changeset patch # User Paul Boddie # Date 1555021245 -7200 # Node ID 2dfd5da0c8bae462c4c37fa1bb843a97eeec9511 # Parent 803fdc74290320fef7cfb1de1748f457780b0159 Added support for specifying the attachments directory name. diff -r 803fdc742903 -r 2dfd5da0c8ba moinconvert --- a/moinconvert Fri Apr 12 00:08:39 2019 +0200 +++ b/moinconvert Fri Apr 12 00:20:45 2019 +0200 @@ -85,6 +85,7 @@ # Option values. + attachments_dir = [] document_indexes = [] filenames = [] formats = [] @@ -112,20 +113,35 @@ for arg in args: - # Detect tree output. + # Flags with no following arguments. + + # Detect all documents. - if arg == "--tree": - tree = True + if arg == "--all": + all = True + + # Detect fragment output (if serialising). + + elif arg == "--fragment": + fragment = True # Detect macro evaluation. elif arg == "--macros": macros = True - # Detect all documents. + # Detect tree output. + + elif arg == "--tree": + tree = True - elif arg == "--all": - all = True + # Options with following arguments. + + # Switch to document index. + + elif arg == "--attachments-dir": + l = attachments_dir + continue # Switch to document index. @@ -133,11 +149,6 @@ l = document_indexes continue - # Detect fragment output (if serialising). - - elif arg == "--fragment": - fragment = True - # Switch to collecting formats. elif arg == "--format": @@ -225,6 +236,7 @@ # Define metadata. metadata = Metadata({ + "attachments" : getvalue(attachments_dir, "attachments"), "document_index" : getvalue(document_indexes), "input_context" : input_dir and \ getvalue(input_dir_types, "directory") or \