Widget:ProjectLabel
From Makerpedia
<script> function appStart(){ if(pageParams["page"]){ new mw.Api().get({
action: 'query', prop: 'revisions', rvprop: 'content', titles: pageParams["page"], format: 'json'
}).done(function (pageData) {
var pageId = Object.keys(pageData.query.pages)[0]; var content = pageData.query.pages[pageId].revisions[0]['*']; var pageUrl = mw.util.getUrl(page.title);
const regex = /\[\[Category:(.*?)\]\]/gi; let categories = content.match(regex); console.log(categories);
}); } }
if(!window.widgets) window.widgets = []; window.widgets.push(appStart); </script>