Trace: » wiki-syntax-advanced
คำสั่งขั้นประยุกต์ของ Dokuwiki
คำสั่งขั้นประยุกต์ จำเป็นต้องติดตั้ง Plug-ins ของ Dokuwiki ก่อนจึงจะทำงานได้ โดยดาวน์โหลด Plug-ins แล้ว Upload ไปไว้ที่โฟลเดอร์ /lib/plugins ในเครื่องแม่ข่ายเว็บที่ติดตั้ง Dokuwiki
เมื่อโอน Plug-ins ที่ต้องการไปใส่ไว้ในโฟลเดอร์ /lib/plugins แล้วบาง Plug-ins จะำเป็นต้องปรับแต่งระบบก่อนใช้งานจากเมนู Admin
เพิ่มคำอธิบายให้ภาพแบบ Flickr-like annotated
ภาพที่นำเข้าใน Dokuwiki สามารถเิ่พิ่มคำอธิบายให้ภาพได้ลักษณะเดียวกับ Flickr-like annotated ดังนี้
ดร.ทวีศักดิ์ กออนันตกูล
ประธานการลงนามความร่วมมือ
โดยจะต้องติดตั้ง Plug-ins ชื่อ aimg จากนั้นระบุคำสั่งในรูปแบบ
{{aimg>image-file-name.extension?widthxheight|Image Title}}
@Top,Left,Width,Height|Description
More Detial
~author-name
{{<aimg}}
ดึงหน้าปกและรายการหนังสือจาก Amazon
Plug-ins Amazon เป็นอีก 1 Plug-ins ที่น่านำมาประยุกต์ใช้ โดยเฉพาะห้องสมุดต่างๆ ที่ช่วยให้การแสดงหน้าปกหนังสือ รายชื่อหนังสือ และผู้เีขียนจากเว็บไซต์ amazon เป็นเรื่องง่ายเพียงแต่ป้อนชุดคำสั่ง ดังนี้ {{amazon>เลขที่รหัสผลิตภัณฑ์ amazon หรือ ASIN}} เช่น {{amazon>0142000280}} จะปรากฏผลดังนี้
ทั้งนี้การแสดงผลไม่จำเป็นต้องเป็นหนังสือก็ได้นะครับ ลองดูตัวอย่างนี้ดูสิครับ
วิธีการตรวจสอบ ASIN ของหนังสือ/ผลิตภัณฑ์ของ Amazon สังเกตจาก URL ดังนี้
ทั้งนี้เมื่อติดตั้ง Plug-ins จะต้องเข้าไปเพิ่มข้อมูลสำคัญเกี่ยวกับ Amazon Plug-ins 2 รายการคือ
- Your AWS Access Key ID
- Your AWS Secret Access Key
หมายเหตุ ASIN คือ Amazon Standard Identification Number รายละเอียดจาก Wikipedia
สีข้อความ
การเติมสีสันให้กับข้อความ ใช้คำสั่ง <color ชื่อสี> text</color> เช่น <color green>การเติมสีสันให้กับข้อความ</color> จะปรากฏผลดังนี้ การเติมสีสันให้กับข้อความ หรือจะระบุด้วยค่าสีฐาน 16 ได้ รหัสสีที่เลือกใส่ได้ ดูได้จาก color-code
ข้อความกับรูปภาพ
การนำเสนอข้อความพร้อมกับรูปภาพที่จัดตำแหน่ง จะปรากฏผลดังนี้
Paragraph#1 floating image and text (with some more floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image
Paragraph#2 floating image and text (with some more floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image
หากต้องการนำเนื้อหาพารากราฟที่ 2 อยู่ใต้ภาพ จะต้องใช้คำสั่ง ~~ CL ~~ (พิมพ์ติดกัน) คั่นก่อนพารากราฟที่ 2 ซึ่งจะปรากฏผล ดังนี้
Paragraph#1 floating image and text (with some more floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image
Paragraph#2 floating image and text (with some more floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image and text and floating image
หมายเหตุ คำสั่งนี้จะต้องติดตั้ง Plug-ins เพิ่ม ได้แก่ ClearFloat
การสร้างสไลด์โชว์ด้วย Dokuwiki
Dokuwiki สนับสนุนการสร้างสไลด์อัตโนมัติ ซึ่งต้องติดตั้ง Plug-ins ชื่อ S5 ก่อน จากนั้นก็สามารถใช้คำสั่ง ~~SLIDESHOW~~ กำกับที่ต้นเอกสารที่ต้องการให้นำเสนอเป็นสไลด์ โดยจะต้องสร้างเอกสารด้วยสไลด์ Heading 1 / Heading 2 ตามลำดับ โดยสไลด์แรกควรกำหนดด้วย Heading 1 และเนื้อหาแต่ละรายการใช้ความสามารถของ Bullet และ List
คำสั่ง ~~SLIDESHOW~~ จะต้องพิมพ์ด้วยตัวพิมพ์ใหญ่เท่านั้น
ส่งออก (Export) บทความเป็น Word ในรูปแบบ OpenOffice.org Writer
เนื้อหาจาก Dokuwiki สามารถแปลงเป็นเอกสาร Word ในรูปแบบ OpenOffice.org Writer (.odt) ได้ โดยติดตั้ง Plug-ins ชื่อ ODT จากนั้นหน้าเอกสารใดต้องการให้แปลงเป็นเอกสาร OpenOffice.org Writer ให้เพิ่มคำสั่ง ~~ODT~~ เพียงเท่านี้ก็จะได้ปุ่มแปลงเอกสาร และไม่้ต้องมาเสีย Copy / Paste และจัดหน้าให้เสียเวลา
คำสั่ง ~~ODT~~ จะต้องพิมพ์ด้วยตัวพิมพ์ใหญ่เท่านั้น
ล้างเนื้อหาแบบลอย (Clear Float)
การทำงานกับรูปภาพใน Wiki อาจจะประสบปัญหาข้อความที่อยู่ถัดจากคำสั่งแสดงภาพ ลอยไปอยู่ใกล้รูปภาพ ซึ่งสามารถดันให้ข้อความต้องอยู่ใต้ภาพโดยใช้คำสั่ง ~~CL~~ ก่อนพารากราฟข้อความ ทั้งนี้จะต้องติดตั้ง Plug-ins Clear Float ก่อน
นับถอยหลัง
การนับถอยหลังกิจกรรมใดๆ สามารถใช้คำสั่ง < COUNTDOWN:dd.mm.yyyy|คำอธิบาย > (พิมพ์ติดกัน) โดยระบุวันสิ้นสุดกิจกรรมในรูปแบบ dd.mm.yyyy (ระบุปี ค.ศ.) เช่น <COUNTDOWN:20.12.2010|ครบกำหนดส่งมอบงาน> ทั้งนี้ต้องติดตั้ง Plug-ins Countdown
883 days since ครบกำหนดส่งมอบงาน (12/20/2010)
สมการทางเคมี
Dokuwiki รองรับการนำเสนอสูตรสมการเคมีได้ง่าย เพียงติดตั้ง Plug-ins Chem แ้ล้วใช้คำสั่ง <chem> ... </chem> กำกับการนำเสนอ เช่น
<chem>C2H5O2-Na+</chem>
ซึ่งจะปรากฏผลดังนี้
C2H5O2-Na+
ตัวอย่าง สมการเคมีของ เฮกเซน C6H14 แอมโมเนีย NH3
C2H6
<chem>C2H6</chem>
Na2HPO4 12H2O
<chem>Na2HPO4 12H2O</chem>
C2H5O2-Na+
<chem>C2H5O2|-Na+</chem> // | is a splitter.
Cl2H6N2Pt2+
<chem>Cl2H6N2Pt2+</chem>
Al2(SO4)3
<chem>Al2(SO4)3</chem>
ปรับแต่งด้วย CSS
Dokuwiki อนุญาตให้นำคำสั่ง HTML และ CSS มาปรับแต่งการแสดงผลได้ตามต้องการ โดยจะต้องพิมพ์ภายใต้ <html>...</html> เช่น
<html> <p style="border:2px dashed red;">And this is some block HTML</p> </html>
ซึ่งจะได้ผลลัพธ์ดังนี้
And this is some block HTML
การเน้นข้อความในรูปแบบ Blockquote
การนำเนื้อหา/ข้อความจากแหล่งอื่นมาใช้ ควรใช้คำสั่ง <blockquote>..</blockquote> กำกับเพื่อให้แสดงผลที่ชัดเจน ทั้งนี้ควรระบุแหล่งที่มาของข้อความ/เนื้อหาภายใต้คำสั่ง <cite>...</cite> เช่น
<blockquote> Test with loads of markup... Another paragraph with a little [[http://nowhere|link]] to nowhere. Oh, and while we are at it, what about some **bold**, some //italic// and some __underlined__ text? And finally, an itemization: * item 1 * item 1.1 * item 1.2 * item 2 - ordered item 2.1 - ordered item 2.2 - ordered item 2.2.1 * item 3 Works :-) <cite>http://foosel.org/snippets/dokuwiki/blockquote</cite> </blockquote>
ซึ่งจะปรากฏผลดังนี้
Test with loads of markup…Another paragraph with a little link to nowhere. Oh, and while we are at it, what about some bold, some italic and some underlined text? And finally, an itemization:
item 1
item 1.1 item 1.2 item 2
ordered item 2.1 ordered item 2.2
ordered item 2.2.1 item 3Works
http://foosel.org/snippets/dokuwiki/blockquote![]()
ทั้งนี้จะต้องติดตั้ง Plug-ins Blockquote และ Cite อย่างไรก็ตามรูปแบบการแสดงผล อาจจะไม่เหมือนกับตัวอย่างนี้ ขึ้นอยู่กับ Template ที่เลือกใช้
สร้างกรอบ (Box) ให้กับเนื้อหา
Dokuwiki มี Plug-ins Boxes ที่เพิ่มความโดดเด่น สวยงามให้กับข้อความ/เนื้อหาในรูปแบบกรอบ (Box) โดยใช้คำสั่ง ดังนี้ <box> the box contents </box>
ซึ่งจะปรากฏผลลัพธ์ดังนี้
นอกจากนี้ยังสามารถปรับแต่งความสามารถของการนำเสนอกรอบได้ ได้ด้วยคำสั่ง <box width classes colours | title text> contents text </box>
โดย
- width คือความกว้าง มักจะระบุเป็น % เ่ช่นเต็มจอภาพก็ระบุเท่ากับ 100%
- classes คือ ส่วนขยายเพื่อบ่งบอกประเภท/รูปแบบของกรอบ เช่น
- round ระบุให้กรอบมีขอบมน
- blue เลือกแสดงด้วยชุดสี blue
- red เลือกแสดงด้วยชุดสี red
- green เลือกแสดงด้วยชุดสี green
- orange เลือกแสดงด้วยชุดสี orange
- left ระบุให้กรอบชิดซ้าย
- right ระบุให้กรอบชิดขวา
- Colours ให้ระบุค่าสีในรูปแบบฐานสิบหก โดยแบ่งเป็นสีดังนี้ content background title background outer box background borders
่่เช่น <box 80% round orange|a title> the box contents</box>
a title
<box 50% left blue>the box contents</box|a caption>
a caption
<box 60% round #f99 #fc9 #fcc #f60|title>the box contents></box|caption>
title
caption
รหัสสีที่เลือกใส่ได้ ดูได้จาก color-code
คำนวณใน Wiki
Dokuwiki เตรียม Plug-ins ฟังก์ชันคำนวณค่าต่างๆ ให้ใช้งานได้สะดวก โดยพิมพ์ในรูปแบบคำสั่ง calc:สมการคำนวณ= เช่น
ระบุคำสั่ง calc:2+3*5= จะปรากฏผลลัพธ์เท่ากับ
17
ระบุคำสั่ง calc:-1234.56*78.9= ปรากฏผลลัพธ์เท่ากับ
-97,406.784
ระบุคำสั่ง calc:sin(pi()/4)= ปรากฏผลลัพธ์เท่ากับ
0.707106781187
ระบุคำสั่ง calc:round(exp(1),3)= ปรากฏผลลัพธ์เท่ากับ
2.718
ระบุคำสั่ง calc:(1+sqrt(5))/2= ปรากฏผลลัพธ์เท่ากับ
1.61803398875
หรือจะใช้คำสั่ง calc:สมการคำนวณ>= เพื่อให้แสดงสูตรคำนวณด้วย เช่น ระบุเป็น calc:2+3*5>= จะปรากฏผล คือ 2+3*5 = 17
ฟังก์ชันการคำนวณตรงกับของ PHP
เพิ่ม Tag
การเพิ่มประสิทธิภาพให้หน้าเอกสารของ Dokuwiki ทำได้โดยการระบุ Tag หรือคำค้นให้แต่ละหน้า เช่น หน้าเนื้อหาแนะนำการใช้งานคำสั่ง Dokuwii อาจจะระบุคำค้นเป็น e-Learning หรือ Wiki หรือ Tutorial หรือ บทเรียน หรือจะระบุทุกคำก็ได้ โดยจะต้องเลื่อนไปบรรทัดสุดท้ายของหน้า แล้วระบุคำสั่ง {{tag>tag1 tag2 tagN}} เช่น {{tag>learning wiki}} แต่ละคำให้คั่นด้วยช่องว่าง ดังนั้นหากมีคำใดๆ ที่มีช่องว่างจะต้องมีเครื่องหมาย - ระบุแทน เช่น {{tag>learning wiki Online-tutorial}}
หน้าที่ระบุคำค้นนี้จะปรากฏสัญลักษณ์ ดังนี้
ทั้งนี้การแสดงผลขึ้นอยู่กับ Template ที่เลือกด้วยครับ และคำสั่งนี้ต้องติดตั้ง Plug-ins Tag ความสามารถอีกประำการของ Plug-ins นี้คือ เมื่อคลิกที่รายการ tag แต่ละรายการ โปรแกรมจะแสดงหน้าเอกสารที่มี tag ชุดเดียวกันให้อัตโนมัติ อันเป็นการจัดหมวดเนื้อหาอัตโนมัติด้วย ทั้งนี้จะต้องติดตั้ง Plug-ins Page List เสริมด้วย
กระดานสนทนา แลกเปลี่ยนความคิดเห็น
Dokuwiki มีกระดานสนทนาด้วย Plug-ins Discussion แลกเปลี่ยนความคิดเห็นได้ โดยเพิ่มคำสั่ง ~~DISCUSSION~~
สร้างลิงก์แบบปฏิับัติการ (ActionLink)
Dokuwiki มีคำสั่งแบบปฏิบัติให้เลือกใช้งานหลายคำสั่ง ด้วย ActionLink เช่น คำสั่งแก้ไขหน้าเอกสาร (Edit) คำสั่งแสดงหน้าเอกสารที่แก้ไขล่าสุด (Recent changes) ซึ่งสามารถนำมาระบุเป็นคำสั่งควบคุมในเนื้อหาได้ด้วยรูปแบบ {{actionlink>[action]|[title]}} เช่น
| คำสั่งคือ | |
| คุณสามารถแก้ไขหน้านี้ได้โดย คลิกที่นี่. | {{actionlink>edit|คลิกที่นี่}} |
| คุณสามารถดูประวัติการแก้ไขหน้านี้ได้โดย คลิกที่นี่. | {{actionlink>history|คลิกที่นี่}} |
| คุณสามารถดูแสดงหน้าที่มีการแก้ไขล่าสุดโดย คลิกที่นี่. | {{actionlink>recent|คลิกที่นี่}} |
| คุณสามารถ Login เข้าสู่ระบบได้โดย คลิกที่นี่. | {{actionlink>login|คลิกที่นี่}} |
| คุณสามารถแสดงรายการหน้าเอกสารทั้งหมดของระบบได้โดย คลิกที่นี่. | {{actionlink>index|คลิกที่นี่}} |
ตารางกิจกรรม
Dokuwiki ได้เตรียม Plug-ins BTable ที่ช่วยสร้างตารางกิจกรรม โดยมีรูปแบบคำสั่ง ดังนี้
<btable ชื่อกิจกรรม> <columns> หัวเรื่อง 1^หัวเรื่อง 2^หัวเรื่อง n </columns> <rows> รายการที่ 1^รายการที่ 2^รายการที่ n </rows> </btable> </nowiki>
ตัวอย่างที่ 1
ตัวอย่างที่ 2
นำเสนอด้วยกราฟ
Chart Plug-ins เป็นเครื่องมือที่ช่วยนำเสนอข้อมูลในรูปแบบกราฟแท่งและกราฟวงกลมแบบ Flash ที่สวยมากเครื่องมือหนึ่ง โดยศึกษารูปแบบคำสั่งเพิ่มเติมได้ที่ http://www.maani.us/xml_charts/index.php?menu=Reference
ตัวอย่าง
Bar
<chart 240 200 barchart FFFFFF RIGHT>
<!-- Default chart_type -->
<chart_data>
<row>
<null/>
<string>2001</string>
<string>2002</string>
<string>2003</string>
<string>2004</string>
</row>
<row>
<string>Data</string>
<number>5</number>
<number>10</number>
<number>30</number>
<number>63</number>
</row>
</chart_data>
</chart>
Pie
<chart 240 200 pichart FFFFFF RIGHT>
<chart_type>pie</chart_type>
<chart_data>
<row><null/>
<string>Academic</string>
<string>Others</string>
</row>
<row><string>Data</string>
<number>35.1</number>
<number>64.9</number>
</row>
</chart_data>
<chart_value_text>
<row><null/><null/><null/></row>
<row><null/>
<string>34.9%</string>
<string>65.1%</string>
</row>
</chart_value_text>
<chart_rect x='30' y='10' width='150' height='150'/><chart_value size='12'/>
<legend_label layout='horizontal' size='10'/><legend_rect x='10' y='20' width='0' height='40'/>
<draw><text size='14' bold='true' x='45' y='160' color='00dd33'>Accessed domain</text></draw>
</chart>
การกำหนดสิทธ์เข้าถึงเนื้อหา
Dokuwiki มีคำสั่ง Access Control List ในเมนู admin ที่ช่วยให้ควบคุมการเข้าถึงเนื้อหาแต่ละ namespace และ pagename กระทำได้ง่าย เช่น กำหนดให้ทุกหน้าใน namespace A สามารถแก้ไขไ้ด้เฉพาะ user ที่ชื่อ user1 เท่านั้น ทำได้โดย
1) เข้าสู่ส่วนควบคุม Admin แล้วเลือก Access Control List Management
2) เลือก namespace หรือ page ด้านซ้าย แล้วเลือก @user กำหนดสิทธ์เป็น Read
3) เลือก namespace หรือ page เดิม แล้วเลือก user จากนั้นระบุ account-user แล้วกำหนดสิทธ์
ก็จะได้สิทธ์เฉพาะหน้าหรือ namespace ตามต้องการ
การแก้ไขภาษาไทยของธีม
กรณีที่ใช้ template dokubook ให้แก้ไขไฟล์ dokubook\lang\en\lang.php และั root-folder\inc\lang\en\lang.php โดยกำหนด Thai Encoding เป็น UTF-8
สำหรับ template monobook ให้แก้ไขไฟล์ monobook\lang\en\lang.php และั root-folder\inc\lang\en\lang.php โดยกำหนด Thai Encoding เป็น UTF-8
เพิ่มประเภทของไฟล์ upload
เปิดไฟล์ conf/mime.conf แล้วเพิ่ม Mime type ของไฟล์ เช่น
docx application/msword
xlsx application/msexcel
xlsm application/msexcel
pptx application/mspowerpoint
สามารถตรวจสอบค่า Mime type ได้ที่ mime-type
ปรับค่าขนาดของไฟล์ที่สามารถอัพโหลดขึ้นได้
แก้ไขไฟล์ php.ini โดยปรับแก้ไขค่าขนาดของไฟล์ตามที่ต้องการในส่วนของบรรทัดต่อไปนี้
1. upload_max_filesize = 15M
2. post_max_size = 15M
จากตัวอย่างข้างต้น แสดงให้เห็นว่า ไฟล์ที่สามารถอัพโหลดขึ้นได้ ต้องมีขนาดไม่เกิน 15MB
อ้างอิงจาก http://www.dokuwiki.org/faq:uploadsize
เพิ่ม counter ให้กับ dokuwiki
ลืมรหัสผ่านของผู้ดูแลระบบ
ให้แก้ไขไฟล์ conf/users.auth.php แล้วแทนที่ด้วยรหัสผ่านที่เข้ารหัสแล้ว เ่ช่นใ้ช้รหัสผ่าน 21232f297a57a5a743894a0e4a801fc3 ซึ่งก็คือคำว่า admin
ผู้เขียน
- นายบุญเลิศ อรุณพิบูลย์ นักวิชาการ ศูนย์บริการความรู้ทางวิทยาศาสตร์และเทคโนโลยี
- นายขันธ์ศิริ อาทร เจ้าหน้าที่ระบบคอมพิวเตอร์ ศูนย์บริการความรู้ทางวิทยาศาสตร์และเทคโนโลยี










