개괄

DokuWiki에서 사용하는 몇 가지 문법입니다. 문서를 보기 좋게 꾸밀 수 있습니다. 아시다시피 연습장 에서 연습해 보실 수 있습니다. 문법을 몰라도 위의 편집툴바를 이용하면 조금 꾸밀 수 있습니다. 툴바에 대한 설명은 quickbuttons 를 참고 하세요.

기본 꾸미기

진하게, 기울임, 밑줄, 글상자, 취소선 기능. 물론 중복 사용됩니다. 글상자 속에 진하고 밑줄 친 기울인 글자들에 취소선 긋기

사용법: **진하게**, //기울임//, __밑줄__ 
        ''글상자(작은따옴표 두 개 사용)'', <del>취소선</del>

아래 첨자 and 위첨자 기능.

아래 첨자는 <sub>아래 첨자</sub>, 위첨자는 <sup>위 첨자</sup> 처럼 기호를 사용

산문에서 문단은 한줄을 비우면 됩니다(엔터 두 번). 엔터 한 번으로는 줄바꿈 기능이 없습니다. 운문에서 행을 바꾸려면 백슬래시를 두 개(\\) 쓰면 됩니다. 운문에서 연을 바꾸려면 산문처럼 엔터를 두 번 치면 됩니다. 아래에서 비교해 보세요.

나 보기가 역겨워 (엔터) 가실 때에는

나 보기가 역겨워\\
가실 때에는

링크

글 속에 링크를 걸 수 있습니다. 툴바를 이용해서 링크를 걸 수도 있지만 위키 문법을 쓰면 더 편리합니다.

외부 링크는 www.google.com 주소를 쓰면 바로 링크가 걸립니다. 만약 구글 이런 식으로 멋지게 걸고 싶으면 아래처럼 쓰세요.

