Skip to main content

Convert <figure> and <xr> tags from deprecated MediaWiki extension to a new supported format.

Project description

RegiSoup: Just Reg(Ex)ular and Beautiful Soup

A tool to convert <figure> and <xr> tags from deprecated MediaWiki extension to a new supported format as specified in the extension Figures available on: https://www.mediawiki.org/wiki/Extension:Figures.

It was developed to mass modify pages via modifying the Wiki's .xml dump but it turns out that that is not a viable approach since <text> blocks inside the .xml dump are hashed with sha1 and additionally have a size in bytes specified. It was simpler to create a MediaWiki API wrapper for RegiSoup so the original use case for RegiSoup has translated StewChef but RegiSoup remains a standalone package.

Usage:

Usage of RegiSoup is simple and easy. If at any point in time, you need a reminder of what anything means do not forget about:

regisoup --help

where a lot of information about the tool is gathered. Basic usage is as follows:

regisoup [input_file] [output_file]

RegiSoup should find and replace all <figure> and <xr> tags inside the input page. All the required information for the replacement MediaWiki parser functions is extracted from the existing tags or RegiSoup at least attempts to do so. One of the issues you may commonly run into is pages not specifying which page they are referencing. This can be quickly fixed by supplying the extra field for page title. For example:

regisoup [input_file] [output_file] 'Some Page Title'

Note the use of quotation marks! Another issue you can run into is captions being improperly specified. By default RegiSoup uses captions to generate the replacement parser functions. You can override this by supplying --no-caption. Some Wiki pages contain unescaped HTML characters, RegiSoup gets around this by doing a bit of encoding "magic". If this produces undesirable results you can try and supply the --no-magic flag and see if that works out better. Additionally for debugging support RegiSoup can be forced to not delete it's temporary files with --no-clean-up and be made more verbose with --verbose.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

regisoup-0.1.11.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

regisoup-0.1.11-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file regisoup-0.1.11.tar.gz.

File metadata

  • Download URL: regisoup-0.1.11.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Linux/6.2.8-200.fc37.x86_64

File hashes

Hashes for regisoup-0.1.11.tar.gz
Algorithm Hash digest
SHA256 703c4a95e421f546a5b736c7d77cfc98f03cb2b4ceee7947d1be76f4d62b7677
MD5 bfba9cdfd54c76b52b368d79447bcdab
BLAKE2b-256 5d068291a410f5035de04f6a159bf9bb659b7ee6a250b49824c9d50725f89bf8

See more details on using hashes here.

File details

Details for the file regisoup-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: regisoup-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Linux/6.2.8-200.fc37.x86_64

File hashes

Hashes for regisoup-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 99123337400c45ec128ef7b68dc41569cad4f9af01b25b3974eb168c6450cb80
MD5 977f90336dd371c846fd71e31907d335
BLAKE2b-256 c9d2134a515aa3e0263a8e550d16bd7693e95f76c616977e2ae5cd0e19a0740e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page