Difference between revisions of "Template talk:App"

From ArchWiki
Jump to: navigation, search
(Using br causes bugs: re)
(Using br causes bugs: re)
Line 49: Line 49:
 
:::The problem with plain text is consistency, a template with fixed number of parameters is great for this. I think that the second argument (description) of App template should be limited to a single line/paragraph for simplicity, which would allow to use <br> to separate the two lines. We could issue a note on the template page, but broken layout should be enough warning for everybody wanting to use it in a complicated way :P
 
:::The problem with plain text is consistency, a template with fixed number of parameters is great for this. I think that the second argument (description) of App template should be limited to a single line/paragraph for simplicity, which would allow to use <br> to separate the two lines. We could issue a note on the template page, but broken layout should be enough warning for everybody wanting to use it in a complicated way :P
 
:::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:20, 11 October 2014 (UTC)
 
:::-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:20, 11 October 2014 (UTC)
 +
 +
::::Interesting, thanks for asking upstream!
 +
::::The problem is that if we update the template to use <br>, then we'd have to check all its transclusions and fix those with multiple lines (there are probably other than on [[Backup programs]]).
 +
::::But except for [https://wiki.archlinux.org/index.php?title=Talk:Systemd&diff=prev&oldid=338846], in what other cases would we need to nest this template?
 +
::::-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 10:59, 13 October 2014 (UTC)

Revision as of 10:59, 13 October 2014

Using br causes bugs

Using <br> to put the 3rd and 4th arguments on a new line loses completely the indentation for that line when the first two arguments contain line breaks, as in e.g. Backup programs. The following is an example, Template:Sandbox uses the <br> method:

  • rsync — A file transfer program to keep remote files in sync.
    • rsync almost always makes a mirror of the source.
    • It is possible to restore a full backup before the most recent backup if hardlinks are allowed in the backup file system. See Back up your data with rsync for more information.
    • If hard links are not allowed, it is impossible to restore a full backup before the most recent backup (but you can use --backup to keep old versions of the files).
    • Standard install on all distros.
    • Can run over SSH (port 22) or native rsync protocol (port 873).
    • Win32 version available.
http://rsync.samba.org/ || rsync
  • [[rsync|A file transfer program to keep remote files in sync.
    • rsync almost always makes a mirror of the source.
    • It is possible to restore a full backup before the most recent backup if hardlinks are allowed in the backup file system. See Back up your data with rsync for more information.
    • If hard links are not allowed, it is impossible to restore a full backup before the most recent backup (but you can use --backup to keep old versions of the files).
    • Standard install on all distros.
    • Can run over SSH (port 22) or native rsync protocol (port 873).
    • Win32 version available.
]]

Also note that there shouldn't be a space before <br> in the template's code, or the 3rd/4th args line will be code-formatted (I guess it's interpreted as a space-initial line by MediaWiki).

For the moment I've restored the previous "\n:" method in Template:App, but maybe somebody has a better idea to let the second line follow the level of indentation of the first line?

For the records, we tried to solve this problem in ancient times, and that's when we decided to limit the usage to first-level indentation only.[1]

-- Kynikos (talk) 02:18, 8 October 2014 (UTC)

Sorry for breaking this, I completely forgot about lists inside App template...
Now the deficient MediaWiki syntax for lists looks ridiculous: there will always be an inconsistency based on whether the parameters contain newlines or not, and even whether the parameter ends with newline or not. The icing on the cake is that the parameter can't be wrapped in <div> tags as this would break the layout of the whole page.
I can think of several workarounds:
  • The App template is intended for simple descriptions, newlines should not be necessary, let alone lists. Backup programs would be either simplified or turned into sections, which would make it possible to link to the programs.
  • As the App template is always unordered lists, the <li> element generated by * in front of the template could be moved into the template (I read in [2] that the <ul> tags would be added automatically by the parser). The content of App template would be wrapped in <li></li> tags using <br> to "indent" the "second" line and we would write {{App|... instead of * {{App|.... Then indenting the template should work...
-- Lahwaacz (talk) 07:10, 8 October 2014 (UTC)
MediaWiki is now 12+ years old, the original code has been massively patched during its life of course, but the backward compatibility requirements will never let anyone fix many of its indeed "ridiculous" deficiencies ;) We can only work around them... or migrate to a more modern wiki engine altogether...
That said, I've never said it publicly (actually I remember saying it once in a discussion a long time ago, but don't remember where) because this template has always been pretty popular, but I admit I've never liked it too much: if you think about it, it makes it more complicated to list an application than using plain text:
* {{App|[[Firefox]]|The Firefox Web Browser is the faster, more secure, and fully customizable way to surf the web.|http://www.mozilla.com/firefox/|{{Pkg|firefox}}}}
* [[Firefox]] — The Firefox Web Browser is the faster, more secure, and fully customizable way to surf the web.
: http://www.mozilla.com/firefox/ || {{Pkg|firefox}}
For this reason I'd agree with any proposal to substitute it, for example in Backup programs by using subsections as you said (there's no style requirement to use it wherever there's an application list, after all).
About the idea of using <li>, I've tested it on Template:Sandbox, but no <ul> element seems to be created (is this ridiculous too? :D )
Finally, we could reconsider Talk:List_of_games#Making_article_more_readable instead, applying it to List of applications and possibly other lists.
-- Kynikos (talk) 04:33, 11 October 2014 (UTC)
I asked on the MediaWiki ML, and the reply pointed me to Manual:$wgUseTidy. According to [3], "Wikimedia mediawiki installations generally post-process content with htmltidy", and ArchWiki most probably doesn't.
The problem with plain text is consistency, a template with fixed number of parameters is great for this. I think that the second argument (description) of App template should be limited to a single line/paragraph for simplicity, which would allow to use <br> to separate the two lines. We could issue a note on the template page, but broken layout should be enough warning for everybody wanting to use it in a complicated way :P
-- Lahwaacz (talk) 20:20, 11 October 2014 (UTC)
Interesting, thanks for asking upstream!
The problem is that if we update the template to use <br>, then we'd have to check all its transclusions and fix those with multiple lines (there are probably other than on Backup programs).
But except for [4], in what other cases would we need to nest this template?
-- Kynikos (talk) 10:59, 13 October 2014 (UTC)