[[http://www.google.com|구글]]

위키위키를 쓰는 가장 큰 목적. 내부 문서 링크는 다음과 같습니다. 우선, 내부 문서의 제목을 쓴 후 대괄호 두 개로 그 제목을 감싸면 됩니다. playground 이렇게요.

문서 제목을 그대로 거는 게 재미 없거나, 다른 이름을 통해 내부 문서로 연결하려면 외부 링크와 마찬가지로 노출하고 싶은 말을 뒤에 붙여 주세요. 아무 말이나 적었다가 지우는 곳. 영어로 Sandbox 이렇게요.

[[playground]]
[[playground|아무 말이나 적었다가 지우는 곳. 영어로 Sandbox]]

카테고리 등을 이용해 하위분류를 만들고 싶으면 :을 찍고 왼쪽에 카테고리명, 오른쪽에 문서 제목을 쓰면 됩니다.

[[카테고리:문서 제목]]
[[wiki:playground]]

문서의 특정 영역으로 링크를 걸 수도 있습니다. 목록 만들기 이때는 문서 제목 뒤에 #를 쓰고 그 뒤에 섹션명을 쓰면 됩니다.

[[syntax#목록 만들기|목록 만들기]] 이렇게요.
하지만 문서는 자주 편집되고 섹션도 바뀌므로 섹션 링크에 너무 의존하지 마시고 문서 자체를 링크하는 것이 더 낫습니다.

지금 이 문서도 섹션으로 나뉘어 있습니다. 섹션별로 편집도 가능합니다. 섹션은 다음과 같이 만듭니다.

===== 섹션 제목 =====

다른 위키위키 사이트의 문서를 연결할 때는 좀 더 쉽습니다. 위키페디아 한글판에 연결하시려면 위키페디아의 동남 방언 항목 이렇게, 나무위키에 연결하시려면 나무위키의 동남 방언 항목 이렇게.

다른 위키위키 사이트의 문서를 연결할 때는 좀 더 쉽습니다. 
위키페디아 한글판에 연결하시려면 [[wp>동남_방언|위키페디아의 동남 방언 항목]] 이렇게, 
**나무위키**에 연결하시려면 [[nw>동남 방언|나무위키의 동남 방언 항목]] 이렇게.

문서에 주석을 달 수도 있습니다1). 당연히 주석은 여러 개 달 수 있습니다.2)

문장((주석 내용)) 이렇게 괄호 두 개를 씁니다. 번호는 자동으로 매겨집니다.

섹션 만드는 법을 좀 더 소개합니다. 섹션은 글에 구조를 부여합니다. 섹션이 세 개 이상이면 목차가 자동 생성됩니다. 만약 섹션이 세 개 이상인데 목차가 없는 것을 원하면 ~~NOTOC~~ 라고 문서의 맨 위에 쓰세요.

그 아래
==== 장 ====
=== 절 ===
== 그 아래 ==

이걸 쓸 일이 있을까 싶지만 - 기호를 네 번 이어 쓰면 —- 가로줄이 생깁니다. 뭔가를 구분하기 좋겠지요?


그림, 소리, 동영상

Real size:

Resize to given width:

Resize to given width and height:

Resized external image:

Real size:                        {{wiki:dokuwiki-128.png}}
Resize to given width:            {{wiki:dokuwiki-128.png?50}}
Resize to given width and height: {{wiki:dokuwiki-128.png?200x50}}
Resized external image:           {{http://de3.php.net/images/php.gif?200x50}}

빈칸을 하나씩 넣어주면 문서 속에서 그림을 좌우정렬할 수 있습니다. 직관적이지 않습니까?

오른쪽 정렬: {{ wiki:dokuwiki-128.png}}
왼쪽 정렬:   {{wiki:dokuwiki-128.png }}
가운데 정렬: {{ wiki:dokuwiki-128.png }}

그림에 캡션을 넣을 수 있습니다. 링크를 걸 때처럼 | 표시 뒤에 써 줍니다.

이 그림에 대한 설명

{{ wiki:dokuwiki-128.png |이 그림은 가운데 정렬되었습니다.}}

지원하는 매체

이것들은 파일명만 잘 적으면 자동으로 문서에서 보여집니다.

Image gif, jpg, png
Video webm, ogv, mp4
Audio ogg, mp3, wav
Flash swf

동영상 파일을 올리고 다음과 같이 적어주시면 됩니다.

{{video.mp4|동기 유발 자료}}

만약 동영상 파일과 같은 이름의 .jpg 나 .png 파일을 같은 폴더에 올려 두시면 동영상이 재생되기 전에 늘 그 이미지가 보일 것입니다. 일종의 포스터지요.

목록 만들기

두 칸을 띄우고 * 를 적어 주시면 목록이 만들어집니다. 하위 목록은 두 칸 더 띄우고 *를 적어 주시면 됩니다.

  • 서론
  • 본론
    • 본론1
    • 본론2
  • 결론

숫자 목록도 만들 수 있습니다. 두 칸을 띄우고 - 를 적어 주면 됩니다. 하위 목록은 두 칸 더 띄우고 -를 적어 주시면 됩니다.

  1. 서론
  2. 본론
    1. 본론1
    2. 본론2
  3. 결론
  * 서론
  * 본론
    * 본론1
    * 본론2
  * 결론

  - 서론
  - 본론
    - 본론1
    - 본론2
  - 결론

Also take a look at the FAQ on list items.

이모티콘 또는 이모지

아래 그림 옆의 기호를 기억하세요 ^^

  • 8-) 8-)
  • 8-O 8-O
  • :-( :-(
  • :-) :-)
  • =) =)
  • :-/ :-/
  • :-\ :-\
  • :-? :-?
  • :-D :-D
  • :-P :-P
  • :-O :-O
  • :-X :-X
  • :-| :-|
  • ;-) ;-)
  • ^_^ ^_^
  • :?: :?:
  • :!: :!:
  • LOL LOL
  • FIXME FIXME
  • DELETEME DELETEME

특수기호

아래와 같은 특수 기호를 연습해 보세요.

→ ← ↔ ⇒ ⇐ ⇔ » « – — 640×480 © ™ ® “He thought 'It's a man's world'…”

-> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r)
"He thought 'It's a man's world'..."

인용하여 대댓글처럼 달기

아래처럼 층위를 표현할 수 있으나, 보통은 > 하나를 넣어서 인용구임을 보여주는 정도로 사용됩니다.

우린 아마 안 될 거야.

> 할 수 있어.

