Files
Brig/spec.md
2026-01-25 16:47:18 -05:00

1.8 KiB

Spec: Wikimedia article manipulation library

Goal: Create a rust library providing high level and low level functions manipulating the properties and the content of wikimedia pages. This library must ne built on top of the 2 existing rust libraries parse_wiki_text and parse_wiki_text to implement those functionalities

User Story 1: As a user, I want to get the raw text content of a wikimedia article by specifying the site, language and article name. User Story 2: As a user, I want to get the list of all the links of an article User Story 3: As a user, I want to get the list of all the categories of an article User Story 4: As a user, I want to get the list of all the references of an article User Story 5: As a user, I want to get the list of all the templates of an article User Story 6: As a user, I want to get the list of all the parameters of a template

Functional Requirements:

  1. Use mediawiki_rest_api to get access to the wikimedia article
  2. Use mediawiki_rest_api to get the initial content of the article
  3. Use parse_wiki_text to parse the wikimedia article
  4. Use parse_wiki_text to interact with any internal content of the article
  5. Use parse_wiki_text nodes
  6. Always write unit tests for every functions

Technical Constraints:

  • rust language
  • mediawiki_rest_api
  • parse_wiki_text

Test Cases:

  • Scenario A: Valid access -> Status 200 + content of the article.
  • Scenario B: Valid access -> Status 200 + categories of the article.
  • Scenario C: Valid access -> Status 200 + links of the article.
  • Scenario D: Valid access -> Status 200 + references of the article.
  • Scenario E: Valid access -> Status 200 + templates of the article.
  • Scenario F: Valid access -> Status 200 + parameters of a template.
  • Scenario Z: Incorrect article -> Status 401 + error message.