Issue 22803 - DDoc Reference Links to symbols generate invalid links (duplicate DOC_ROOT)
Summary: DDoc Reference Links to symbols generate invalid links (duplicate DOC_ROOT)
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P3 normal
Assignee: No Owner
URL:
Keywords: ddoc
Depends on:
Blocks:
 
Reported: 2022-02-21 17:17 UTC by Vijay Nayar
Modified: 2022-12-17 10:37 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Vijay Nayar 2022-02-21 17:17:13 UTC
Component: DMD, DDoc

OS: Ubuntu Linux 20.04.03 LTS

Summary: When generating documentation via `dub build -b docs`, DDoc comments using relative links, project symbols in [square brackets], result in invalid links. These invalid links include the base document dir `/docs` twice, e.g. `/docs/docs`.

Environment: DMD v2.098.1

Reproduction Steps:
1. Create a simple project with relative links, e.g.:
```d
// File: source/avro/parser.d
module avro.parser;
class Parser {
  /// Builds a [Schema] using a path to a ".avsc" file.
  public Schema parseFile(string fileName) {
  }
}

// File: source/avro/schema.d
module avro.schema;
class Schema {
}

```

2. Build the project documentation via `dub build -b docs`.

3. Browse to the generated documentation for parser, e.g. `file:///home/vnayar/projects/avro-d/docs/parser.html`.

4. Navigate to the documentation for the `parseFile` method, and click on the `Schema` link.

Observed Behavior: The link is invalid because it contains `/docs` twice, e.g. `file:///home/vnayar/projects/avro-d/docs/docs/schema.html#Schema`

Expected Behavior: The link should only include the document root once, e.g. `file:///home/vnayar/projects/avro-d/docs/schema.html#Schema`.