quantorconsulting / mkdocs_build_plantuml

MkDocs plugin to help generate your plantuml images locally or remotely as files (NOT inline)
MIT License
57 stars 15 forks source link

Output folders on Windows #5

Closed ghost closed 4 years ago

ghost commented 4 years ago

I am using MkDocs with mkdocs-build-plantuml-plugin on a Windows device. Everything seems to work well except that the output folder structure does not mirror the input folder structure as documented. When files are stored in the input_folder, their images are generated to the output_folder. But when files are stored in a subfolder of input_folder, their images are generated to a like-named subfolder of C:/.

Example...

c:/
    my-project/
        docs/
            diagrams/
                out/
                    file.svg
                src/
                    file.puml
                    subdir1/
                        file1.puml
    subdir1/
        file1.svg

I am not a Python developer but I believe the cause of the issue to be at line 47 of plantuml.py.

diagram.out_dir = os.path.join(os.getcwd(), self.config['diagram_root'], self.config['output_folder'],*subdir.replace(root_input,"").split("/"))

The last function call, split("/") doesn't work on Windows. If does work if you replace it with split(os.sep).

christo-ph commented 4 years ago

Hi,

Thanks for you report. Did you already test this? Do you want to make a merge request?

If not I will do this asap.

ghost commented 4 years ago

I tested it locally on my Windows device. I'd be happy to submit a merge request if you can test it on non-Windows devices.

christo-ph commented 4 years ago

HI,

yes, I could test it on OS X and Linux.