From d841d5b6a962a45a176d8dbe3ba846e7e0b9a9a4 Mon Sep 17 00:00:00 2001 From: coder999999999 Date: Sun, 22 Mar 2026 23:15:30 -0400 Subject: [PATCH] Add LibreJS and SPDX license headers to bundled JavaScript files Add machine-readable license information to the three JavaScript files shipped with the basic Sphinx theme: - doctools.js - searchtools.js - sphinx_highlight.js Each file now includes: - SPDX-FileCopyrightText and SPDX-License-Identifier headers per the REUSE specification (https://reuse.software/) - @license / @license-end tags per the GNU LibreJS specification (https://www.gnu.org/software/librejs/) using the BSD-2-Clause magnet link This allows LibreJS to recognize Sphinx-generated JS as freely licensed, instead of blocking it as non-free. Closes #12323 --- sphinx/themes/basic/static/doctools.js | 7 +++++++ sphinx/themes/basic/static/searchtools.js | 7 +++++++ sphinx/themes/basic/static/sphinx_highlight.js | 11 ++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sphinx/themes/basic/static/doctools.js b/sphinx/themes/basic/static/doctools.js index 807cdb176c0..47e78bf1bc1 100644 --- a/sphinx/themes/basic/static/doctools.js +++ b/sphinx/themes/basic/static/doctools.js @@ -1,5 +1,10 @@ /* * Base JavaScript utilities for all Sphinx HTML documentation. + * + * SPDX-FileCopyrightText: Sphinx team (see AUTHORS file) + * SPDX-License-Identifier: BSD-2-Clause + * + * @license magnet:?xt=urn:btih:87f119ba0b429ba17a44b4bffcab33165ebdacc0&dn=freebsd.txt BSD-2-Clause */ "use strict"; @@ -148,3 +153,5 @@ const Documentation = { const _ = Documentation.gettext; _ready(Documentation.init); + +// @license-end diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js index e29b1c754ba..7b71d617a5f 100644 --- a/sphinx/themes/basic/static/searchtools.js +++ b/sphinx/themes/basic/static/searchtools.js @@ -1,5 +1,10 @@ /* * Sphinx JavaScript utilities for the full-text search. + * + * SPDX-FileCopyrightText: Sphinx team (see AUTHORS file) + * SPDX-License-Identifier: BSD-2-Clause + * + * @license magnet:?xt=urn:btih:87f119ba0b429ba17a44b4bffcab33165ebdacc0&dn=freebsd.txt BSD-2-Clause */ "use strict"; @@ -691,3 +696,5 @@ const Search = { }; _ready(Search.init); + +// @license-end diff --git a/sphinx/themes/basic/static/sphinx_highlight.js b/sphinx/themes/basic/static/sphinx_highlight.js index a74e103a831..75045481ac9 100644 --- a/sphinx/themes/basic/static/sphinx_highlight.js +++ b/sphinx/themes/basic/static/sphinx_highlight.js @@ -1,4 +1,11 @@ -/* Highlighting utilities for Sphinx HTML documentation. */ +/* + * Highlighting utilities for Sphinx HTML documentation. + * + * SPDX-FileCopyrightText: Sphinx team (see AUTHORS file) + * SPDX-License-Identifier: BSD-2-Clause + * + * @license magnet:?xt=urn:btih:87f119ba0b429ba17a44b4bffcab33165ebdacc0&dn=freebsd.txt BSD-2-Clause + */ "use strict"; const SPHINX_HIGHLIGHT_ENABLED = true; @@ -157,3 +164,5 @@ _ready(() => { if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); SphinxHighlight.initEscapeListener(); }); + +// @license-end