How to fold up content in MediaWiki

本文介绍了一种在MediaWiki中使用模板折叠长代码的方法,通过添加{{hideBegin}

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

If you paste a very very long code into mediawiki, you may find that code takes too much space that it is not easy to find the useful content. Why not add a new template that can fold up the code?


add two tags: {{hideBegin}}, {{hideEnd}}, your wiki code looks like this

{{hideBegin}}
Long Code
Long Code
Long Code
{{hideEnd}},

then preview the page, and edit that two new template:

for hideBegin:

<div style='border:0px;padding:3px; PADDING:0px; width:100%; height:480px; LINE-HEIGHT: 20px; OVERFLOW: auto;'><div class="NavContent" style="{{{ContentStyle|}}}"><noinclude></div></div>


{{Documentation}}


[[en:Template:hideBegin]]
[[ja:Template:hideBegin]]
</noinclude>

for hideEnd:

</div></div><noinclude>{{Documentation}}</noinclude>

That's all.

WikiMedia template mechanism is really COOL!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值