Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eccenux/wiki-deduplicaterefs
A module to deduplicate citations in <ref> tags based on their content.
https://github.com/eccenux/wiki-deduplicaterefs
references wikipedia wikitext
Last synced: about 2 months ago
JSON representation
A module to deduplicate citations in <ref> tags based on their content.
- Host: GitHub
- URL: https://github.com/eccenux/wiki-deduplicaterefs
- Owner: Eccenux
- Created: 2024-06-08T08:44:41.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-26T23:14:08.000Z (6 months ago)
- Last Synced: 2024-06-27T02:55:08.922Z (6 months ago)
- Topics: references, wikipedia, wikitext
- Language: JavaScript
- Homepage: https://pl.wikipedia.org/wiki/User:Nux/Refdedu
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
README.md
# RefdeduA module to deduplicate citations in `` tags in wikitext.
Duplicate ref is a tag that:
1. Contains the same url (exactly the same url).
2. Have the same contents.
3. Have the same site parameters (in whatever order). So when split by pipe, trimmed, joined and ordered and joined again have the same contents.## Installation
```bash
npm install wiki-refdedu
```## Usage in NodeJS
```javascript
const deduplicateRefs = require('wiki-refdedu');var text = `
Some text with refs.{{cite|url=https://example.com|content1|content2}}
More text.{{cite|url=https://example.com|content2|content1}}
Even more text.{{cite|url=https://example.com|content2|content1}}
`;
var deduplicatedText = deduplicateRefs(text);
console.log(deduplicatedText);
```## Test and build
To run tests, use the following command:
```bash
npm test
npm run build
```## Contributing
Contributions are welcome! Please open an issue or submit a pull request.
## License
This project is licensed under the MIT License.
Main author: Maciej Nux Jaros.