athackst / mkdocs-simple-plugin

Build documentation files inside your code into a MkDocs site.

Home Page:https://althack.dev/mkdocs-simple-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: The path [...]/docs isn't an existing directory

gwhitney opened this issue · comments

I am very afraid that I am asking a question whose answer should be obvious; maybe I am just being thick, and if so my apologies. In any case, it seems perfectly natural to me that using simple, one would not have a docs_dir at all. I started using simple with my project, and I ran the simple generator, and created my docs files in among my source, and then when I went to build the docs, I got the error that is the title of this issue. To get it running, I just set the docs_dir in the mkdocs.yml to dummy, and created an empty directory named dummy. But it looks sort of stupid to check that in, so I wanted to dig a bit deeper, and could not find a clean way to avoid this error.

Anyhow, I went so far as to clone the mkdocs-simple-plugin repository itself, and out of the box, try mkdocs build, and lo and behold: exactly the same error. Yet clearly you build your own documentation with mkdocs. So all this emboldened me to create this issue, which is really more of a question (sorry again, but I couldn't think what else to do): Pray tell, how do you avoid the dread "isn't an existing directory" error? Thank you so much.

Yes. The docs folder needs to exist (although can be empty). This is a known issue.

It's caused by this line in mkdocs which requires the folder to exist. I haven't yet asked to see if this could be made to not be required. At the time there seemed to be a strong aversion to usages beyond the original conception and flow.

I have a todo item to use a temp directory instead. Now might be a good time for me to pursue that. 😄

NOTE:

  • You do not need to commit the empty directory.
  • If you're using mkdocs_simple_gen to build your site, the directory will be created for you

Thanks so much for the quick feedback, it's much appreciated. Yeah, I had tracked down that line in the mkdocs source, I just thought you had found some way around it that I wasn't able to see. OK, well, I will just use mkdocs_simple_gen and not fuss myself over this nit, thanks.

The new release should be creating temp directories appropriately now 😄