diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5c9b2e434e..f6918b531b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,6 +10,11 @@ repos: language: python additional_dependencies: - scour==0.38.2 + - id: gh-wiki-anchors + name: "Fix GitHub Wiki Anchors for Linkcheck" + types: [rst] + entry: tools/fixup_gh_wiki_anchors.py + language: python - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.1.0 hooks: diff --git a/source/chapters/appendix/mixxx_controls.rst b/source/chapters/appendix/mixxx_controls.rst index aa402c3632..48eb6632eb 100644 --- a/source/chapters/appendix/mixxx_controls.rst +++ b/source/chapters/appendix/mixxx_controls.rst @@ -782,7 +782,7 @@ Any control listed above for :mixxx:cogroupref:`[ChannelN]` will work for a samp When tapped repeatedly, adjusts the :term:`BPM` of the track on the deck (not the tempo slider!) to match the taps. - .. note:: If you want to change the :term:`rate` of the deck use `script.bpm.tapButton(deck) `_ in your controller mapping instead. + .. note:: If you want to change the :term:`rate` of the deck use `script.bpm.tapButton(deck) `_ in your controller mapping instead. :range: binary :feedback: :term:`BPM` value display (playback speed doesn't change) diff --git a/source/conf.py b/source/conf.py index 19c1a8ce58..0fdec48fc4 100644 --- a/source/conf.py +++ b/source/conf.py @@ -447,6 +447,12 @@ # Ignore Twitter links because for some reason valid links sometimes fail # with "400 Bad Request" r"^https://twitter.com/\w+$", + "https://support.native-instruments.com/hc/en-us/articles/360001108518", + "https://support.serato.com/hc/en-us/articles/203593924-Vestax-Hardware-Drivers-and-Firmware", + "https://www.numark.com/images/product_downloads/MixtrackPro3-UserGuide-v1.1.pdf", + "https://www.numark.com/product/*", + "https://www.pioneerdj.com/en/support/software/controller/*", + "https://www.roland.com/global/products/dj-505/downloads", ] # Avoid freezing during linkcheck diff --git a/source/hardware/controllers/numark_mixtrack_pro_fx.rst b/source/hardware/controllers/numark_mixtrack_pro_fx.rst index d9b7046c24..013b6ea389 100644 --- a/source/hardware/controllers/numark_mixtrack_pro_fx.rst +++ b/source/hardware/controllers/numark_mixtrack_pro_fx.rst @@ -233,7 +233,7 @@ There are a few configurable values at the top of the script (:file:`Numark-Mixt '``beatJumpValues``', '["0.0625\_", "0.125\_", "0.25\_", "0.5\_", "1\_", "2\_", "", "8\_"]', 'Beatjump values for the beatjump pad mode, each value corresponds to one of the pads. The empty value ("") means the value set in Mixxx (4 by default). Underscores (_) are needed because of that control, which has one underscore in the name, as opposed to beatjump controls with predetermined values which have two underscores.' .. hint:: - See `here `_ for more info about constants used in scratching. + See `here `_ for more info about constants used in scratching. Notes ----- diff --git a/tools/fixup_gh_wiki_anchors.py b/tools/fixup_gh_wiki_anchors.py new file mode 100755 index 0000000000..8f3d3d21f4 --- /dev/null +++ b/tools/fixup_gh_wiki_anchors.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +import argparse +import re + +URL_REGEX = ( + r"(?Phttps?:\/\/github.com\/\S*\/\S*\/wiki\/\S*)\#" + r"(?:user-content-)?(?P\S*)" +) +URL_SUB = r"\g#user-content-\g" + + +def main(argv=None): + parser = argparse.ArgumentParser() + parser.add_argument("input_file", nargs="+") + args = parser.parse_args(argv) + for filepath in args.input_file: + with open(filepath, "r") as file: + file_content = file.read() + subbed = re.sub(URL_REGEX, URL_SUB, file_content) + with open(filepath, "w") as file: + file.write(subbed) + + +if __name__ == "__main__": + main()