Template talk:FileBox

From Gentoo Wiki
Jump to: navigation, search
Note
This is a talk page. Please add newer comments below older ones, and sign your comments using four tildes (~~~~). When adding a new section (at the bottom of the page), please mark it as "open for discussion" by using {{talk|open}} so it will show up in the list of open discussions.

Indentation of first line of content

Talk status
This discussion is done.

This template doesn't appear to preserve indentation (spaces) for the first line of content. For example, the contents of the FileBox templates at MediaTomb#MySQL are all indented. The indent is only preserved for second and subsequent lines of content. I can preserve the indents if I wrap the content with <nowiki></nowiki>, but I then loose syntax highlighting. Is this expected behavior or am I missing something? --BT (talk) 15:48, 1 January 2015 (UTC)

Try just setting <nowiki />, like so:
FILE somefileExample for indentation
    <host>localhost</host>
    <port>2812</port>

--SwifT (talk) 15:53, 1 January 2015 (UTC)

That did it. Thank you. --BT (talk) 15:57, 1 January 2015 (UTC)

Issue with syntax highlighing?

Talk status
This discussion is still ongoing.

Hi, has something changed recently with this syntax handling in this template?

If I try the given example text:

{{FileBox|title=FileBox example 1|filename=/tmp/file1|lang=bash|1=
#!/bin/bash
echo "Hello, world!" 
}}

it works OK:

FILE /tmp/file1FileBox example 1
#!/bin/bash
echo "Hello, world!"

But, if I add another line to the file, so:

{{FileBox|title=FileBox example 2|filename=/tmp/file2|lang=bash|1=
#!/bin/bash
echo "Hello, world!" 
echo "Goodbye, world!" 
}}

the highlighting goes away, and the page gets added to the "Pages with syntax highlighting errors" category:

FILE /tmp/file2FileBox example 2
#!/bin/bash
echo "Hello, world!" 
echo "Goodbye, world!"

I have found also that existing complex FileBox bash examples in my EFI guide (e.g. ebuilds) display OK, but if I edit them (even to add comment lines), the syntax highlighting drops out.

I'm sure I'm doing something dumb here, please help! --Sakaki (talk) 17:25, 19 August 2017 (UTC)

Cache magic or something... --Cronolio (talk) 19:04, 19 August 2017 (UTC)
Thanks, whatever magic you did, it seems to have fixed it! --Sakaki (talk) 11:16, 20 August 2017 (UTC)
Actually, it is still not working properly on my actual wiki pages (see e.g. here); presumably this something that will just take some time to flow through? --Sakaki (talk) 11:50, 20 August 2017 (UTC)
Looks like syntaxhighlight is broken now. This is simple example
1 #!/bin/bash
2 echo "Hello, world!" 
3 echo "Goodbye, world!"
So this question for gentoo infra --Cronolio (talk) 18:58, 20 August 2017 (UTC)

Another failing test (for bug report):

{{FileBox|title=FileBox example 2|filename=/tmp/file2|lang=bash|1=
#!/bin/bash
echo "Hello, world!" 
echo "Farewell, world!" 
}}

gives:

FILE /tmp/file2FileBox example 2
#!/bin/bash
echo "Hello, world!" 
echo "Farewell, world!"

--Sakaki (talk) 11:57, 21 August 2017 (UTC)

Hi Sakaki , Cronolio , and everyone. At first glance seems to be something happening on the wiki's backend, but I haven't looked too closely yet. I've been needing to do updates to wiki extensions for a while now which I will try hard to get some performed this weekend (Friday/Saturday). Please use proper KernelBox syntax even with the 'Pages with syntax highlighting errors' message displaying. This is proper syntax even if wiki is warning about it. I'll add a message to the front page of the wiki once I get things updated. Kind regards, --Maffblaster (talk) 17:10, 21 September 2017 (UTC)

Hi Matthew Marchese (Maffblaster) , I was just wondering if there was any progress on this, or some workaround that can be adopted? The list of pages with syntax highlighting errors seems to have grown quite large now ^-^ Kind regards, --Sakaki (talk) 14:21, 16 November 2017 (UTC)
Highlighting looks like it's working now. --Grknight (talk) 02:13, 8 November 2018 (UTC)

The remaining pages with syntax highlighting errors are because of missing xorg.conf lexer support. However it was added to dev-python/pygments-2.3.1 which has been in the tree for 3 months. Maybe the Wiki backend should update to pygments-2.3.1--BT (talk) 03:04, 23 March 2019 (UTC)

Looks like current master branch of the extension is use 2.2.0. So no xorg lexer support there. --Cronolio (talk) 15:30, 25 March 2019 (UTC)
It's possible to use a system copy instead of the bundled one by setting $wgPygmentizePath.--BT (talk) 23:43, 25 March 2019 (UTC)
Some years ago wiki admins guys said me that only bundled version is possible. --Cronolio (talk) 04:05, 26 March 2019 (UTC)
I guess we will just have to wait until the extension is updated to use pygments 2.3.1.--BT (talk) 04:15, 26 March 2019 (UTC)

It appears that xorg.conf syntax highlighting is broken again. --BT (talk) 01:55, 2 November 2019 (UTC)

add feature: Render collapse-output

Talk status
This discussion is still ongoing.

{{FileBox}} should render (accept) the collapse-output parameter, and seen for example on {{Cmd}}.

I've checked the sandbox version. It already has some code in it but does not seem to work. Especially on big config file examples, this would be very useful - even necessary.

It would be great if someone with deep knowledge on templates could implement that functionality. Unfortunately, I'm not very skilled on Wiki Templates yet :-(

As an example of a dirty workaround see the "Advanced examples" section of netifrc (look into the code by editing, I've left some <noincluded> comments).

Thank you :-) --Stefan00 (talk) 13:58, 25 October 2019 (UTC)

I recommend move template example from netifrc to your own user page
something like this https://wiki.gentoo.org/index.php?title=User:Cronolio/prebox&oldid=829694 - required tyrian style modifications. --Cronolio (talk) 02:48, 27 October 2019 (UTC)
I do not understand why I should move the example, can you please explain? Actually, I had to implement it into the netifrc page to keep the page readable. That's why I asked if someone could implement the feature into FileBox itself.
The alternative without that ugly code modification would be to remove that example from net netifrc page. --Stefan00 (talk) 09:30, 28 October 2019 (UTC)
if everyone will implement something into pages then it will be a mess in short time. IMHO --Cronolio (talk) 18:18, 29 October 2019 (UTC)