mike icon indicating copy to clipboard operation
mike copied to clipboard

Is it possible to add additional parameters to mkdocs build?

Open andboss opened this issue 1 year ago • 3 comments

Is it possible to add additional parameters to mkdocs build?

poetry run mike deploy ... --build-params $MKDOCS_BUILD_PARAMS

E.g. we want to avoid clean of output folder and add --dirty (https://www.mkdocs.org/user-guide/cli/#mkdocs-build)

andboss avatar Jul 31 '23 15:07 andboss

Sorry, no that's not possible. There shouldn't be any need to do that though (and in fact it could add stray files to your docs easily if you're not careful). What are you trying to accomplish?

jimporter avatar Jul 31 '23 17:07 jimporter

Sorry, no that's not possible. There shouldn't be any need to do that though (and in fact it could add stray files to your docs easily if you're not careful). What are you trying to accomplish?

ok, thanks for the clarification! I'm trying to support artifacts that are already located in the same folder (that was cleaned before), e.g.:

  • build step before with some external docs gen, e.g.:
    • doxygen --> generates HTML stuff to doxygen/html
    • rm -rf public/
    • mkdir -p public/doxygen
    • mv doxygen/html/* public/doxygen
  • poetry run mkdocs build ... --dirty --> cleans up public and therefore some references to public/doxygen are not valid

wanted to keep same now for multi-versioning with mike, but the public folder is cleaned up and do not want to copy doxygen stuff after mike call as need to make sure the doxygen html can be referenced by md files and has to be there before...

I know the doxygen integration solution is simple and can be done may be better with some mkdocs plugin, but need first to investigate such plugin, may be you have some recommendation...

andboss avatar Aug 01 '23 08:08 andboss

I think a plugin is the best solution for this, but I think it should also work just fine to add your generated Doxygen docs to your MkDocs source directory (docs/doxygen or something). MkDocs should automatically include all the files for you when building.

jimporter avatar Aug 09 '23 17:08 jimporter