如何在MediaWiki中恢复父节

时间:2014-07-30 17:27:27

标签: mediawiki sections

我希望能够在创建子节之后在父节中继续创作。 e.g:

=section 1=
some section 1 text

==sub-section 1.1==
some sub-section 1.1 text
==sub-section 1.2==
some sub-section 1.2 text

done with sub-sections 1.1, 1.2  and want to resume more section 1

有办法做到这一点吗?我觉得总是把所有子部分都推到最后有点尴尬。

1 个答案:

答案 0 :(得分:0)

我建议通过在常见的CSS样式表中创建新类来捏造它。在那里创建一个名为“subsection”的类,让代码在该div部分中设置文本,而不是围绕它的其余部分---

div#subsection {
margin: 6px;  
padding: 10px;
padding-right: 12px; 
background: yellow; 
border: 1px solid black; 
padding: 1em;
}

这个例子颜色鲜艳,所以你可以更容易地看到它是如何工作的。然后将其填入标题下的页面,就像这样---

== Alice in Wonderland ==

Alice was beginning to get very tired of sitting by her sister on the
bank, and of having nothing to do. Once or twice she had peeped into the
book her sister was reading, but it had no pictures or conversations in
it, "and what is the use of a book," thought Alice, "without pictures or
conversations?"

<div id="subsection">
=== About Alice ===
You may have noticed Alice is a bit of a drip. 
</div>

So she was considering in her own mind (as well as she could, for the
day made her feel very sleepy and stupid), whether the pleasure of
making a daisy-chain would be worth the trouble of getting up and
picking the daisies, when suddenly a White Rabbit with pink eyes ran
close by her.

等等。生成TOC时,它应该将该单独的位列为父标题的子部分。那里的格式很奇怪 - 你可能想要用花车,边距和东西大惊小怪 - 但希望它能让你大致了解该怎么做。您可以根据需要将子部分样式设置为不显眼,这样它就可以与页面的其余部分无缝融合。

这不是最方便的代码,但是出于样式和页面布局的目的,它可以工作。这也是制作侧边栏的一个方便技巧。