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

deno doc --html *.ts produces broken index.html #26901

Closed
krlwlfrt opened this issue Nov 16, 2024 · 5 comments · Fixed by #27103
Closed

deno doc --html *.ts produces broken index.html #26901

krlwlfrt opened this issue Nov 16, 2024 · 5 comments · Fixed by #27103
Assignees
Labels
bug Something isn't working correctly

Comments

@krlwlfrt
Copy link

krlwlfrt commented Nov 16, 2024

Version: Deno 2.0.6

deno doc produces broken paths in HTML output. Slashes are escaped and extraneous .. are added even though the files are in the same directory.

Command that produces the broken output:

deno doc --html game/**/*.ts browser/*.ts cli.ts
<!-- docs/index.html -->
<!DOCTYPE html>
<html>
<head>
  <title>. - documentation</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="doc-current-file" content="">
  <link rel="stylesheet" href="..&#x2F;styles.css">
  <link rel="stylesheet" href="..&#x2F;page.css">
  <link id="ddocResetStylesheet" rel="stylesheet" href="..&#x2F;reset.css">

    <script src="..&#x2F;search_index.js" defer></script>
    <script src="..&#x2F;script.js" defer></script>
    <script src="..&#x2F;fuse.js" defer></script>
    <script src="..&#x2F;search.js" defer></script>
</head>
...

See: https://krlwlfrt.gitlab.io/snake/

Example repo: https://gitlab.com/krlwlfrt/snake/

@crowlKats crowlKats added the bug Something isn't working correctly label Nov 16, 2024
@krlwlfrt
Copy link
Author

It happens whenever I specify more than one file to generate docs from. All of these examples produce the broken output:

deno doc --html *.ts
deno doc --html **/*.ts
deno doc --html mod.ts types.ts

If I specify only one file the output is fine:

deno doc --html mod.ts
deno doc --html types.ts

@krlwlfrt
Copy link
Author

Only index.html is broken... All the other files are fine.

@krlwlfrt krlwlfrt changed the title deno doc produces broken HTML output deno doc *.ts produces broken index.html Nov 20, 2024
@krlwlfrt krlwlfrt changed the title deno doc *.ts produces broken index.html deno doc --html *.ts produces broken index.html Nov 20, 2024
@Seally
Copy link

Seally commented Nov 20, 2024

The issue I opened a while back is closely related: #25069

Maybe posting on https://github.com/denoland/deno_doc (which is likely where the fix will happen anyway) will make it less likely for the issue to be buried. *shrugs*

@krlwlfrt
Copy link
Author

For anyone encountering the same problem: the following one-liner fixes the broken index.html for me.

sed -i -e 's/\.\.\&#x2F;//g' -e 's/\&#x2F;/\//g' -e 's/\.\.\/comrak\.css/comrak\.css/g' -e 's/\.\.\/prism/prism/g' docs/index.html

@crowlKats
Copy link
Member

I'll be looking into this tomorrow. @Seally apologies about missing #25069, i'll take a look at that as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants