0

I am a beginner so maybe this question sounds stupid.

Anyway, I have a make.bat file which you can pass in the builder name to use and it invokes below command:

set SPHINXBUILD=sphinx-build
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

So when I type:

make.bat man

...it is executed and at the end it says:

The manual pages are in build\man.

...but it seems it is not working properly since build\man folder is empty. Also a lot of warning messages are comming up:

WARNING: "man_pages" config value references unknown document man\filename

I have a directory called man which contains a lot of filename.rst files.

So why man pages are not being generated within build\man folder?

Additional info:

In conf.py I have set man_pages as below:

man_pages = [
    (str(fn.parent / fn.stem), fn.stem, '', '', '1')
    for fn in pathlib.Path('man').glob('*.rst')
    ]

Note: If I type make.bat html it works ok and all the content is generated within build\html folder.

mzjn
  • 48,958
  • 13
  • 128
  • 248
Willy
  • 9,848
  • 22
  • 141
  • 284
  • What is the value of `man_pages` in conf.py? – mzjn Jan 18 '22 at 16:36
  • @mzjn I have edited my post and specified man_pages value within conf.py – Willy Jan 18 '22 at 16:42
  • 1
    `str(fn.parent / fn.stem)` does not seem to work. What happens if you change it to `(fn.parent / fn.stem).as_posix()`? – mzjn Jan 18 '22 at 17:09
  • @mzjn I am new to python and sphinx and this project is not mine, but I think of doing (str(fn.parent / fn.stem), fn.stem, '', '', '1') for fn in pathlib.Path('man').glob('*.rst') is not correct. Isn't it for fn in pathlib.Path('man').glob('*.rst'): (str(fn.parent / fn.stem), fn.stem, '', '', '1') instead? – Willy Jan 19 '22 at 12:38
  • @mzjn seems like using (fn.parent / fn.stem).as_posix() instead of str(fn.parent / fn.stem) works. In build\man folder there are some files generated named in the style filename.1 Also I would like to know what exactly does as_posix(), could you explain me how it works? also the man pages generated, how can i read them from Windows? I would like to check that these man pages are well generated. Thanks in advance. – Willy Jan 19 '22 at 15:10
  • I have not used pathlib very much and I don't feel that I can really explain exactly what happens. – mzjn Jan 19 '22 at 15:28
  • 1
    If you want to read man pages on Windows, maybe you can use Cygwin. But that is a separate question. – mzjn Jan 19 '22 at 15:30
  • For those who wants to know what as_posix does here a good article about Pathlib stem & as_posix(): https://cppsecrets.com/users/140409711410797112114979810497100971155552555264103109971051084699111109/Python-Pathlib-stem-asposix.php – Willy Jan 19 '22 at 16:22

0 Answers0