>> 아냐, 안 될 거 같은데.

> 맞아, 안 될 거야.

>> 할 수 있다니까

>>> 그럼 한 번 해 보자.

우린 아마 안 될 거야.

할 수 있어.
아냐, 안 될 거 같은데.

맞아, 안 될 거야.

할 수 있다니까
그럼 한 번 해 보자.

표 만들기

DokuWiki supports a simple syntax to create tables.

Heading 1 Heading 2 Heading 3
Row 1 Col 1 Row 1 Col 2 Row 1 Col 3
Row 2 Col 1 some colspan (note the double pipe)
Row 3 Col 1 Row 3 Col 2 Row 3 Col 3

Table rows have to start and end with a | for normal rows or a ^ for headers.

^ Heading 1      ^ Heading 2       ^ Heading 3          ^
| Row 1 Col 1    | Row 1 Col 2     | Row 1 Col 3        |
| Row 2 Col 1    | some colspan (note the double pipe) ||
| Row 3 Col 1    | Row 3 Col 2     | Row 3 Col 3        |

To connect cells horizontally, just make the next cell completely empty as shown above. Be sure to have always the same amount of cell separators!

Vertical tableheaders are possible, too.

Heading 1 Heading 2
Heading 3 Row 1 Col 2 Row 1 Col 3
Heading 4 no colspan this time
Heading 5 Row 2 Col 2 Row 2 Col 3

As you can see, it's the cell separator before a cell which decides about the formatting:

|              ^ Heading 1            ^ Heading 2          ^
^ Heading 3    | Row 1 Col 2          | Row 1 Col 3        |
^ Heading 4    | no colspan this time |                    |
^ Heading 5    | Row 2 Col 2          | Row 2 Col 3        |

You can have rowspans (vertically connected cells) by adding ::: into the cells below the one to which they should connect.

Heading 1 Heading 2 Heading 3
Row 1 Col 1 this cell spans vertically Row 1 Col 3
Row 2 Col 1 Row 2 Col 3
Row 3 Col 1 Row 2 Col 3

Apart from the rowspan syntax those cells should not contain anything else.

^ Heading 1      ^ Heading 2                  ^ Heading 3          ^
| Row 1 Col 1    | this cell spans vertically | Row 1 Col 3        |
| Row 2 Col 1    | :::                        | Row 2 Col 3        |
| Row 3 Col 1    | :::                        | Row 2 Col 3        |

You can align the table contents, too. Just add at least two whitespaces at the opposite end of your text: Add two spaces on the left to align right, two spaces on the right to align left and two spaces at least at both ends for centered text.

Table with alignment
right center left
left right center
xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx

This is how it looks in the source:

^           Table with alignment           ^^^
|         right|    center    |left          |
|left          |         right|    center    |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |

Note: Vertical alignment is not supported.

위키 문법 무시하기

'나 *같은 위키 문법 기호를 문장에서 막 쓰다 보면 이게 문법으로 먹혀 버려서 곤란합니다. 그럴 때는 <nowiki> 로 글의 앞뒤를 감싸거나 %%. 를 글의 앞뒤로 감싸면 됩니다. 지금 % 두 개를 표현하기 위해((%를 두 번 써 버리면 또 문법으로 먹혀버리니까) % 를 한 번 사용한 부분이 함정.

지금 http://www.splitbrain.org 에 자동 링크가 걸리지 않았고 **formatting** 이 글자가 진해지지 않은 이유. //__밑줄도__ 기울임도// 이모티콘도 안 먹힘 ;-).

<nowiki>
지금 http://www.splitbrain.org 에 자동 링크가 걸리지 않았고  **formatting** 이 글자가 진해지지 않은 이유.
</nowiki>
%%//__밑줄도__ 기울임도// 이모티콘도 안 먹힘 ;-)%%.

이 아래는 참고만.

You can include code blocks into your documents by either indenting them by at least two spaces (like used for the previous examples) or by using the tags <code> or <file>.

This is text is indented by two spaces.
This is preformatted code all spaces are preserved: like              <-this
This is pretty much the same, but you could use it to show that you quoted a file.

Those blocks were created by this source:

  This is text is indented by two spaces.
