Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent href #382

Open
sorawee opened this issue Nov 25, 2023 · 0 comments
Open

Inconsistent href #382

sorawee opened this issue Nov 25, 2023 · 0 comments

Comments

@sorawee
Copy link
Contributor

sorawee commented Nov 25, 2023

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant