racket / racket/scribble

Inconsistent href

Open
#382 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
250
Forks
102
Avg merge
11d 11h
Merged PRs (30d)
1

Description

tl;dr: generated href could be inconsistent depending on several factors. Here are some of the possible values:

  • <a href="file:///Users/sorawee/playground/test/scribblings/test.html#%28part._foo%29" class="tocviewlink" data-pltdoc="x">foo</a>
  • <a href="test.html#%28part._foo%29" class="tocviewlink" data-pltdoc="x">foo</a>
  • <a href="#%28part._foo%29" class="tocviewlink" data-pltdoc="x">foo</a>

The second and third variation seem OK, but the first variation contains an absolute path, which is not portable to other systems.

First variation

Consider test/scribblings/test.scrbl

#lang scribble/base

@section{foo}

foo content

Make sure to install test as a package with the following info.rkt:

#lang info
(define collection "test")
(define scribblings '(("scribblings/test.scrbl" ())))

Then, in the directory test/scribblings, run scribble +m test.scrbl.

The generated HTML contains:

<a href="file:///Users/sorawee/playground/test/scribblings/test.html#%28part._foo%29" class="tocviewlink" data-pltdoc="x">foo</a>

Second variation

Now, run scribble +m --dest . test.scrbl.

The generated HTML contains:

<a href="test.html#%28part._foo%29" class="tocviewlink" data-pltdoc="x">foo</a>

Third variation

Now, run raco pkg remove test and re-run scribble +m test.scrbl.

The generated HTML contains:

<a href="#%28part._foo%29" class="tocviewlink" data-pltdoc="x">foo</a>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with test/scribblings/test.scrbl and its package info.rkt, following the three scribble commands described in the report. Compare the generated tocviewlink href values; done means generated HTML does not contain a machine-specific absolute file path and remains portable across the documented invocation modes.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.