diff --git a/setup.cfg b/setup.cfg index dbd0361..e675fce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = confluence.md -version = 0.4.4 +version = 0.4.5 author = Szymon Nieradka description = Markdown to Confluence - upload any .md files to your Confluence cloud page long_description = file: README.md diff --git a/src/md2cf/utils/confluencemd.py b/src/md2cf/utils/confluencemd.py index d534391..18e7b98 100644 --- a/src/md2cf/utils/confluencemd.py +++ b/src/md2cf/utils/confluencemd.py @@ -101,12 +101,12 @@ def update_existing(self, page_id: str = None) -> int: self.url = self.conf_url # to satisfy parent class html = self.__rewrite_issues(html) - self.__attach_images(page_id, images) - if page_id is None: logger.debug("Using `page_id` from `%s` file", self.md_file) page_id = page_id_from_meta + self.__attach_images(page_id, images) + assert page_id, ( f"Can't update page without page_id given either by " f"`--page_id` parameter or via `confluence-url` tag in `{self.md_file}` file" @@ -259,6 +259,7 @@ def __attach_images( ) -> None: """Replaces html tags with Confluence specific and uploads images as attachements""" + logger.info("__attach_images %s", page_id) for (_alt, path) in images: rel_path = os.path.join(self.md_file_dir, path) if not os.path.isfile(rel_path): diff --git a/src/md2cf/utils/md2html.py b/src/md2cf/utils/md2html.py index f6a30a4..6c606bd 100644 --- a/src/md2cf/utils/md2html.py +++ b/src/md2cf/utils/md2html.py @@ -86,7 +86,7 @@ def __rewrite_images(html: str, rel_path = os.path.join(md_file_dir, path) if not os.path.isfile(rel_path): assert os.path.isfile(path), f"File `{path}` does not exist" - logger.warning("file `%s` does not exist, using file relative to " + logger.debug("File `%s` does not exist, using file relative to " "current dir `%s`", rel_path, path) rel_path = path