www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22803] New: DDoc Reference Links to symbols generate invalid


          Issue ID: 22803
           Summary: DDoc Reference Links to symbols generate invalid links
                    (duplicate DOC_ROOT)
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: madric gmail.com

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.

Environment: DMD v2.098.1

Reproduction Steps:
1. Create a simple project with relative links, e.g.:
// 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.

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.

Expected Behavior: The link should only include the document root once, e.g.

Feb 21 2022