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

SVG or PNG being generated, but not moved to the "source" folder. #9

Closed GAS85 closed 2 years ago

GAS85 commented 3 years ago

Hello,

I do use your plugin and seems my diagrams generated and saved in a "out" folder. Unfortunately I can't find them in the mkdocs output folder. My config.

theme:
  # The string name of a known installed theme
  name: 'material'

# The directory where the output HTML and other files are created
site_dir: source

plugins:
  # built-in MkDocs search plugin
  - search
  # helps building plantuml images
  - build_plantuml:
      render: "local"
      bin_path: "/usr/bin/plantuml"
      output_format: "svg"
      diagram_root: "docs/diagrams"
      output_folder: "out"
      input_folder: "src"

My input folders:

ls -laR
...
./docs/diagrams:
total 16
drwxrwxrwx    4 root     root          4096 Mar 26 08:24 .
drwxrwxrwx    9 root     root          4096 Mar 26 08:24 ..
drwxr-xr-x    2 root     root          4096 Mar 26 08:24 out
drwxrwxrwx    2 root     root          4096 Mar 26 08:24 src
./docs/diagrams/out:
total 52
drwxr-xr-x    2 root     root          4096 Mar 26 08:24 .
drwxrwxrwx    4 root     root          4096 Mar 26 08:24 ..
-rw-r--r--    1 root     root         43218 Mar 26 08:24 system_quick_overview.svg
./docs/diagrams/src:
total 12
drwxrwxrwx    2 root     root          4096 Mar 26 08:24 .
drwxrwxrwx    4 root     root          4096 Mar 26 08:24 ..
-rw-rw-rw-    1 root     root           475 Mar 26 08:24 system_quick_overview.puml

My mkdocs output folder:

./source/diagrams:
total 12
drwxr-xr-x    3 root     root          4096 Mar 26 08:24 .
drwxr-xr-x   11 root     root          4096 Mar 26 08:24 ..
drwxr-xr-x    2 root     root          4096 Mar 26 08:24 src
./source/diagrams/src:
total 12
drwxr-xr-x    2 root     root          4096 Mar 26 08:24 .
drwxr-xr-x    3 root     root          4096 Mar 26 08:24 ..
-rw-r--r--    1 root     root           475 Mar 26 08:24 system_quick_overview.puml

Do you have any advice why out from input folder (docs) is not moved to the output folder source?

christo-ph commented 3 years ago

Hi,

  1. do you have any logs, which might lead you to the problem?
  2. Have you checked, that "diagram_root: "docs/diagrams" # should reside under docs_dir"
  3. Have you tried to first setup the example in this project to verify that this is working?

I have never encountered this issue before, so I need your input.

GAS85 commented 3 years ago

Hey, to the 1st.

mkdocs build
INFO    -  Cleaning site directory 
INFO    -  Building documentation to directory: /builds/georgiy.sitnikov/My_TMP/source 
WARNING -  Documentation file 'catalog/System.md' contains a link to 'catalog/system_quick_overview.svg' which is not found in the documentation files. 
INFO    -  Documentation built in 5.09 seconds 
Converting /builds/georgiy.sitnikov/My_TMP/docs/diagrams/src/system_quick_overview.puml

To the 2nd. Yes, it is: grafik

and docs directory in config is

docs_dir: 'docs'

To the 3d: My own example looks like this in docu:

<img src="diagrams/out/system_quick_overview.svg" title="System API management quick Overview" usemap="#workmap" height="782" width="455">

Output for your example is (for catalog/test.md):

$ mkdocs build
INFO    -  Cleaning site directory 
INFO    -  Building documentation to directory: /builds/georgiy.sitnikov/My_TMP/source 
WARNING -  Documentation file 'catalog/System.md' contains a link to 'catalog/system_quick_overview.svg' which is not found in the documentation files. 
WARNING -  Documentation file 'catalog/test.md' contains a link to 'catalog/diagrams/out/file.svg' which is not found in the documentation files. 
WARNING -  Documentation file 'catalog/test.md' contains a link to 'catalog/diagrams/out/subdir1/file1.svg' which is not found in the documentation files. 
INFO    -  Documentation built in 7.96 seconds 
Converting /builds/georgiy.sitnikov/My_TMP/docs/diagrams/src/file.puml
Converting /builds/georgiy.sitnikov/My_TMP/docs/diagrams/src/system_quick_overview.puml
Converting /builds/georgiy.sitnikov/My_TMP/docs/diagrams/src/subdir1/file1.puml
$ ls -laR
.:
total 44
drwxrwxrwx    6 root     root          4096 Mar 26 10:09 .
drwxrwxrwx    4 root     root          4096 Mar 26 10:09 ..
drwxrwxrwx    6 root     root          4096 Mar 26 10:09 .git
-rw-rw-rw-    1 root     root           427 Mar 26 10:09 .gitignore
-rw-rw-rw-    1 root     root           189 Mar 26 10:09 .gitlab-ci.yml
-rw-rw-rw-    1 root     root          1730 Mar 26 10:09 README.md
drwxrwxrwx    9 root     root          4096 Mar 26 10:09 docs
-rw-rw-rw-    1 root     root          5753 Mar 26 10:09 mkdocs.yml
drwxrwxrwx    3 root     root          4096 Mar 26 10:09 overrides
drwxr-xr-x   11 root     root          4096 Mar 26 10:09 source

