2

Wikipedia and its sister sites make heavy use of templates. I want to find the source code behind those templates, i.e. the code that renders the HTML from a given template reference.

Looking here, I found a few files which seem to deal with templates, but I could not find any results when looking for a specific one. For example, the template {es-conj}, which renders a conjugation table for a given Spanish verb, did not show up in the search list.

2 Answers2

1

Turns out, the source code of the template is saved as plain-text in the template's wiki page itself. To see the source code of the template {es-conj}, just go to its page and click Edit:

https://en.wiktionary.org/wiki/Template:es-conj

  • For most templates, that shows the wiki-code, not the HTML, generated by the templates. To get the generated HTML you'd need to look into the source code of Mediawiki itself. – gerrit Jun 29 '22 at 07:47
0

You can check the templates involved in generating the page via page information, linked from the sidebar on desktop skins (e.g.). There's an edit / view source link for each.

You can also add ?action=raw&templates=expand to the URL of a page to see the page source after all templates have been processed.

Tgr
  • 216
  • 1
  • 5