Wiki-格式化

其他语言 Deutsch, English, Español, Français, Polski, Русский.


参见:Actions组件


Wacko text formatting 与其他 wiki 略有不同,因此您应该阅读以下示例。


您可以在 Sandbox 中试验 Wiki Markup
被成对的双引号所包围的文本没有格式化,在显示时保持不变。


代码 效果

1. 目录


{{toc numerate=1}}


详细描述...

NB: 如果您将它与 'include' 插件一起使用,但不希望从包含文件中提取的标题列在生成的目录中,请使用 'notoc' 选项,如下所示:


{{include page="Formatting/Headlines" notoc=1}}

2. 基本文本格式

**粗体**
粗体
//斜体//
斜体
__下划线__
下划线
##源代码##
源代码
--删除线--
删除线
++小++
小文本
!!note!!
(also ''note'', but it is better not to use it).
note
!!(blue) 蓝字!!
蓝字
!!(green) 绿字!!
绿字
!!(red) 红字!!
红字
??高亮文本??
高亮文本
??(blue)高亮文本??
高亮文本
??(red)高亮文本??
高亮文本
??(green)高亮文本??
高亮文本
%%embed code%%
int main(int arc,char **argv)
{
    printf("Hello, %s!\n", (argc>1) ? argv[1] : "World");
    return 0;
}	

NB: 删除线,就像下面的所有格式(在本章中)一样,是多行的。 以前的所有格式都不是多行格式,因为我们将制作不会破坏文本的格式。

3. 对齐方式

对齐是在这样一个复杂的结构的帮助下进行的:


default
左对齐
%%(wacko wrapper=text wrapper_align=center) center%%
居中
%%(wacko wrapper=text wrapper_align=right) right%%
右对齐
%%(wacko wrapper=text wrapper_align=justify) justify%%
两端对齐

wrapper_align can be center, right or justify.

4. 链接

作为创建链接的字符标记,您可以使用圆形 ((, )) 或方形 [[, ]] 括号。 两种括号效果一样。 如果页面文本已经包含简单的圆括号,方括号,这可能会被错误地视为链接标记。

4.1. 外部链接