####

./docs/diagrams:
total 16
drwxrwxrwx    4 root     root          4096 Mar 26 10:13 .
drwxrwxrwx    9 root     root          4096 Mar 26 10:06 ..
drwxr-xr-x    3 root     root          4096 Mar 26 10:13 out
drwxrwxrwx    3 root     root          4096 Mar 26 10:06 src
./docs/diagrams/out:
total 28
drwxr-xr-x    3 root     root          4096 Mar 26 10:13 .
drwxrwxrwx    4 root     root          4096 Mar 26 10:13 ..
-rw-r--r--    1 root     root          6884 Mar 26 10:13 file.svg
drwxr-xr-x    2 root     root          4096 Mar 26 10:13 subdir1
-rw-r--r--    1 root     root          6884 Mar 26 10:13 system_quick_overview.svg
./docs/diagrams/out/subdir1:
total 16
drwxr-xr-x    2 root     root          4096 Mar 26 10:13 .
drwxr-xr-x    3 root     root          4096 Mar 26 10:13 ..
-rw-r--r--    1 root     root          6884 Mar 26 10:13 file1.svg
./docs/diagrams/src:
total 20
drwxrwxrwx    3 root     root          4096 Mar 26 10:06 .
drwxrwxrwx    4 root     root          4096 Mar 26 10:13 ..
-rw-rw-rw-    1 root     root           475 Mar 26 10:06 file.puml
drwxrwxrwx    2 root     root          4096 Mar 26 10:13 subdir1
-rw-rw-rw-    1 root     root           475 Mar 26 10:06 system_quick_overview.puml
./docs/diagrams/src/subdir1:
total 12
drwxrwxrwx    2 root     root          4096 Mar 26 10:13 .
drwxrwxrwx    3 root     root          4096 Mar 26 10:06 ..
-rw-rw-rw-    1 root     root           475 Mar 26 10:13 file1.puml

####

./source/diagrams:
total 12
drwxr-xr-x    3 root     root          4096 Mar 26 10:13 .
drwxr-xr-x   11 root     root          4096 Mar 26 10:13 ..
drwxr-xr-x    3 root     root          4096 Mar 26 10:13 src
./source/diagrams/src:
total 20
drwxr-xr-x    3 root     root          4096 Mar 26 10:13 .
drwxr-xr-x    3 root     root          4096 Mar 26 10:13 ..
-rw-r--r--    1 root     root           475 Mar 26 10:13 file.puml
drwxr-xr-x    2 root     root          4096 Mar 26 10:13 subdir1
-rw-r--r--    1 root     root           475 Mar 26 10:13 system_quick_overview.puml
./source/diagrams/src/subdir1:
total 12
drwxr-xr-x    2 root     root          4096 Mar 26 10:13 .
drwxr-xr-x    3 root     root          4096 Mar 26 10:13 ..
-rw-r--r--    1 root     root           475 Mar 26 10:13 file1.puml

You can see that in output folder source only puml files presented, but in docs generated SVGs :(

christo-ph commented 3 years ago

I am unable to reproduce this behaviour.

I have just created an example project, set the site_dir to source and can find all files inside, also the created SVGs

> ls  source/diagrams/out/                                                                                    Fr 26 Mär 14:49:26 2021
Permissions Size User   Date Modified Git Name
drwxr-xr-x     - root   26 Mär 14:47   -N building_block
.rw-r--r--  9,7k root   26 Mär 14:47   -N playground.svg
.rw-r--r--  9,7k root   26 Mär 14:47   -N playground_dark.svg
GAS85 commented 3 years ago

Hmmm. I'm using material theme, have no idea if this is relevant. In any way will simply add mv command to pipeline. Also will try to disable plug-ins one by one. E.g. There is also https://github.com/mikitex70/plantuml-markdown enabled.

christo-ph commented 3 years ago

Any news on this?

GAS85 commented 3 years ago

I found that enabling of monorepo plugin will cause this problem. As soon I'm using it to bring few repos togerther, I simply link Picture directly from the internal PlantUML Server for now.

artemptushkin commented 1 year ago

@GAS85 your comment helped me a lot, I spent about an hour or saw debugging this - had no clue