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

Generate the correct link for the content in the readme #1560

Closed
Genluo opened this issue Mar 30, 2021 · 4 comments
Closed

Generate the correct link for the content in the readme #1560

Genluo opened this issue Mar 30, 2021 · 4 comments
Labels
bug Functionality does not match expectation wontfix Declining to implement

Comments

@Genluo
Copy link

Genluo commented Mar 30, 2021

Search terms

readme

Expected Behavior

During the readme rendering process, generate correct HTML for the referenced local markdown file link

Actual Behavior

Link error in readme

Steps to reproduce the bug

E.g. README.md

[简体中文](./README.md) | English

Environment

  • Typedoc version: 0.20.34
  • TypeScript version: 4.0.3
  • Node.js version: 14.4.0
  • OS: macOS 11.2.3
@Genluo Genluo added the bug Functionality does not match expectation label Mar 30, 2021
@Genluo
Copy link
Author

Genluo commented Mar 30, 2021

If it is confirmed that this is a bug, I will fix this problem through PR later

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 3, 2021

I'm somewhat worried about trying to rewrite links - if the readme linked to ./other.file.md and we rewrote that link, it would lead to users expecting that file to be included in the generated site, which it currently won't be (and including arbitrary files is definitely something I don't want to handle! The folder to include, yes, eventually, but arbitrary files from anywhere? Nope)

I think my advice for now would be to create a second readme specifically for your docs, and point TypeDoc to it with the --readme option

@Genluo
Copy link
Author

Genluo commented Apr 5, 2021

I'm somewhat worried about trying to rewrite links - if the readme linked to ./other.file.md and we rewrote that link, it would lead to users expecting that file to be included in the generated site, which it currently won't be (and including arbitrary files is definitely something I don't want to handle! The folder to include, yes, eventually, but arbitrary files from anywhere? Nope)

I think my advice for now would be to create a second readme specifically for your docs, and point TypeDoc to it with the --readme option

@Gerrit0 First of all, thank you for your reply. I understand your worry. It is necessary to ensure that the referenced documents are in line with the expectations. To solve the problem, I think of a modification method:

1.The readme option supports the form of array types to clearly define the file you need to reference (or add a new options). It supports passing in a group of parameters, and its configuration items are similar:

{
    "readme": [
      "./README-en-GB.md",
      "./README.md"
    ]
}

2.If any path specified in the readme parameters is found during the rendering of the readme file, it will be modified to html hyperlink instead of the current md file link

At the same time, I'm not sure whether this change should be put into the framework. At present, this ability can be realized in the form of plug-ins provided by typedoc.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 27, 2021

I've reviewed this a couple of times, and I don't think this is something I want to live in TypeDoc proper, it's a bit too magical. This might change once TypeDoc has support for guides, but for now it doesn't really fit with the architecture well.

@Gerrit0 Gerrit0 added the wontfix Declining to implement label Jun 27, 2021
@Gerrit0 Gerrit0 closed this as completed Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation wontfix Declining to implement
Projects
None yet
Development

No branches or pull requests

2 participants