add option to prepend id
This commit is contained in:
parent
cea92e59cb
commit
5d25796323
@ -22,6 +22,7 @@ class Configuration:
|
||||
output_dir: str = "output/" # The directory to which DB will be exported
|
||||
data_dir: str = "data/" # The directory in which SPIP images & documents are stored
|
||||
prepend_h1: bool = True # Add the title of the article as a Markdown h1
|
||||
prepend_id: bool = True # Add the ID of object before slug
|
||||
unknown_char_replacement: str = "??" # Replaces unknown characters
|
||||
export_languages = ("fr", "en") # Languages that will be exported
|
||||
export_filetype: str = "md" # Extension of exported text files
|
||||
|
@ -269,10 +269,8 @@ class Document(WritableObject, NormalizedDocument):
|
||||
return data_dir + self.fichier
|
||||
|
||||
# Get directory of this object
|
||||
def dest_directory(
|
||||
self, prepend_id: bool = True, prepend: str = "", append: str = ""
|
||||
) -> str:
|
||||
_id: str = str(self._id) + "-" if prepend_id else ""
|
||||
def dest_directory(self, prepend: str = "", append: str = "") -> str:
|
||||
_id: str = str(self._id) + "-" if CFG.prepend_id else ""
|
||||
return (
|
||||
self._parentdir
|
||||
+ prepend
|
||||
@ -361,10 +359,8 @@ class RedactionalObject(WritableObject):
|
||||
return text
|
||||
|
||||
# Get slugified directory of this object
|
||||
def dest_directory(
|
||||
self, prepend_id: bool = True, prepend: str = "", append: str = "/"
|
||||
) -> str:
|
||||
_id: str = str(self._id) + "-" if prepend_id else ""
|
||||
def dest_directory(self, prepend: str = "", append: str = "/") -> str:
|
||||
_id: str = str(self._id) + "-" if CFG.prepend_id else ""
|
||||
return (
|
||||
self._parentdir
|
||||
+ prepend
|
||||
|
Loading…
Reference in New Issue
Block a user