openSUSE / wiki

openSUSE Wiki
http://en.opensuse.org
25 stars 17 forks source link

Leap version number parser extension #47

Open guoyunhe opened 5 years ago

guoyunhe commented 5 years ago

We have a lot of pages with something like:

# Leap 15.0
sudo zypper addrepo --refresh --priority 90 https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.0/packman.repo

Once latest Leap version released, the content has to be manually updated. This is a lot of work.

I am thinking to using a template for the version number. But it doesn't work inside <pre> or <SyntaxHighligh> tags. This is because parser extensions has high priority than templates. So we have to create a extension for that. Extension has another benefit: we can update all wikis without editing templates.

I will try it, not sure if it would work as I expected.

guoyunhe commented 5 years ago

This MediaWiki hook might be what we need. https://www.mediawiki.org/wiki/Manual:Hooks/ParserBeforeInternalParse