# HG changeset patch # User Paul Boddie # Date 1555450574 -7200 # Node ID ccd1ac4d68999ac8c2df36ea85c3af6db472b807 # Parent 21d45d1771bae5977c90e092f4ea9d5e76be1e4f Consolidated various metadata defaults. diff -r 21d45d1771ba -r ccd1ac4d6899 moinformat/input/directory.py --- a/moinformat/input/directory.py Tue Apr 16 23:35:21 2019 +0200 +++ b/moinformat/input/directory.py Tue Apr 16 23:36:14 2019 +0200 @@ -51,7 +51,7 @@ # Support attachments directories. - self.attachments_dir = metadata.get("attachments", "attachments") + self.attachments_dir = metadata.get("attachments") def all(self): diff -r 21d45d1771ba -r ccd1ac4d6899 moinformat/links/common.py --- a/moinformat/links/common.py Tue Apr 16 23:35:21 2019 +0200 +++ b/moinformat/links/common.py Tue Apr 16 23:36:14 2019 +0200 @@ -67,8 +67,8 @@ # Obtain essential metadata. self.mapping = metadata.get("mapping", {}) - self.root_pagename = metadata.get("root_pagename", "FrontPage") - self.attachments_dir = metadata.get("attachments", "attachments") + self.root_pagename = metadata.get("root_pagename") + self.attachments_dir = metadata.get("attachments") def resolve(path, pagename, root_pagename): diff -r 21d45d1771ba -r ccd1ac4d6899 moinformat/metadata.py --- a/moinformat/metadata.py Tue Apr 16 23:35:21 2019 +0200 +++ b/moinformat/metadata.py Tue Apr 16 23:36:14 2019 +0200 @@ -3,7 +3,7 @@ """ Metadata for document conversion. -Copyright (C) 2018 Paul Boddie +Copyright (C) 2018, 2019 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -31,9 +31,11 @@ "Metadata employed in the document conversion process." defaults = { + "attachments" : "attachments", "input_format" : "moin", "output_context" : "standalone", "output_format" : "moin", + "root_pagename" : "FrontPage", } default_effects = { diff -r 21d45d1771ba -r ccd1ac4d6899 moinformat/output/directory.py --- a/moinformat/output/directory.py Tue Apr 16 23:35:21 2019 +0200 +++ b/moinformat/output/directory.py Tue Apr 16 23:36:14 2019 +0200 @@ -40,10 +40,14 @@ self.dir = Directory(metadata.get("output_filename")) self.dir.ensure() - self.index_name = metadata.get("index_name", "index.html") + # Use any document index setting as the default for the index filename. + + document_index = metadata.get("document_index", "index.html") + + self.index_name = metadata.get("index_name", document_index) self.page_suffix = metadata.get("page_suffix", "%shtml" % extsep) - self.root_pagename = metadata.get("root_pagename", "FrontPage") - self.attachments_dir = metadata.get("attachments", "attachments") + self.root_pagename = metadata.get("root_pagename") + self.attachments_dir = metadata.get("attachments") # Convenience methods.