v
v copied to clipboard
vdoc improperly handles README.md files
$ v doctor
OS: macos, Mac OS X, 10.15.6, 19G73
Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
CC version: Apple clang version 12.0.0 (clang-1200.0.32.29)
getwd: /Volumes/Jeff/Development/@V/vlang
vmodules: /Volumes/Jeff/.vmodules
vroot: /Volumes/Jeff/src/v
vexe: /Volumes/Jeff/src/v/v
vexe mtime: 2021-12-28 07:41:23
is vroot writable: true
is vmodules writable: true
V full version: V 0.2.4 c1711b8
Git version: git version 2.29.2
Git vroot status: Error: fatal: not a git repository (or any parent up to mount point /Volumes)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
.git/config present: false
thirdparty/tcc status: thirdparty-macos-amd64 93fa86be
What did you do?
( in a newly cloned repo )
$ echo "Hello World" > vlib/arrays/README.md
$ v doc -m -f html -o testdoc vlib/
$ open file://testdoc/_docs/arrays.html
What did you expect to see?
I expected to see Hello World at the top of the array module documentation, but it is not there.
The problem is not resolved by use of the -readme flag.
Specifics
Problem 1
The -readme flag doesn't appear to do anything except add a README anchor to the module Table of Contents.
Problem 2
New README.md files are not reliably added to the generated docs.
If I generate the docs using v doc -o testdoc -m -f html vlib/ it successfully generates docs with README.md included for all of the modules that had README.md in the repo when I forked it today, but new README.md files that I add do not get included when I regenerate the docs.
However, it successfully parses README.md without the flag set under two conditions: (1) If I specify the module directly on the command line (that is, the README.md file exists in the directory I put on the command line, or (2) if I am in the vlib directory and specify ./ as the root folder.