[Git][ghc/ghc][master] docs(sphinx): fix links to reverse flags when using the :ghc-flag:`-fno-<flag>` syntax

Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 28570c59 by Zubin Duggal at 2025-09-10T10:50:37-04:00 docs(sphinx): fix links to reverse flags when using the :ghc-flag:`-fno-<flag>` syntax This solution is rather hacky and I suspect there is a better way to do this but I don't know enough about Sphinx to do better. Fixes #26352 - - - - - 1 changed file: - docs/users_guide/flags.py Changes: ===================================== docs/users_guide/flags.py ===================================== @@ -236,8 +236,10 @@ class Flag(GenericFlag): reverse = self.options.get('reverse') if reverse is not None and reverse != '': # Make this also addressable via the reverse flag + # Strip leading hyphen to avoid double hyphen in anchor ID + clean_name = name[1:] if name.startswith('-') else name self.env.domaindata['std']['objects']['ghc-flag', reverse] = \ - self.env.docname, 'ghc-flag-%s' % name + self.env.docname, 'ghc-flag-%s' % clean_name # This class inherits from Sphinx's internal GenericObject, which drives # the add_object_type() utility function. We want to keep that tooling, View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/28570c596be4df36e5d83af0e4d50862... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/28570c596be4df36e5d83af0e4d50862... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)