((http://wackowiki.org WackoWiki))
WackoWiki
http://wackowiki.org is highlighted automatically.
http://wackowiki.org
PPR:OneMinuteWiki
InterWiki linking
PPR:OneMinuteWiki
mailto:address@example.com
((address@example.com))
电子邮件
mailto:address@example.com
address@example.com
xmpp:addresse@example.com
Jabber.
xmpp:addresse@example.com
((https://example.com/archive.zip Archive (zip) ))
https://example.com/archive.zip
Archive (zip)
https://example.com/archive.zip

4.2. 内部链接

[[Sandbox]] or ((Sandbox))
Sandbox
((Sandbox The sandbox page))
The sandbox page
https://wackowiki.org/wacko_logo.png
Image with no link.

((/HomePage https://wackowiki.org/wacko_logo.png))
Image with a link.
https://wackowiki.org/wacko_logo.png
{{anchor href="test"}}
anchor declaration.

((#test)) or ((/HomePage#TOC_1))
anchor reference.
test or /HomePage#TOC_1

注意

  1. 对于内部链接,可以使用((/Doc/English/Cluster 相对或绝对地址))。
  2. 混合大小写的词 (LikeThis) 不需要括在括号中。 对于内部链接(在此 Wiki 内),不应写入完整的 URL(否则链接将不起作用)。 仅为外部链接添加“http://”。
  3. 为防止 WordLikeThis 被解析为链接,请在其前面放置 ~(波浪号)。
  4. 如何使用指向带有空格的本地文件的链接? (例如:S:\Network Drive\File 1.txt//server1\file name.txt
    要使用这样的空格链接到服务器上的本地文件,请使用 file:/// 并将所有反斜杠切换为正斜杠。 另外,用%20替换任何空格,这样你的链接就会变成file://///server1/file%20name.txt 另外,在 Firefox 上链接到本地文件也有问题 : (解决方案
  5. 要调整和对齐来自外部源的图像,您可以使用以下语法:((http://example.com/image.png width=500 align=center)), available parameters width heightalign=[left,center,right]

5. 包含已上传文件

file:/mammut_mascot.jpg
仅检查全局文件
file:mammut_mascot.jpg
检查本地文件,该文件仅适用于本页的读者
file:/Subpage/archive.zip
本地文件的绝对路径,本地文件必须包含在另一个页面中
文件必须已经上传。


详细描述...

mammut mascot
file:/Subpage/archive.zip

5.1. 媒体参数

通过附加问号? 并通过与号& 添加附加参数,将参数添加到文件语法中。
例如: file:/lotus_flower.jpg?right&caption&400

Lotus Flower
Shinobazu Pond at Ueno Park at Ueno, Taito-ku in Tokyo
(Source:: Yoshikazu TAKADA /Some rights reserved)

  • 链接
    • direct - 到文件
    • nolink - 仅显示图片
    • linkonly - 仅显示链接
    • meta - 到 filemeta 处理程序 (默认)
  • 对齐方式
    • right - 右对齐
    • left - 左对齐
    • center - 居中
  • 尺寸
    • 400x300 - 宽 × 高
    • 0x700 - 高
    • 600 - 宽
  • 其他
    • caption - 显示标题
    • clear - 清除浮动

6. 标题


== 一级标题 ==

(2) 一级标题


=== 二级标题 ==

(3) 二级标题

==== 三级标题 ==

(4) 三级标题

===== 小标题 ==

(5) 小标题

====== 更小的标题 ==
(6) 更小的标题

======= 最小的标题 ==
(7) 最小的标题

Note: Right of the Heading it does not require the same number of "=" characters, it suffice two "=" signs.
The ==Primary Heading== is usually set with the page title and is by default not included in the table of content.

7. 带编号或不带编号的列表


使用制表符或双空格缩进列表,并使用 *1.A.、a. 或 i。 指定所需的列表类型。
Lists:
  first line
    indented line
----
  * bullet list
  * bullet list-2
----
  1. numbered list
  1. numbered list-2
  2.#8 numbered list, with transition
----
  A. using upper case characters
  A. using upper case characters-2
----
  a. using lower case characters
  a. using lower case characters-2
----
  i. using Roman numbers
  i. using Roman numbers-2
----
  1. list
    1. nested list
      * and even more nested list
    1. nested list 2
  2. list 2	

Lists:

first line
indented line


  • bullet list
  • bullet list-2

  1. numbered list
  2. numbered list-2
  3. numbered list, with transition

  1. using upper case characters
  2. using upper case characters-2

  1. using lower case characters
  2. using lower case characters-2

  1. using Roman numbers
  2. using Roman numbers-2

  1. list
    1. nested list
      • and even more nested list
    2. nested list 2
  2. list 2

8. 引用和定义

<[ Citation of text
(块引用) ]>

Citation of text
(块引用)

(?Term Some definition?)
Term
(?Term containing spaces == Some other definition?)
Term containing spaces

9. 脚注

Text, then footnote[[*]] and second one[[**]]
Text, then footnote* and second one**
Text, then numeric footnote[[*1]] and second one[[*2]]
Text, then numeric footnote1 and second one2
[[#*]] Text for first footnote
[[#**]] Text for second footnote
[[#1]] Text for numeric footnote
[[#2]] Text for second numeric footnote
* Text for first footnote
** Text for second footnote
1 Text for numeric footnote
2 Text for second numeric footnote

auto-generated footnotes
[[^ text of footnote here]]
generates the footnotes at the end of the page, see example

10. 层次显示

要将一段文字标记为回复或评论,你可以使用以下语法。
嗨!
> 是的,就是这样。
>> 你确定吗?
> 当然,是的!
>> 真的吗?
>>> 现在怎么办?	

嗨!

11. 表格


带边框表格
#|
*|标题 1|标题 2|标题 3|*
||单元格11|单元格12|单元格13||
||单元格21|单元格22||
|#


标题 1标题 2标题 3
单元格11单元格12单元格13
单元格21单元格22

无边框表格,100%宽度
#||
||单元格11|单元格12|单元格13||
||单元格21|单元格22||
||#


单元格11单元格12单元格13
单元格21单元格22

注意: 如果可用,可以使用内联 HTML 创建复杂表。
要在单元格中包含管道| 作为内容,请用双引号将管道括起来:""|""

12. 杂项


水平线 (separator):
----



强制换行:
test---new line
test
new line


强制空行:
---"" ""---


文本输出“原样”——忽略标记
文本应该用一对双引号括起来,例如 ""测试---换行~"". 您可以查看 source of this page? 以获取大量示例。
此外,对于任何形式的标记的筛选,都可以使用 ~ (波浪号)。

13. 内联 HTML

HTML 输出“原样”
这只有在站点管理员允许的情况下才有效。


<# <input type="text"> #> <# <input type="text"> #>

如果您看到 <input type="text"> 而不是输入字段,则站点管理员不会打开此功能(配置参数:allow_rawhtml)。
NB:这是非常危险的选择,避免 XSS!

14. 特殊字符

wiki 中内置的自动校对器会自动将保存的文本调整为格式规范,从而使作者免于进行过度详细的编辑。 以下是它所做的更改:

上标
E=mc^^2^^
E=mc2
下标 Insert spaces before and after vv.
H vv2vv O
H 2 O
Additional
^F °F
^C °C
(p) §
(tm) (tm)
(c) (c)
(r) (r)
+- +-
~~ ~

15. 巨集


宏是一些小快捷方式,它可以使用相关变量(例如您的姓名和维基名称、写作日期等)自动更新您正在编写的文档。基本上,它们只是小文本快捷方式。


要自动插入您的姓名,请使用:
::::
RomanIvanov


自动显示名称和日期:
::@::
RomanIvanov /20.06.2003 18:13/


日期:
::+::
20.06.2003 18:13

16. 语法突出显示

WackoWiki 很容易用文本扩展 formatters。它们使用语法 %%(name) text%% 调用。
Wacko 包中包含几个格式化程序:

%%(wacko)The text as it is. ((/HomePage))%%
This format displays the text in the same way as if it was written without a formatter. Convenient for applying additional wrappers to text (alignment, boxes, etc. See below.)
The text as it is. /HomePage
%%(php) PHP-code%%

<?php
phpinfo
();
$s "Hello, World!\n";
echo 
$s;

Attention: that code should begin with <?php ?> , because builtin PHP parser identifies PHP by those separators.

%%(comment) Comments, they will be hidden when the page is stored and redisplayed %%

%%(noautolinks) no AutoLinks if CamelCase-Words%%
no AutoLinks if CamelCase-Words
%%(details title="Summary" open=1) Details info. %%
Summary The HTML Details Element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label can be provided using the <summary> element.

%%(cl)zypper dup --no-recommends%%
zypper dup --no-recommends	

%%(chat [type="div|table"])
chat log
%%

Mike Hi altogether.
12:04
Alice Did you check out the link https://example.com/
12:05
Pete I did't read your message.
The images
you drawn
are awesome!
12:10

%%(email) Email%%
Hi!
RI>> Yes, it is.
>Are you sure?

Of course, yes!

Roman.	

%%(sql) SQL-code%%
SELECT * FROM sometable 
WHERE a = '12' and b = 2 
ORDER BY c DESC;

There's also (ini), (html), (css), (java) and (pascal) highlighters.
%%(html) HTML-Code%%
<html>
<a href="http://example.com">test</a>
</html>	

%%(ini) ini-Code%%
[Wiki]
BestEngine="WackoWiki"
Version=6	

%%(css) CSS-Code%%
body {margin: 0; padding: 5px;}
.class {background: url("http://example.com/");} 	

%%(pascal) PASCAL-Code%%
program megaprogramme;
{ comment }
BEGIN
 if a = 15 then writeln('test');
END.	

16.1. Info box

%%(info type="note" title="Remarks" icon=0) content... %%


Types: default, error, example, important, note, question, quote, success, warning
title box title
icon show icon, default value is 1

%%(info type="note")
content...
%%

A wiki is a website where users can add, remove, and edit every page using a web browser. It's so terrifically easy for people to jump in and revise pages that wikis are becoming known as the tool of choice for large, multiple-participant projects.


%%(info type="warning")
content...
%%

As with any software that you expose to the internet, there may be bugs or security problems. Do not install WackoWiki unless you intend to keep up with security upgrades.

16.2. PEAR 语法突出显示

PEAR package for syntax highlighting


%%(hl [Formatter] numbers=1 start=2) code example %%


numbers line numbering type: 1 -> ol, 2 -> Table
start lets the line numbers start at any number, and not just at 1


Formatter: abap, cpp, css, diff, dtd, html, java, javascript, perl, php, ruby, python, sh, sql, vbscript, xml.

%%(hl css) CSS-Code%%
body {margin: 0; padding: 5px;}
.class {background: url("http://example.com/");}


%%(hl javascript) Javascript-Code%%
var a = document.getElementById("test");
a.value = new Array(15, 31);
function echo (msg) {alert(msg)};


%%(hl php numbers=2) PHP-Code%%
1
2
3
4
<?php
phpinfo();
$s = "Hello, World!\n";
echo $s;


%%(hl xml) xml-Code%%
<config>
<section name="test">
  <var>Test</var>
  <val><![CDATA[..text...]]></val>
</section>
</config>

16.3. GeSHi

GeSHi 语法突出显示 - Generic Syntax Highlighter


%%(geshi [Formatter] numbers=1 start=35 lines=37) source%%

%%(geshi css) CSS-Code%%
Formatierer highlight/geshi nicht gefunden

If you see Formatter highlight/geshi not found, the GeSHi formatter was not added to this site.

17. Wrappers around formatters

其他语言 Deutsch, English, Français, Русский.


此外,可以使用参数 wrapper= 为每个格式化程序 %%(formatter) text%% 分配一个特定的包装器。


%%(formatter
[wrapper="box | shade | page | text"]
[wrapper_align= "left | center | right | justify"]
[wrapper_title="Titel"]
[wrapper_type="default | error | example | important | note | question | quote | success | warning"]
[wrapper_width="pixel"]
[col=1 | 2 | 3 | 4 | 5]
[clear])
Text
%%

box shade page text
type + + -
title + + -
alignment + 1 2 +
clear + +
width + 1 + 3
column + +
frame + +
automatic line feed + + +

1 这个选项没有意义,因为块的宽度总是等于页面的宽度。
2 只在左边。
3 如果您不自己放置换行符,则引擎将块宽度固定为页面宽度的大约 90%。


Grammar = [FORMATTER | FORMAT WRAPPER | FORMAT WRAPPER OPTION | Text]


FORMATTER = [ cl | comment | css | email | hl * | html | info | ini | java | pascal | php | sql | wacko ]


FORMAT WRAPPER = box, shade, page und text


TEXT = alles, frei.

17.1. box



%%(css wrapper=box wrapper_align=left wrapper_width=270)
.d { font-size: 70% }
%%


正如我们所看到的,box可以形成方便的“菜单”,并带有文本线型。 顺便说一句,有一个特殊的格式化程序(Box),除了将文本转入这个包装器之外,它不会做任何事情。

17.2. shade


%%(css wrapper=shade)
.d2 { font-size: 70% }
%%

.d2 { font-size: 70% } 	

shade — this box without the tuning.

17.3. text


%%(wacko wrapper=text wrapper_align=center)
文本居中显示
%%

文本居中显示

text 是派生出来的“浮动”(float)文本块。

17.4. page

%%(wacko wrapper=page wrapper_width=200)
此文本的宽度不能超过 200 像素
%%

此文本的宽度不能超过 200 像素

page 它可以调节普通文本块的宽度。

17.5. 例子


%%(wacko wrapper=box wrapper_type="quote" wrapper_width=300 wrapper_title="陋室铭")
«山不在高,有仙则名。水不在深,有龙则灵。斯是陋室,惟吾德馨。苔痕上阶绿,草色入帘青。谈笑有鸿儒,往来无白丁。可以调素琴,阅金经。无丝竹之乱耳,无案牍之劳形。南阳诸葛庐,西蜀子云亭。孔子云:何陋之有?» – 刘禹锡
%%



Comments