Code Monkey home page Code Monkey logo

Comments (3)

gjtorikian avatar gjtorikian commented on July 22, 2024

You have a couple of options here:

  • If the new links point to known URLs, you can ignore the URLs directly: htmlproofer --ignore-urls "/www.github.com/,/foo.com/"
  • If you are able to edit the HTML directly, adding a data-proofer-ignore attribute to any element ignores any checks: <a href="https://notareallink" data-proofer-ignore>Not checked.</a>
  • You can also explicitly ignore specific files from checks: htmlproofer --ignore-files "/dir_of_new_files/, new_file.html"

Would any of these work for you? The GitHub Action example just collects all the new files and passes them into --ignore-files--you can provide your own list or a directory if that's easier.

from html-proofer.

gjtorikian avatar gjtorikian commented on July 22, 2024

(Closing this not because I won't keep helping if you have questions, but because I like to keep a clean issue list in my repos.)

from html-proofer.

lwasser avatar lwasser commented on July 22, 2024

hi 👋 thank you!! i definitely understand issue lists becoming unwieldy!
i think i may have poorly described the issue.

Essentially we are creating a new piece of content in the PR so the new link is a new page on the website. please see here: for an example (screenshot below as well). Essentially installable-code.html is a new page in our guidebook that we are adding. so every time we add a new page html proofer can't find it because it isn't online yet.

Screenshot 2024-01-08 at 6 43 52 PM

In the html-proofer readme, i see a section on ignoring new files.

the code is below and i think it's trying to parse through the files but skipping the newly added file (maybe)?:

directories = ['content']
merge_base = %x(git merge-base origin/production HEAD).chomp
diffable_files = %x(git diff -z --name-only --diff-filter=AC #{merge_base}).split("\0")
diffable_files = diffable_files.select do |filename|
  next true if directories.include?(File.dirname(filename))

  filename.end_with?(".md")
end.map { |f| Regexp.new(File.basename(f, File.extname(f))) }

HTMLProofer.check_directory("./output", { ignore_urls: diffable_files }).run

but

  1. i'm not sure how to implement this in my github action here.
  2. And i'm also not sure if i do implement that fix will it totally skip checking the new page for bad links and such as well?

i hope this makes more sense! Essentially each time i create a new website page, our build breaks because the new page is not yet online and as such it's a broken link according to HTML proofer (i think anyway that is what is happening). many thanks again!!

from html-proofer.

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.