diff --git a/spip2md/config.py b/spip2md/config.py index 9b21600..a4cf0dd 100644 --- a/spip2md/config.py +++ b/spip2md/config.py @@ -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 diff --git a/spip2md/extended_models.py b/spip2md/extended_models.py index 66edc9e..c416728 100644 --- a/spip2md/extended_models.py +++ b/spip2md/extended_models.py @@ -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