onflow / cadence

Cadence, the resource-oriented smart contract programming language 🏃‍♂️
https://cadence-lang.org
Apache License 2.0
533 stars 138 forks source link

Fix broken links in Cadence documentation #1358

Closed kerrywei closed 2 years ago

kerrywei commented 2 years ago

Problem

Many links in Cadence documentation are broken. We should do a full audit to address as many as we can

Steps to Reproduce

check out https://docs.onflow.org/cadence/language/

turbolent commented 2 years ago

It would be great to automate this to prevent regressions. The main cause for the broken links is the difficulty of testing the documentation locally in this repo, it is currently only later build in onflow/flow. If we would have a very minimal local Gatsby config, it would allow us to write and test the documentation locally, as well as add e.g. https://www.gatsbyjs.com/plugins/gatsby-remark-check-links/ to check for broken links before they end up on master and ultimately the onflow/flow and the website.

kerrywei commented 2 years ago

totally agree @turbolent . To address the issue for now, I've fixed lots of links locally, will give you a PR soon In terms of testing doc changes locally, I wrote an internal doc at https://www.notion.so/dapperlabs/Flow-documentation-development-8c0dab686e224bf381cfd33887bdd8ae to explain that, let me know if that's helpful

turbolent commented 2 years ago

@kerrywei Sounds good! Nice work documenting this 👍 Maybe move the contents to the README of https://github.com/onflow/flow/tree/master/docs, so the community can leverage it, too

Nasir-Ali-Shah commented 2 years ago

@turbolent to fix lots of links locally, it will be good to have a script that will check all the .md or .mdx files and show which links are not correct then you can correct those links. I have created a script that I am using mostly in my own projects, it can be useful to check all the files with that script.

find $directory -type f -name "*.md" -exec npx markdown-link-check "{}" \;

This will help you only in absolute links, not relative links.

kerrywei commented 2 years ago

@kerrywei Sounds good! Nice work documenting this 👍 Maybe move the contents to the README of https://github.com/onflow/flow/tree/master/docs, so the community can leverage it, too

@turbolent we just moved the internal doc contents to the README file at https://github.com/onflow/flow/tree/master/docs . updating the contents on Flow doc site should now be self-served by following the instructions there. let us know if anything is unclear, happy to iterate the doc to make it better

turbolent commented 2 years ago

@kerrywei Great work! 👍