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.10.tar.gz (5.6 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.10-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: regisoup-0.1.10.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.11.2 Linux/6.2.8-200.fc37.x86_64

File hashes

Hashes for regisoup-0.1.10.tar.gz
Algorithm Hash digest
SHA256 9a81af85d944173aab189e2ab6ab36712a48324b9bd4f8289ba31fc0fa194c21
MD5 af004cd094ce2204e3a9f7a120a51e65
BLAKE2b-256 2281c352d53f212899a2baa352b54385e3cb091998c785aa7fa9873e1cf04e7b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for regisoup-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 78c7e7afaa3fded66fe8fc26b825c3d6914547b5bf77f395db448e44a99a898f
MD5 f573ee0e556d2d116d073abfbd62ba1a
BLAKE2b-256 111803b6c4aa8314f515fe8275ffc0417d94a92bd8b14e5956f296cc9b40e3d7

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