<code>
This is preformatted code all spaces are preserved: like              <-this
</code>
<file>
This is pretty much the same, but you could use it to show that you quoted a file.
</file>

Syntax Highlighting

DokuWiki can highlight sourcecode, which makes it easier to read. It uses the GeSHi Generic Syntax Highlighter – so any language supported by GeSHi is supported. The syntax uses the same code and file blocks described in the previous section, but this time the name of the language syntax to be highlighted is included inside the tag, e.g. <code java> or <file java>.

/**
 * The HelloWorldApp class implements an application that
 * simply displays "Hello World!" to the standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); //Display the string.
    }
}

The following language strings are currently recognized: 4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript-french, actionscript, actionscript3, ada, algol68, apache, applescript, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, epc, ecmascript, eiffel, email, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, genero, genie, gdb, glsl, gml, gnuplot, go, groovy, gettext, gwbasic, haskell, hicest, hq9plus, html, html5, icon, idl, ini, inno, intercal, io, j, java5, java, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, modula2, modula3, mmix, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml-brief, ocaml, oobas, oracle8, oracle11, oxygene, oz, pascal, pcre, perl, perl6, per, pf, php-brief, php, pike, pic16, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vbnet, vb, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, whois, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic

Downloadable Code Blocks

When you use the <code> or <file> syntax as above, you might want to make the shown code available for download as well. You can do this by specifying a file name after language code like this:

<file php myexample.php>
<?php echo "hello world!"; ?>
</file>
myexample.php
<?php echo "hello world!"; ?>

If you don't want any highlighting but want a downloadable file, specify a dash (-) as the language code: <code - myfile.foo>.

Embedding HTML and PHP

You can embed raw HTML or PHP code into your documents by using the <html> or <php> tags. (Use uppercase tags if you need to enclose block level elements.)

HTML example:

<html>
This is some <span style="color:red;font-size:150%;">inline HTML</span>
</html>
<HTML>
<p style="border:2px dashed red;">And this is some block HTML</p>
</HTML>

This is some <span style="color:red;font-size:150%;">inline HTML</span>

<p style="border:2px dashed red;">And this is some block HTML</p>

PHP example:

<php>
echo 'The PHP version: ';
echo phpversion();
echo ' (generated inline HTML)';
</php>
<PHP>
echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>';
echo '<td>'.phpversion().'</td>';
echo '</tr></table>';
</PHP>

echo 'The PHP version: '; echo phpversion(); echo ' (inline HTML)';

echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>';
echo '<td>'.phpversion().'</td>';
echo '</tr></table>';

Please Note: HTML and PHP embedding is disabled by default in the configuration. If disabled, the code is displayed instead of executed.

RSS/ATOM Feed Aggregation

DokuWiki can integrate data from external XML feeds. For parsing the XML feeds, SimplePie is used. All formats understood by SimplePie can be used in DokuWiki as well. You can influence the rendering by multiple additional space separated parameters:

Parameter Description
any number will be used as maximum number items to show, defaults to 8
reverse display the last items in the feed first
author show item authors names
date show item dates
description show the item description. If HTML is disabled all tags will be stripped
n[dhm] refresh period, where d=days, h=hours, m=minutes. (e.g. 12h = 12 hours).

The refresh period defaults to 4 hours. Any value below 10 minutes will be treated as 10 minutes. DokuWiki will generally try to supply a cached version of a page, obviously this is inappropriate when the page contains dynamic external content. The parameter tells DokuWiki to re-render the page if it is more than refresh period since the page was last rendered.

Example:

{{rss>http://slashdot.org/index.rss 5 author date 1h }}

Control Macros

Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble:

Macro Description
~~NOTOC~~ If this macro is found on the page, no table of contents will be created
~~NOCACHE~~ DokuWiki caches all output by default. Sometimes this might not be wanted (eg. when the <php> syntax above is used), adding this macro will force DokuWiki to rerender a page on every call

Syntax Plugins

DokuWiki's syntax can be extended by Plugins. How the installed plugins are used is described on their appropriate description pages. The following syntax plugins are available in this particular DokuWiki installation:

1) 맨 아래에서 만나요
2) 두번째 주석