====Profile Information
Name: Lennard Hofmann
GitHub Profile: [[https://github.com/Ordoviz|Ordoviz]]
Location: Germany
Typical working hours: 10:00–20:00 (UTC+2)
====Synopsis
Almost 4 million category pages on Wikimedia Commons use the [[https://commons.wikimedia.org/wiki/Template:Wikidata_Infobox|Wikidata Infobox template]], which is not implemented efficiently: Previewing a category page can take several seconds—long enough to be annoying. This project aims to address this problem by rewriting the infobox in [[https://en.wikipedia.org/wiki/Wikipedia:Lua|Lua]].
@Mike_Peel is the mentor of this project. I have sent him my code for the microtasks, to which he replied: "The code for both microtasks looks good, and works well!"for this project.
====Implementation Ideas
Currently, the infobox requests the values for certain Wikidata properties individually, resulting in hundreds of calls to Lua modules. Since the infobox needs almost everything from the connected Wikidata item, I am planning to write a Lua module that fetches this data in a single request using [[https://doc.wikimedia.org/Wikibase/master/php/md_docs_topics_lua.html|mw.wikibase.getEntity]]. A similar infobox, [[https://www.wikidata.org/wiki/Module:Databox|Module:Databox]] uses this approach successfully: It even processes [[https://www.wikidata.org/wiki/Q87483673|"COVID-19 pandemic in Colombia"]] (one of the biggest Wikidata items) quickly.
====Timeline
<table>
<tr>
<th>Period</th>
<th>Tasks</th>
</tr>
<tr>
<th>May 20 – June 12
(Community Bonding Period)</th>
<td>
Figure out how to communicate and work together effectively.
Produce an infobox skeleton with Lua.
Discuss how to handle Wikidata items with dozens of values for a single property (as seen on [[https://commons.wikimedia.org/wiki/Category:LibreOffice|Category:LibreOffice]]).
</tr>
<tr>
<th>June 13 – June 19
(1 week)</th>
<td>
Write Lua functions to fill the infobox skeleton with content from Wikidata.
Document these functions so that Mike Peel and others can easily use them to extend the infobox.</td>
</tr>
<tr>
<th> June 20 – July 10
(3 weeks)</th>
<td>Rewrite most property requests in Lua, many of which look like `{{#invoke:Wikidata Infobox|formatLine|P196| {{#invoke:WikidataIB|getValue|P196|…}} }}` and can easily be rewritten. The other requests are more complex;If I manage to complete any task ahead of schedule, porting those will take some time.</td>
</tr>
<tr>
<th>July 11 – July 24
(2 weeks)</th>
<td> Port features from old infobox: Label,I will start working on the next task. descriptionIn that case, imagesthe left-over time at the end of the project will be used to fix bugs reported on the talk page, and sitelinks (displayed at the top of the infobox)</td>
</tr>
<tr>
<th>July 25 – July 29</th>
<td>Phase 1 Evaluation</td>
</tr>
<tr>
<th>July 25 – August 7
(2 weeks)</th>
<td>Port a feature from old infobox: Automatic categorization (autocat) </td>such as [[https://commons.wikimedia.org/wiki/Template_talk:Wikidata_Infobox#'none'_values_in_Wikidata_break_this_template|'none' values breaking the template]].
=====May 20 – June 12 (Community Bonding Period)
</tr>* Figure out how to communicate and work together effectively.
<tr>* Discuss how to handle Wikidata items with dozens of values for a single property (as seen on [[https://commons.wikimedia.org/wiki/Category:LibreOffice|Category:LibreOffice]]).
<th>August 8 – August 14* Write Lua functions that fetch content from Wikidata.
(1 week)</th>* Document these functions so that Mike Peel and others can easily use them to extend the infobox.
===== June 13 – July 10 [4 weeks]
<td>Port features from old infobox: Authority control and helper links (displayed at the bottom of the infobox)</td>* Rewrite most property requests in Lua, many of which look like `{{#invoke:Wikidata Infobox|formatLine|P196| {{#invoke:WikidataIB|getValue|P196|…}} }}` and can easily be rewritten. The other requests are more complex; porting those will take some time. [3 weeks]
</tr>* Test and deploy the new property requests. Fix bugs reported by the community. [1 week]
=====July 11 – July 31 [3 weeks]
<tr>* Port features from old infobox: Label, description, images, and sitelinks (displayed at the top of the infobox). [2 weeks]
<th>August 15 – August 28* Test and deploy those features. Fix bugs reported by the community. [1 week]
(2 weeks)</th>* Phase 1 Evaluation [July 25 – July 29]
=====August 1 – August 21 [3 weeks]
<td>Solve unexpected problems that arose during the project. If there is still time, fix bugs reported on the talk page,* Port a feature from old infobox: Automatic categorization (autocat). such as [[https://commons.wikimedia.org/wiki/Template_talk:Wikidata_Infobox#'none'_values_in_Wikidata_break_this_template|'none' values breaking the template]].</td>[2 weeks]
</tr>* Test and deploy autocat. Fix bugs reported by the community. [1 week]
=====August 22 – September 4 [2 weeks]
<tr>* Port features from old infobox: Authority control and helper links (displayed at the bottom of the infobox) [1 week]
<th>August 29* Test and deploy those features. Fix bugs reported by the community. [1 week]
=====September 5 – September 4 12 [1 week]
(1 week)</th>The code should look like this now (massively simplified):
<td> Test how the new infobox looks on random categories.```name=Template:Wikidata Infobox/core, Fine-tuning.</td>lang=html
</tr>{{#invoke:Wikidata Infobox|autocat}}
<trtable class="infobox">
<th>September 5 – September 12 {{#invoke:Wikidata Infobox|header}}
(Final week)</th> {{#invoke:Wikidata Infobox|properties}}
<td> {{#invoke:Wikidata Infobox|footer}}
Get feedback from the community.</table>
Submit finished project and final mentor evaluation```
* Rewrite it so that it invokes `Wikidata Infobox` only once for maximum performance.
</tr>* Call for feedback from the community ("Tell us how the new infobox looks on your favorite categories!")
</table>* Submit finished project and final mentor evaluation.
====Participation
I will publish my code on sandbox pages ([[https://commons.wikimedia.org/wiki/Module:Sandbox/Module:Wikidata_Infobox|here]] and [[https://commons.wikimedia.org/wiki/User:LennardHofmann/sandbox/Template:Wikidata_Infobox|here]] to be precise; this should allow us to test the new module on any category using [[https://commons.wikimedia.org/wiki/Special:TemplateSandbox|Special:TemplateSandbox]]). I will stay in contact with Mike Peel on Zulip. For proposing changes to the template that need to be discussed in a larger group, I will resort to the [[https://commons.wikimedia.org/wiki/Template_talk:Wikidata_Infobox|template's talk page]]. I will write bi-weekly blog posts documenting my progress.
====About Me
I am a 19-year-old student from Germany. When the community bonding period starts on May 20, I will have written my final Abitur exam, allowing me to fully focus on this project. Apart from a few individual days, I have no time commitments during the coding phase.
When I signed up on Wikipedia in 2017 I had no clue what I got myself into. Now, I am an active editor on Wikimedia and Fandom wikis, partly because I enjoy solving the technical challenges that come with maintaining a wiki. Since I love wikis and free software, I immediately went to see which projects Wikimedia has to offer when I heard about GSoC on [[https://en.wikipedia.org/wiki/Mastodon_(software)|Mastodon]]. This project caught my attention because figuring out how a template works is something I regularly do, but writing Lua modules is still pretty new and exciting to me.
I hope to gain experience through my internship that I can use in future projects to continue being a contributing member to the community beyond the summer.
Note that I am intentionally not linking to my Wikimedia account because I want to keep it separate from my real life identity for now. I have created a new account for this project.
====Past Experience
I have contributed to templates and modules in the German Wikipedia. Recently, I have fixed a little bug in Module:Databox (see [[https://www.wikidata.org/wiki/Module_talk:Databox|its talk page]]) and an "expression error" in the Wikidata Infobox (see [[https://commons.wikimedia.org/wiki/Template_talk:Wikidata_Infobox#Expression_error|here]]).
I have made various small contributions too various other open-source projects, including a [[https://github.com/Ordoviz/mediawiki.kak|MediaWiki syntax highlighter for the Kakoune text editor]] and a [[https://lore.kernel.org/util-linux/?q=lennard+hofmann&o=-1|patch to column(1)]] from [[https://en.wikipedia.org/wiki/Util-linux|util-linux]].