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

CIP relative link problems: footer + nested README files #1229

Open
rphair opened this issue Mar 20, 2024 · 6 comments
Open

CIP relative link problems: footer + nested README files #1229

rphair opened this issue Mar 20, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@rphair
Copy link
Collaborator

rphair commented Mar 20, 2024

The relative links that work inline in the text of all CIPs, e.g. in the two CIP-0072 *.json schemas beginning here (both opening as JSON files hosted on the Dev Portal in the browser), aren't evaluated correctly when the relative links appear in the document footer as follows in this recently merged CIP (in https://github.com/cardano-foundation/CIPs/blob/master/CIP-0114/README.md:)

The format of the registry is defined by the json schema: [CIP Tag Registry Schema].
New entries MUST be added to the [CIP Tag Registry] in a PR for a CIP that first defines a new CBOR Tag.
...
[CIP Tag Registry Schema]: ./registry.schema.json
[CIP Tag Registry]: ./registry.json

You can see on the currently built Dev Portal CIP page that these links are broken: https://developers.cardano.org/docs/governance/cardano-improvement-proposals/CIP-0114 ... and we also get the usual build warning about not being able to evaluate the relative links:

[WARNING] Docusaurus found broken links!
...
- On source page path = /docs/governance/cardano-improvement-proposals/CIP-0114:
   -> linking to ./registry.schema.json (resolved as: /docs/governance/cardano-improvement-proposals/registry.schema.json)
   -> linking to ./registry.json (resolved as: /docs/governance/cardano-improvement-proposals/registry.json)

I don't think CIP editors can require authors to avoid the "footnote" syntax for relative links: either by turning them into absolute links or repeating the link reference wherever it appears inline. Therefore the only remaining solution is to also interpret the relative links correctly — as they are when appearing inline — when they appear in the footnote.

So far CIP-0114 is the only CIP or CPS which is using relative URLs in the footer, so it's both a good test case & our only instance of the problem:

$ grep ']: ./' */README.md
CIP-0114/README.md:[CIP Tag Registry Schema]: ./registry.schema.json
CIP-0114/README.md:[CIP Tag Registry]: ./registry.json
$

cc @stevenj @Ryun1 @Crypto2099

@rphair
Copy link
Collaborator Author

rphair commented Mar 20, 2024

@katomm @fill-the-fill cross-referencing #1121.

@rphair rphair changed the title Relative links don't evaluate correctly in CIP footer Relative link problems: CIP footer + nested README files Mar 24, 2024
@rphair
Copy link
Collaborator Author

rphair commented Mar 24, 2024

@fill-the-fill the other place relative links don't parse right is for inline links to CIP & CPS README.md files; which across a number of contexts (including GitHub itself) can be referenced by the containing directory. See this table in CIP-0088 (cc @Crypto2099): https://github.com/cardano-foundation/CIPs/blob/master/CIP-0088/README.md#6-cip-specific-information

