Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file commandSphinx.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354(**************************************************************************)(* *)(* Copyright 2020 OCamlPro & Origin Labs *)(* *)(* All rights reserved. This file is distributed under the terms of the *)(* GNU Lesser General Public License version 2.1, with the special *)(* exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)openEzcmd.V2openEZCMD.TYPESletcmd_name="sphinx"letmake_sphinxp=letdir=Misc.sphinx_targetpinletsphinx_target=Format.sprintf"_drom/docs/%s"dirinMisc.before_hook"sphinx"~args:[sphinx_target];Misc.call[|"sphinx-build";"sphinx";sphinx_target|];Misc.after_hook"sphinx"~args:[sphinx_target];sphinx_targetletaction~args~open_www()=let(p:Types.project)=Build.build~dev_deps:true~args()inletsphinx_target=make_sphinxpinif!open_wwwthenMisc.call[|"xdg-open";Filename.concatsphinx_target"index.html"|]letcmd=letargs,specs=Build.build_args()inletopen_www=reffalseinEZCMD.subcmd_name(fun()->action~args~open_www())~args:([(["view"],Arg.Setopen_www,EZCMD.info"Open a browser on the sphinx documentation")]@specs)~doc:"Generate documentation using sphinx"~man:[`S"DESCRIPTION";`Blocks[`P"This command performs the following actions:";`I("1.","Build the project, installing dev dependencies if not done yet (see $(b,drom build) and $(b,drom dev-deps) for more info).");`I("2.","If a file $(i,scripts/before-sphinx.sh) exists, run it");`I("3.","Build Sphinx documentation using the command $(b,sphinx-build sphinx _drom/docs/${sphinx-target}), where $(b,${sphinx-target}) is the $(b,sphinx-target) field in the project description, or $(b,sphinx) by default. Documentation source files are expected to be found in the top $(b,sphinx/) directory.");`I("4.","If the argument $(b,--view) was specified, open a browser on the newly generated documentation");]]