Truncate Template

From Fallen London Wiki (Staging)

Other people who edited this page

RagnaBot

After a successful roll-out in the {{Quality}} template, the {{Truncate}} template is now ready for prime time. This Template is meant to help enforce the Editing Guidelines on this wiki. For background on this template, see this discussion about text truncation.

Usage[edit]

This template is intended for use by other templates, to wrap fields that contain game text. If wrapped text is under the character limit established in the Editing Guidelines, then it is passed along. If the text is too long, then it is cut off at the character limit, an error message is appended in the wiki text, and the article is flagged for Category:Immediate review.

While it could be used in articles directly, that seems unlikely. Anyone who knows to use the Template would also know the Editing Guidelines and follow them. Although if you want, you could use it to get feedback on whether you've cut your text short enough.

Features[edit]

The Editing Guidelines say to replace removed text with an ellipsis in brackets, and gives "[...]" and "(...)" as examples. The {{Truncate}} template will normalize most (hopefully all!) variants of these in the input to […] in the output text for visual consistency. It will also not count such text towards the character limit.

An optional chars argument can specify a different character limit than 250. This is intended for cases where one chunk of game text spans two fields. An example of where this might be useful is the success text for creating a frog book: The main success text has a variable second paragraph, with the variations recorded in a table. Ideally the table would truncate its contents, and even more ideally the {{Action}} template would be aware that 207 characters have been used in the description field and tell the table that its contents should be truncated to 43 characters. However, this functionality is currently speculative.

Future Work and Maintenance[edit]

Implementation notes are included in Template:Truncate/doc. This includes some caveats about the Lua Patterns used to implement, and guidelines for future improvement.

One potential modification would be to ignore all text inside [square brackets] when counting length. This would open up some potential uses, including how to integrate tables of text variations into description fields.

The main future work is integrating this Template into other Templates, both new and existing. It has already been integrated into {{Quality}}. The next steps, in no particular order, would be integrating into {{Item}}, {{QuoteSummary}} (which is used indirectly by most story text templates), and a new Template for creating tables of textual variations.