From 7d55ccd36356f3140b54063b9c401aba47e5a7a0 Mon Sep 17 00:00:00 2001 From: Antoine Lambert <anlambert@softwareheritage.org> Date: Thu, 6 Feb 2025 14:00:17 +0100 Subject: [PATCH] docs: Fix some broken external links Those were spotted thanks to the sphinx linkcheck builder. --- docs/metadata-workflow.rst | 8 ++++---- swh/indexer/metadata_dictionary/npm.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/metadata-workflow.rst b/docs/metadata-workflow.rst index 7c7ba518..9f3f54f9 100644 --- a/docs/metadata-workflow.rst +++ b/docs/metadata-workflow.rst @@ -127,7 +127,7 @@ vocabulary to be useful, as with intrinsic metadata. The common vocabulary we chose is JSON-LD, with both CodeMeta and `ForgeFed's vocabulary`_ (including `ActivityStream's vocabulary`_) -.. _ForgeFed's vocabulary: https://forgefed.org/vocabulary.html +.. _ForgeFed's vocabulary: https://forgefed.org/spec/#vocab .. _ActivityStream's vocabulary: https://www.w3.org/TR/activitystreams-vocabulary/ Instead of the four-step architecture above, the extrinsic-metadata indexer @@ -168,7 +168,7 @@ The following sources of intrinsic metadata are supported: .. _codemeta.json: https://codemeta.github.io/terms/ .. _pom.xml: https://maven.apache.org/pom.html -.. _package.json: https://docs.npmjs.com/files/package.json +.. _package.json: https://docs.npmjs.com/cli/v11/configuring-npm/package-json .. _PKG-INFO: https://www.python.org/dev/peps/pep-0314/ .. _.gemspec: https://guides.rubygems.org/specification-reference/ @@ -178,7 +178,7 @@ Supported extrinsic metadata The following sources of extrinsic metadata are supported: * Codemeta documents sent by clients of :ref:`swh-deposit <swh-deposit>` (`HAL <https://hal.science/>`_, `eLife <https://elifesciences.org/>`_, `IPOL <https://www.ipol.im/>`_, ...) -* Gitea's `"repoGet" API <https://gittea.dev/api/swagger#/repository/repoGet>`__ +* Gitea's `"repoGet" API <https://docs.gitea.com/api/1.23/#tag/repository/operation/repoGet>`__ * GitHub's `"repo" API <https://docs.github.com/en/rest/repos/repos#get-a-repository>`__ @@ -243,7 +243,7 @@ values are simple text values. For instance, to These values will be automatically added to the above list of supported terms. -.. _translate Python PKG-INFO: https://forge.softwareheritage.org/source/swh-indexer/browse/master/swh/indexer/metadata_dictionary/python.py +.. _translate Python PKG-INFO: https://gitlab.softwareheritage.org/swh/devel/swh-indexer/-/blob/master/swh/indexer/metadata_dictionary/python.py Last step to get your code working: add a ``translate`` method that will take a single byte string as argument, turn it into a Python dictionary, diff --git a/swh/indexer/metadata_dictionary/npm.py b/swh/indexer/metadata_dictionary/npm.py index 733100f6..569baef8 100644 --- a/swh/indexer/metadata_dictionary/npm.py +++ b/swh/indexer/metadata_dictionary/npm.py @@ -37,7 +37,7 @@ class NpmMapping(JsonMapping, SingleFileIntrinsicMapping): } def normalize_repository(self, d): - """https://docs.npmjs.com/files/package.json#repository + """https://docs.npmjs.com/cli/v11/configuring-npm/package-json#repository >>> NpmMapping().normalize_repository({ ... 'type': 'git', @@ -75,7 +75,7 @@ class NpmMapping(JsonMapping, SingleFileIntrinsicMapping): return URIRef(url) def normalize_bugs(self, d): - """https://docs.npmjs.com/files/package.json#bugs + """https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bugs >>> NpmMapping().normalize_bugs({ ... 'url': 'https://example.org/bugs/', @@ -100,7 +100,7 @@ class NpmMapping(JsonMapping, SingleFileIntrinsicMapping): ) def translate_author(self, graph: Graph, root, d): - r"""https://docs.npmjs.com/files/package.json#people-fields-author-contributors' + r"""https://docs.npmjs.com/cli/v11/configuring-npm/package-json#people-fields-author-contributors' >>> from pprint import pprint >>> root = URIRef("http://example.org/test-software") @@ -260,7 +260,7 @@ class NpmMapping(JsonMapping, SingleFileIntrinsicMapping): return Literal(description) def normalize_license(self, s): - """https://docs.npmjs.com/files/package.json#license + """https://docs.npmjs.com/cli/v11/configuring-npm/package-json#license >>> NpmMapping().normalize_license('MIT') rdflib.term.URIRef('https://spdx.org/licenses/MIT') @@ -290,7 +290,7 @@ class NpmMapping(JsonMapping, SingleFileIntrinsicMapping): return SPDX + s def normalize_keywords(self, lst): - """https://docs.npmjs.com/files/package.json#homepage + """https://docs.npmjs.com/cli/v11/configuring-npm/package-json#homepage >>> NpmMapping().normalize_keywords(['foo', 'bar']) [rdflib.term.Literal('foo'), rdflib.term.Literal('bar')] -- GitLab