... with the links in the last column (Rationale) of the Dev Portal page all broken; pointing to nonexistent URLs on GitHub (but not reported as warnings during the build process, since the files aren't local): https://developers.cardano.org/docs/governance/cardano-improvement-proposals/CIP-0088#6-cip-specific-information

As with the case above, we are trying to get support for typical linking syntax in the derived web sites rather than forcing CIP editors (cc @Ryun1) & authors to confine themselves to a narrower link syntax than they see supported on GitHub.

I agree with @katomm's #1121 (comment) that a "fragile" CIP build script on the Dev Portal (or any derived web site) should not restrict how CIPs are written when their markup is otherwise valid (defined, I think, as valid on GitHub).

@rphair rphair changed the title Relative link problems: CIP footer + nested README files CIP relative link problems: footer + nested README files Mar 24, 2024
@fill-the-fill
Copy link
Collaborator

I unfortunately still didn't have time to look into this issue since very busy with other stuff but I'm keeping my eye on it

@Shivam-1M
Copy link
Contributor

Shivam-1M commented May 16, 2024

Hello there @rphair @fill-the-fill!
I am new to this repo and I have managed to work on this issue.

Problem: The referenced style links in CIPs are causing problem (e.g., CIP-0114).

Proposed solution:

  1. When downloading CIP contents, first check the "referenced style links" (mentioned at the bottom of the page)

For example, [CIP Tag Registry Schema]

  1. Then replace the "referenced items" in the content with "referenced item" and corresponding "relative file link" to make it an inline link.

For example, [CIP Tag Registry Schema](./registry.schema.json)

  1. The present code will do the rest of the work of downloading the files and updating the content.

For example, [CIP Tag Registry Schema](../../../static/img/cip/./CIP-0114/./registry.schema.json)

I have the solution but I am not sure how I can push my branch in here as it throws permission error.

@katomm
Copy link
Member

katomm commented May 17, 2024

Welcome, you can not push your branch directly you need to create a pull request from your fork.

Shivam-1M added a commit to Shivam-1M/developer-portal that referenced this issue May 17, 2024
Shivam-1M added a commit to Shivam-1M/developer-portal that referenced this issue May 17, 2024
@rphair
Copy link
Collaborator Author

rphair commented May 23, 2024

Potentially fixed by #1262.

rphair added a commit that referenced this issue Jun 4, 2024
* Fixed broken referenced link (#1229)

* Fixed broken referenced link (#1229)

* removing unnecessary change of standard-change

* back out superfluous change to .github template

* undo standard-change

* Fixed mixed reference links

* implemented all links functionalities of cip to cps

* fixed correct parsing of table CIP dir links

---------

Co-authored-by: Robert Phair <[email protected]>
Co-authored-by: Tommy Kammerer <[email protected]>
katomm added a commit that referenced this issue Jun 27, 2024
* Fixed broken referenced link (#1229)

* Fixed broken referenced link (#1229)

* removing unnecessary change of standard-change

* back out superfluous change to .github template

* undo standard-change

* Fixed mixed reference links

* implemented all links functionalities of cip to cps

* fixed correct parsing of table CIP dir links

---------

Co-authored-by: Robert Phair <[email protected]>
Co-authored-by: Tommy Kammerer <[email protected]>
katomm added a commit that referenced this issue Jun 27, 2024
* fix external broken links (#1270)

* fix external broken links

* quick fix

linked in a [ for a proper linkedin link

* reverting to unmodified yarn.lock

* remove testnet grafana dashboard

* Fixed Referenced Style Broken Link (#1262)

* Fixed broken referenced link (#1229)

* Fixed broken referenced link (#1229)

* removing unnecessary change of standard-change

* back out superfluous change to .github template

* undo standard-change

* Fixed mixed reference links

* implemented all links functionalities of cip to cps

* fixed correct parsing of table CIP dir links

---------

Co-authored-by: Robert Phair <[email protected]>
Co-authored-by: Tommy Kammerer <[email protected]>

* add changelog may 2024 (#1273)

Co-authored-by: fill-the-fill <[email protected]>
Co-authored-by: RdLrT <[email protected]>

* feat: add blink labs cardano-node-api (#1274)

Signed-off-by: Chris Gianelloni <[email protected]>

* Bump ws from 7.5.9 to 7.5.10 (#1277)

Bumps [ws](https://github.com/websockets/ws) from 7.5.9 to 7.5.10.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](websockets/ws@7.5.9...7.5.10)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update content security policy (#1275)

* Add zenGate blog (#1279)

* add zengate blog

* Update blog/2024-06-24-june.md

Co-authored-by: Robert Phair <[email protected]>

* Update blog/2024-06-24-june.md

Co-authored-by: Robert Phair <[email protected]>

* Update blog/2024-06-24-june.md

Co-authored-by: Robert Phair <[email protected]>

---------

Co-authored-by: Denicio Bute <>
Co-authored-by: Robert Phair <[email protected]>

* Bump braces from 3.0.2 to 3.0.3 (#1278)

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tommy Kammerer <[email protected]>

---------

Signed-off-by: Chris Gianelloni <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Markus <[email protected]>
Co-authored-by: Shivam Mungra <[email protected]>
Co-authored-by: Robert Phair <[email protected]>
Co-authored-by: Fill <[email protected]>
Co-authored-by: fill-the-fill <[email protected]>
Co-authored-by: RdLrT <[email protected]>
Co-authored-by: Chris Gianelloni <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: WEQNT Stake Pool <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants