Editing User:Pharap/Wiki Improvement Proposals

From Guild of Archivists
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 12: Line 12:
==== Summary ====
==== Summary ====


The wiki has [[Dictionary:Full_Word_List|an extensive dictionary]] which at the moment isn't being particularly well leveraged from within templates and articles. I propose to change that by adding some templates that could make use of the dictionary in conjuction with the D'ni rendering capabilities of the wiki to provide rendered D'ni with hover text that provides information from the D'ni dictionary.
At the moment the it is possible to insert D'ni text and write D'ni words in romanised form, and the wiki has an extensive dictionary. (See: [[:Category:D'ni words]].)


Notably, the hover text would be able display the three main ways of writing that word ([[Dnifont]], [[OTS]], and [[NTS]]), as well as the IPA pronunciation of the word.
What I would like to propose is a template that could leverage these features and produce a tooltip that provides information from the D'ni dictionary. Most importantly, it should include the three main ways of writing that word ([[Dnifont]], [[OTS]], and [[NTS]]) as well as the IPA pronunciation of the word. This could ideally be applied to words written in any of Dnifont, OTS, or NTS, so that any of the three could provide relevant contextual information.
 
(It may also be worth including the meaning or meanings, or whether the word is e.g. a noun or a verb, provided that those don't flood the tooltip with too much information. Though I am less committed to those than I am to the basic romanisation and pronunciation.)


==== Reasoning ====
==== Reasoning ====


This feature would make it easier to provide more linguistic information with less markup and less effort.
This feature would make it easier to provide more linguistic information with less markup or effort on the part of an article writer. If implemented in the ideal way (see [[#Example|Example]] below), contributors would (for the most part) no longer have to remember how to write Dnifont. They would only have to remember the name of the corresponding <code>Dictionary:</code> page.
 
Paradoxically, despite no longer having to remember how to write in Dnifont, this feature would actually make using Dnifont easier as it would be displayed within the tooltip on any in-page D'ni words.


The primary way of implementing this template (see [[#Example|Example]] below) would allow using the name of the dictionary entry, which is likely easier for those who are not well-versed in Dnifont. However, a secondary implementation supporting Dnifont may be provided.
This would also avoid the potential confusion that might arise as to which of the romanisation styles is in use since all three styles would always be displayed.


Having the IPA pronunciation would be particularly useful considering how many pages currently feature rendered Dnifont and OTS-style words but lack any corresponding IPA. The presence of IPA would be incredibly useful for readers who understand the meaning of the IPA symbols, as it would help them to know how to pronounce the various D'ni words and names that crop up throughout the wiki.
Having the IPA pronunciation code as well would be a nice little bonus considering how many pages feature rendered Dnifont and OTS-style words but lack any corresponding IPA. The presence of IPA would be incredibly useful for readers who understand it as it would help them to know how to pronounce the various D'ni words and names that crop up throughout the wiki. Particularly on [[Age]] articles, and on articles for characters with D'ni names like [[Aitrus]], [[Ti'ana]], and [[Gehn]].


==== Example ====
==== Example ====


A usage like <code><nowiki>{{D'ni word OTS|Teledahn}}</nowiki></code> could appear as thus: {{User:Pharap/Templates/D'ni word OTS|Teledahn}}.
A usage like <code><nowiki>{{D'ni dict page|Teledahn}}</nowiki></code> could appear as thus:
<span title="Dnifont: teleDan, OTS: teledahn, NTS: teledan, IPA: /tɛ.lɛ.dɑn/" style="border-bottom: 1px dotted"><dni>teleDan</dni></span>


Hence one would only need to remember the name of the dictionary entry, and the template will generate all relevant information as part of the hover text.
Hence one would only need to remember the name of the dictionary entry and the template could do the rest.


Alternatively, a variant like <code><nowiki>{{D'ni word Dnifont|teleDan}}</nowiki></code> accepting Dnifont could also be permitted, as well as possibly a form that could accept either argument, such as <code><nowiki>{{D'ni word|ots=Teledahn}}</nowiki></code> and <code><nowiki>{{D'ni dict|dnifont=teleDan}}</nowiki></code>, perhaps even having <code><nowiki>{{D'ni word|Teledahn}}</nowiki></code> be treated as <code><nowiki>{{D'ni word|ots=Teledahn}}</nowiki></code>.
Alternatively, a usage like <code><nowiki>{{D'ni dict word|teleDan}}</nowiki></code> accepting Dnifont could also be permitted, as well as possibly a form that could accept either argument, such as <code><nowiki>{{D'ni dict|page=Teledahn}}</nowiki></code> and <code><nowiki>{{D'ni dict|word=teleDan}}</nowiki></code>.


Ideally the hover text would be better formatted, more like the <nowiki>[[Has length::30 cm]]</nowiki> property from the Semantic MediaWiki addons: [[Has length::30 cm]], but I have yet to investigate how that might be achieved.
Ideally the toolbox would be better formatted, more like the <nowiki>[[Has length::30 cm]]</nowiki> property from the Semantic MediaWiki addons: [[Has length::30 cm]], but I have yet to investigate how that might be achieved.


==== Implementation ====
==== Implementation ====


As a proof of concept, I have implemented all the aforementioned templates:
So far I have been able to implement all the tooltip information and a Dnifont argument, as well as the ability to specify a dictionary entry name, but I haven't yet worked out a good way to create a template that supports both. However, it may actually be better to simply offer two different templates rather than one dual-purpose template. To avoid maintenance issues, one could be implemented in terms of the other.
 
As a proof of concept, I have implemented both possible templates:
* A template that accepts [[Dnifont]]:
** <code>{{(}}{{(}}[[User:Pharap/Templates/Dnidict word]]<nowiki />{{!}}teleDan{{)}}{{)}}</code> →{{User:Pharap/Templates/Dnidict word|teleDan}}
* A template that accepts a [[Dictionary:Full Word List|Dictionary]] page name:
* A template that accepts a [[Dictionary:Full Word List|Dictionary]] page name:
** <code><nowiki>{{</nowiki>[[User:Pharap/Templates/D'ni word OTS]]<nowiki>|</nowiki>Teledahn<nowiki>}}</nowiki></code> → {{User:Pharap/Templates/D'ni word OTS|Teledahn}}
** <code>{{(}}{{(}}[[User:Pharap/Templates/Dnidict page]]<nowiki />{{!}}Teledahn{{)}}{{)}}</code> → {{User:Pharap/Templates/Dnidict page|Teledahn}}
* A template that accepts [[Dnifont]]:
 
** <code><nowiki>{{</nowiki>[[User:Pharap/Templates/D'ni word Dnifont]]<nowiki>|</nowiki>teleDan<nowiki>}}</nowiki></code> → {{User:Pharap/Templates/D'ni word Dnifont|teleDan}}
(Note that I am temporarily using subpages of my user page to provide templates that call the <code>dnifont2ots</code> and <code>dnifont2nts</code> functions exposed by the [[Module:Dict D'ni|Dict D'ni]] module as template wrappers are necessary for them to function correctly outside of the module. Only the former is needed as part of the implementation, but it may be worth providing both for future use.)
* A template that accepts either:
** <code><nowiki>{{</nowiki>[[User:Pharap/Templates/D'ni word]]<nowiki>|</nowiki>Teledahn<nowiki>}}</nowiki></code> → {{User:Pharap/Templates/D'ni word|Teledahn}}
** <code><nowiki>{{</nowiki>[[User:Pharap/Templates/D'ni word]]<nowiki>|</nowiki>ots=Teledahn<nowiki>}}</nowiki></code> → {{User:Pharap/Templates/D'ni word|ots=Teledahn}}
** <code><nowiki>{{</nowiki>[[User:Pharap/Templates/D'ni word]]<nowiki>|</nowiki>dnifont=teleDan<nowiki>}}</nowiki></code> → {{User:Pharap/Templates/D'ni word|dnifont=teleDan}}


Discovering how to implement this solution took me quite a lot of research as at first I didn't know about the existance of the [[Property:OTS|OTS]], [[Property:NTS|NTS]], and [[Property:IPA|IPA]] properties, as their existence was somewhat buried in the [[Module:Dict D'ni|Dict D'ni]] module and {{tl|IPA}} template respectively. After figuring those out I managed to discover some modules that support the '<code>dnifont2ots</code>' and '<code>dnifont2nts</code>' functions.
I went through a lot of false starts before arriving at my final implementations because it took me a while to discover that the [[Property:OTS|OTS]], [[Property:NTS|NTS]], and [[Property:IPA|IPA]] properties already existed, as their existence was somewhat buried in the [[Module:Dict D'ni|Dict D'ni]] module and {{tl|IPA}} template respectively.


It also took me a while to realise that the syntax <code><nowiki>[[Property::Value]]</nowiki></code> can be used to declare a value for a property in the same way as <code><nowiki>{{#set: Property=Value}}</nowiki></code>, and that consequently the following two lines of the D'ni Dict module are producing two properties:
In the case of the former, it took me a while to realise that the syntax <code><nowiki>[[Property::Value]]</nowiki></code> can be used to declare a value for a property in the same way as <code><nowiki>{{#set: Property=Value}}</nowiki></code>, and that consequently the following two lines of the D'ni Dict module are producing two properties:
* <code><nowiki>output = output..'* [[OTS]]: [[OTS::'..dnifont2ots(args['dnifont'])..']]\n'</nowiki></code>
* <code><nowiki>output = output..'* [[OTS]]: [[OTS::'..dnifont2ots(args['dnifont'])..']]\n'</nowiki></code>
* <code><nowiki>output = output..'* [[NTS]]: [[NTS::'..dnifont2nts(args['dnifont'])..']] '</nowiki></code>
* <code><nowiki>output = output..'* [[NTS]]: [[NTS::'..dnifont2nts(args['dnifont'])..']] '</nowiki></code>
Line 58: Line 63:
In the case of the {{tl|IPA}} template, I simply hadn't peeked at its source. At one point I had separately thought of the possibility of including such a property in the {{tl|IPA}} template, but for a while after I had simply presumed that it wouldn't be there and hadn't thought to check until I ended up looking at the source by chance when editing my User page and noticing the property's presence.
In the case of the {{tl|IPA}} template, I simply hadn't peeked at its source. At one point I had separately thought of the possibility of including such a property in the {{tl|IPA}} template, but for a while after I had simply presumed that it wouldn't be there and hadn't thought to check until I ended up looking at the source by chance when editing my User page and noticing the property's presence.


After getting a working prototype, I went back and refined the templates several times, including changes such as adding a <code>link</code> parameter, changing how I was using the 'dnifont2ots' facilities (due to discovering a second module with the same functionality), and splitting the hover text over multiple lines.
Fortunately, the fact the properties I had been intending to suggest be created already exist means implementing this proposal would be relatively straightforward and only require the creation of three templates, all of which have already been trialled...
* <code>{{(}}{{(}}[[User:Pharap/Templates/Dnidict word]]{{)}}{{)}}</code>, likely as {{tl|D'ni dict word}} or similar.
* <code>{{(}}{{(}}[[User:Pharap/Templates/Dnidict page]]{{)}}{{)}}</code>, likely as {{tl|D'ni dict page}} or similar.
* <code>{{(}}{{(}}[[User:Pharap/Templates/Dni to OTS]]{{)}}{{)}}</code>, likely as {{tl|D'ni to OTS}} or similar.
 
Additionally, it may be worth implementing a wrapper template for {{tl|D'ni dict word}} and {{tl|D'ni dict page}} to permit using either as originally suggested. For example:
* <code><nowiki>{{D'ni dict|dnifont=teleDan}}</nowiki></code> → <code><nowiki>{{D'ni dict word|teleDan}}</nowiki></code>
* <code><nowiki>{{D'ni dict|page=Teledahn}}</nowiki></code> → <code><nowiki>{{D'ni dict page|Teledahn}}</nowiki></code>
 
This could be implemented as:
<pre><nowiki>
{{#if {{{page|}}}|{{D'ni dict page|{{{page}}}}}|{{#if {{{dnifont|}}}|{{D'ni dict word|{{{dnifont}}}}}|Error: D'ni dict template requires a 'page' or 'dnifont' parameter.}}}}
</nowiki></pre>


=== Apocrypha Banner ===
=== Apocrypha Banner ===
Please note that all contributions to Guild of Archivists may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see GoArch:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)