Git Product home page Git Product logo

Comments (1)

tobias-hildebrandt avatar tobias-hildebrandt commented on June 16, 2024

One solution would be to make src/utils/sitegraph-generator.js ignore section links. Then it wouldn't throw any errors when the test is run. However, then some section links could be broken but not caught as an error during testing.

A more robust solution would be to make sure that the linked section (e.g. #beginner-guides) actually exists in the markdown file. I don't know much about parsing markdown in JS, but I'm sure there's a library for it. From a quick search, I found https://github.com/remarkjs/remark-validate-links, though I believe that requires the entire remark package as a dependency. So a lighter-weight package might be better. Alternatively, we could write our own section-link verifier: something that loads the entire markdown file, searches for section links, then searches the file for a section that corresponds to the link. Off the top of my head, a regex might be useful; the test could even be a shell script using grep.

Side note: the entire sitegraph generator file was last touched 2 years ago (see git blame) and I think this comment sums it up pretty well:
https://github.com/PittCSWiki/pittcswiki/blob/2c621c6104720d96f79bc5d2f20921e23c38fb80/src/utils/sitegraph-generator.js#L7

from pittcswiki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.