docs, cmd: fix broken docs source links regression in vdoc (#23889)

This commit is contained in:
larpon 2025-03-09 15:31:14 +01:00 committed by GitHub
parent aebe9bc1c8
commit 81afd8f502
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -303,12 +303,18 @@ fn (mut vd VDoc) generate_docs_from_file() {
} else { } else {
os.dir(cfg.input_path) os.dir(cfg.input_path)
} }
manifest_path := os.join_path(dir_path, 'v.mod') manifest_path := if cfg.is_vlib {
os.join_path(vroot, 'v.mod')
} else {
os.join_path(dir_path, 'v.mod')
}
if os.exists(manifest_path) { if os.exists(manifest_path) {
vd.vprintln('Reading v.mod info from ${manifest_path}') vd.vprintln('Reading v.mod info from ${manifest_path}')
if manifest := vmod.from_file(manifest_path) { if manifest := vmod.from_file(manifest_path) {
vd.manifest = manifest vd.manifest = manifest
} }
} else if cfg.is_vlib {
assert false, 'vdoc: manifest does not exist for vlib'
} }
if cfg.include_readme || cfg.is_vlib { if cfg.include_readme || cfg.is_vlib {
mut readme_name := 'README' mut readme_name := 'README'