Topic on Talk:Parsoid

expand templates locally

7
Summary by Arlolra

Import templates to your wiki

111.125.208.58 (talkcontribs)

I have mediawiki and parsoid setup locally

I am trying to expand templates locally, while coverting from wikitetx to HTML. But templates remain as it is.

can anyone suggest where i am going wrong

Arlolra (talkcontribs)

Are the templates defined in your local mediawiki instance?

111.125.208.58 (talkcontribs)

How to do it,

I have enabled few extensions like ParserFunctions, Scribunto, to expand templates.

I am trying to convert "{{Convert|907|hp|kW PS|0|abbr=on}}" --> "907 hp (676 kW; 920 PS)" but i get output as "Template:Convert"


Arlolra (talkcontribs)

You need to create a page on your local wiki, //localhost/wiki/Template:Convert, or whathaveyou.

You can copy the source from enwiki, https://en.wikipedia.org/w/index.php?title=Template:Convert&action=edit

Although, that seems to invoke a Scribunto module, so you'll also need a //localhost/wiki/Module:Convert as well.

Again, the source can be copied from, https://en.wikipedia.org/w/index.php?title=Module:Convert&action=edit

Alternatively, depending on how you're planning on using the tool, you can set --domain en.wikipedia.org to use the templates defined there, but then you won't have access to the pages on your local wiki.

SSastry (WMF) (talkcontribs)
111.125.208.58 (talkcontribs)

@Arlolra and @SSastry (WMF) Thanks for guidinig me through the solution,

Another question has arised to me, likewise i have multiple templates which i need to expand while converting from wikitext to HTML. So manual importing of each template could be cumbersome. Is there a way to download all the template dumps at once and then import to local mediwaiki.

Arlolra (talkcontribs)

Again, you might want to consider parsing with --domain en.wikipedia.org or wherever you're getting this content from, rather than your local wiki

There are larger project dumps you can import at https://meta.wikimedia.org/wiki/Data_dumps