Template talk:Hc

From ArchWiki
Latest comment: 25 January by Erus Iluvatar in topic Use magic word tag instead of hacks

Indenting this template

I have noticed that indenting with ":" is basically impossible with this one, but not with Template:bc because it will literally break apart. Example:

foo
bar

I have talked to Erus_Iluvatar on IRC already and the usual hacks do not work here.

-- NetSysFire (talk) 07:40, 16 March 2023 (UTC)Reply[reply]

There was this discussion about the problem. — Lahwaacz (talk) 19:59, 18 March 2023 (UTC)Reply[reply]

Use magic word tag instead of hacks

There is a link in template code, that intended to explain the <pre<noinclude></noinclude> ... </pre<noinclude></noinclude>> hack. But the link is dead. Can anybody update it? I am trying to make similar thing with the syntaxhighlight tag on another wiki. But it does not work. If I remove hack, then wiki syntax is shown literally. But if I keep hack, the tag is shown literally. Can it work with something other than pre tags? Ashark (talk) 01:40, 28 September 2023 (UTC)Reply[reply]

I have found out that I can use a tag template. It looks like a more beautiful solution, and works with syntaxhighlight tag. Probably worth changing in ArchWiki too. Ashark (talk) 02:25, 28 September 2023 (UTC)Reply[reply]
In sandbox, I have proved that it works. It simplifies the template a lot. Anyone with write permission to this page can apply. I would like to also change the parameter name from "output" to just "code". --Ashark (talk) 23:23, 1 October 2023 (UTC)Reply[reply]
👍 That does look a lot more readable than the current template. As for changing the parameter name, that would require updating every page where the template with the parameter is used. -- nl6720 (talk) 10:25, 5 October 2023 (UTC)Reply[reply]
In KDE wiki it could be changed automatically, there is a Special:ReplaceText page, but I do not see such in Arch Wiki. Probably it is restricted for regular users.
Also, don't you think "hbc" is better than "hc"? For me, it feels more rememerable (headed block code) than just hc. --Ashark (talk) 10:58, 5 October 2023 (UTC)Reply[reply]
IMO the "output" is more adequate, as some pages use this template for text or configuration files while don't contain "code". --Erus Iluvatar (talk) 14:39, 5 October 2023 (UTC)Reply[reply]
👎 It looks like the new template does not permit using italics or bold in the content. See the sandbox. --Erus Iluvatar (talk) 14:42, 5 October 2023 (UTC)Reply[reply]
Can you check if it is possible? This page has documentation, which mentions "pre-save transform of wiki code" and "Extension:ParserFunctions". I am not expert, by I guess wiki admins can enable them to parse wiki text inside pre. It is prohibited by design. —This unsigned comment is by Ashark (talk) 19:56, 5 October 2023. Please sign your posts with ~~~~!
Yes, MediaWiki does not allow markup inside pre. And that is the actual reason why this template has the hack. Wiki markup is neither "pre-save transform of wiki code" or "Extension:ParserFunctions". So when your solution does not work the same, however beautiful it looks, this template won't change. We will also not do any change that would require mass-updating all wiki pages (such as renaming the parameter or even the template itself). — Lahwaacz (talk) 07:10, 7 October 2023 (UTC)Reply[reply]
No new activity here for months, two people against changes, I've replace the dead link in the template to https://en.wikipedia.org/wiki/Help:Wikitext#Pre as upstream now documents it. Closing. --Erus Iluvatar (talk) 08:15, 25 January 2024 (UTC)Reply[reply]
I hope that formatting text in tag could be possible still. I left discussion open so others could see the problem and help if they know how. Ashark (talk) 08:21, 25 January 2024 (UTC)Reply[reply]
Sure, let's keep this open a little more. --Erus Iluvatar (talk) 09:28, 25 January 2024 (UTC)Reply[reply]