jevstrudel.git / jsdoc / jsdoc-synonyms.js

jsdoc-synonyms.js - Add support for @synonyms tag Copyright (C) 2023 Strudel contributors - see https://codeberg.org/uzu/strudel/activity/contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

7function defineTags(dictionary) {
8  dictionary.defineTag('synonyms', {
9    mustHaveValue: true,
10    onTagged: function (doclet, tag) {
11      doclet.synonyms_text = tag.value;
12      doclet.synonyms = doclet.synonyms_text.split(/[ ,]+/);
13    },
14  });
15
16  dictionary.defineTag('tags', {
17    mustHaveValue: true,
18    onTagged: function (doclet, tag) {
19      doclet.tags = tag.value.split(/[ ,]+/);
20    },
21  });
22}
24module.exports = { defineTags: defineTags };