Difference between revisions of "Calendar zh-tw"
Roc michael (talk | contribs) |
Roc michael (talk | contribs) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
node 2007-09-28-Event_A {} | node 2007-09-28-Event_A {} | ||
node YYYY-10-04-Event_B {} | node YYYY-10-04-Event_B {} | ||
− | + | node 2007-10-19-Event_C {} | |
node Event {type tpl} | node Event {type tpl} | ||
Line 94: | Line 94: | ||
#* [[mw:Extension:VariablesExtension]] | #* [[mw:Extension:VariablesExtension]] | ||
#* [[mw:Extension:StringFunctions]] -- 於本站內的版本[[StringFunctions extension|StringFunctions]]則為小幅度功能增強版本,其可使用正則表達式( regular expressions); 雖然並非必須,但還是建議您使用本站所提供之版本。 | #* [[mw:Extension:StringFunctions]] -- 於本站內的版本[[StringFunctions extension|StringFunctions]]則為小幅度功能增強版本,其可使用正則表達式( regular expressions); 雖然並非必須,但還是建議您使用本站所提供之版本。 | ||
− | #* [ | + | #* [http://meta.wikimedia.org/wiki/Help:ParserFunctions#Installation Extension:ParserFunctions] |
The process of installation is the same as always: create a directory per extension in the 'extension' folder and put a 'require_once' statement into your LocalSettings.php. | The process of installation is the same as always: create a directory per extension in the 'extension' folder and put a 'require_once' statement into your LocalSettings.php. | ||
Line 106: | Line 106: | ||
[[Template:Calendar month zh-tw]] | [[Template:Calendar month zh-tw]] | ||
[[Template:CalendarSingle zh-tw]] | [[Template:CalendarSingle zh-tw]] | ||
− | [[Template:Calendar link | + | [[Template:Calendar link]] |
[[Template:Calendar/MonthStartMon]] | [[Template:Calendar/MonthStartMon]] | ||
[[Template:Calendar/MonthStartTue]] | [[Template:Calendar/MonthStartTue]] | ||
Line 117: | Line 117: | ||
[[Template:(!]] | [[Template:(!]] | ||
[[Template:!)]] | [[Template:!)]] | ||
− | [[Event template zh-tw]] | + | [[Event template]] |
− | [[ | + | [[Event intro]] |
− | [[Template: | + | [[Template:Event]] |
− | [[ | + | [[Template:Create Event]] |
+ | [[Talk:Calendar zh-tw]] | ||
+ | [[Calendar zh-tw/Demo]] | ||
+ | [[Template:DPL Calendar code generater zh-tw]] | ||
+ | [[Calendar zh-tw]] | ||
+ | [[Calendar]] | ||
</small> | </small> | ||
Line 147: | Line 152: | ||
=== 使用方式(Using the calendar) === | === 使用方式(Using the calendar) === | ||
− | + | 建立一個用以描述記事(events)的新文件,您可以點選行事曆上的日期數字或是以其他方式自行建置一個符合行事曆命名規範的文件。 | |
*請依照下列的命名規範:頁面名稱須以日期(date)為起首 (如"YYYY-MM-DD"其後再加些簡短的描述。 | *請依照下列的命名規範:頁面名稱須以日期(date)為起首 (如"YYYY-MM-DD"其後再加些簡短的描述。 | ||
*:例如: "2007-10-31 一些重要的事情" | *:例如: "2007-10-31 一些重要的事情" | ||
*請記得該文件須隸屬於'Events'此一分類(category),如果您在文件的第一行使用了"Event"樣板,則其自動完成此一設定。 | *請記得該文件須隸屬於'Events'此一分類(category),如果您在文件的第一行使用了"Event"樣板,則其自動完成此一設定。 | ||
*如有必要,您請可另行增加其他分類 (像是<tt><nowiki>[[Category:假日]]</nowiki></tt> ),這樣的話該資訊亦會顯示於行事曆下方的表格(event table)之中。 | *如有必要,您請可另行增加其他分類 (像是<tt><nowiki>[[Category:假日]]</nowiki></tt> ),這樣的話該資訊亦會顯示於行事曆下方的表格(event table)之中。 | ||
− | * 您可以'YYYY'的方式來定義每年一度重複性(yearly recurring events) | + | * 您可以'YYYY'的方式來定義每年一度重複性(yearly recurring events)的記事。 |
*:例如"YYYY-12-24 耶誕夜" | *:例如"YYYY-12-24 耶誕夜" | ||
− | * 同樣的您可以'YYYY-MM'的方式來定義每個月重複性(yearly recurring events) | + | * 同樣的您可以'YYYY-MM'的方式來定義每個月重複性(yearly recurring events)的記事。 |
*: 例如"YYYY-MM-05 領薪水" | *: 例如"YYYY-MM-05 領薪水" | ||
− | + | 目前尚無法以其他方式定義經常性的記事。 | |
=== 客製化Customizing === | === 客製化Customizing === | ||
Line 169: | Line 174: | ||
You could modify the name of sections, the number of sections or even take the parameters of a template inside the event page. Again, see the DPL manual. | You could modify the name of sections, the number of sections or even take the parameters of a template inside the event page. Again, see the DPL manual. | ||
− | == | + | ==[[Calendar zh-tw/Demo|Demo]]== |
− | + | {{:Calendar zh-tw/Demo}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | {{: | ||
− | |||
==行事曆程式碼產生器(中文版)== | ==行事曆程式碼產生器(中文版)== | ||
{{DPL Calendar code generater zh-tw}} | {{DPL Calendar code generater zh-tw}} |
Latest revision as of 15:29, 12 December 2007
English 中文(Chinese)
這是 DPL Calendar 的官方中文網頁。
概說 (Concept)
- 如果您運用數個極受歡迎的外掛,則您即可以wiki語法來產生一個行事曆。(If you combine the power of some popular extensions it is possible to write a calendaring application completely in wiki code.)
- 它相較於使用php程式設計的方式更為有彈性。(This is very flexible compared to php programming.)
結構(Architecture)
{{#wgraph: svg| thumb=90 |
node Current_events {type cal}
node 2007-09-28-Event_A {} node YYYY-10-04-Event_B {} node 2007-10-19-Event_C {}
node Event {type tpl} node CatEvent {type category label Events} node CatHoliday {type category label Holiday} edge Event CatEvent {type cat} node Event_template {type editsample} node Event_intro {type editintro} edge Event_intro Event_template {kind rightnear type editintro} edge 2007-09-28-Event_A Event {type incl} edge YYYY-10-04-Event_B Event {type incl} edge YYYY-10-04-Event_B CatHoliday {type catgeory} edge 2007-10-19-Event_C Event {type incl} edge Event_template 2007-09-28-Event_A {type edit} edge Event_template YYYY-10-04-Event_B {type edit} edge Event_template 2007-10-19-Event_C {type edit} edge Event_template Event {type incl}
edge Current_events Calendar_month {type incl}
node Calendar_month {type tpl} node CalendarSingle {type tpl} node Calendar_link {type tpl} edge Calendar_month 2007-09-28-Event_A {type dpl} edge Calendar_month YYYY-10-04-Event_B {type dpl} edge Calendar_month 2007-10-19-Event_C {type dpl} edge Calendar_month CalendarSingle {type incl} edge CalendarSingle Calendar_link {type incl} edge CalendarSingle Current_events {type link label 'next month
prev. month' }
node Calendar/MonthStartMon {type tpl} node Calendar/MonthStartTue {type tpl}
edge CalendarSingle Calendar/MonthStartMon {type incl} edge CalendarSingle Calendar/MonthStartTue {type incl}
nodetype tpl {color yellow } nodetype category {color lightgreen} nodetype cal {color lightblue } nodetype editsample {color lightcyan } nodetype editintro {color lightcyan } nodetype * {color #ffdddd bordercolor darkgray}
edgetype incl {color darkgray} edgetype link {color blue} edgetype cat {color darkgreen} edgetype dpl {color red thickness 4 label 'DPL query'} edgetype edit {linestyle dotted color blue}
node.fontname helvR10
}}
- Templates are in yellow.
- The pages describing an event are in red. Their names must start with the date of the event (format: YYYY-MM-DD) or with 'YYYY-' plus month and day (for recurring yearly events).
- We use two edit helpers (in cyan) when event pages are created.
- The entry page for the calendar (Current events) is in blue.
- Categories are in green.
The design is as follows:
- The user calls the entry page Current events zh-tw. Be careful if you change its name: The name of this page must be passed as an argument (named 'basepage') to the template 'Calendar month'.
- The basepage can be called by the user without any arguments. Then it uses a date function to calculate the current month. It can also be called from another calendar page - in which case the desired year & month are passed as parameters via the Call extension. There are more parameters for Current events - see the explanation below.
- Template 'Calendar month' ...
- shows the calendar box. The calendar box contains the titles of the event pages (the first part of the titles´ names which contain the resp. date is suppressed). Below the calendar there is an optional event list which shows either all events of the current month or all events regardless of month.
- expects a 'purpose' parameter. If this parameter is set it acts as a filter, i.e. only events will be shown which belong to a category with the name of the 'purpose'. This allows you to have several calendars in parallel
- uses a DPL query to find all articles in category 'Event' which belong to the selected year/month
- shows the selected articles in a list, together with some selected chapters (like Participants ..) and with their categories
- offers a link to create new events (using the edit template "Event template")
安裝(Installation)
安裝外掛(Install extensions)
您需要:
- 從本站下載 (經由 Download頁面下載後解壓縮)
- DPL 外掛
- Call 外掛
- Inputbox 外掛 (此版本與官方版本有些許的差異)
- 從 mediawiki.org:
- mw:Extension:VariablesExtension
- mw:Extension:StringFunctions -- 於本站內的版本StringFunctions則為小幅度功能增強版本,其可使用正則表達式( regular expressions); 雖然並非必須,但還是建議您使用本站所提供之版本。
- Extension:ParserFunctions
The process of installation is the same as always: create a directory per extension in the 'extension' folder and put a 'require_once' statement into your LocalSettings.php.
安裝行事曆樣板(Install Calendar Templates)
複製(Copy) / 貼上(paste)以下的頁面至Special:export 然後將此頁所產出的 XML 文字檔 匯入您的wiki:
Current events zh-tw Template:Calendar month zh-tw Template:CalendarSingle zh-tw Template:Calendar link Template:Calendar/MonthStartMon Template:Calendar/MonthStartTue Template:Calendar/MonthStartWed Template:Calendar/MonthStartThu Template:Calendar/MonthStartFri Template:Calendar/MonthStartSat Template:Calendar/MonthStartSun Template:! Template:(! Template:!) Event template Event intro Template:Event Template:Create Event Talk:Calendar zh-tw Calendar zh-tw/Demo Template:DPL Calendar code generater zh-tw Calendar zh-tw Calendar
以下是英文版 (Followed pages are English version)
Current events Template:Calendar month Template:CalendarSingle Template:Calendar link Template:Calendar/MonthStartMon Template:Calendar/MonthStartTue Template:Calendar/MonthStartWed Template:Calendar/MonthStartThu Template:Calendar/MonthStartFri Template:Calendar/MonthStartSat Template:Calendar/MonthStartSun Template:! Template:(! Template:!) Event template Event intro Template:Event Template:Create Event
使用方式(Using the calendar)
建立一個用以描述記事(events)的新文件,您可以點選行事曆上的日期數字或是以其他方式自行建置一個符合行事曆命名規範的文件。
- 請依照下列的命名規範:頁面名稱須以日期(date)為起首 (如"YYYY-MM-DD"其後再加些簡短的描述。
- 例如: "2007-10-31 一些重要的事情"
- 請記得該文件須隸屬於'Events'此一分類(category),如果您在文件的第一行使用了"Event"樣板,則其自動完成此一設定。
- 如有必要,您請可另行增加其他分類 (像是[[Category:假日]] ),這樣的話該資訊亦會顯示於行事曆下方的表格(event table)之中。
- 您可以'YYYY'的方式來定義每年一度重複性(yearly recurring events)的記事。
- 例如"YYYY-12-24 耶誕夜"
- 同樣的您可以'YYYY-MM'的方式來定義每個月重複性(yearly recurring events)的記事。
- 例如"YYYY-MM-05 領薪水"
目前尚無法以其他方式定義經常性的記事。
客製化Customizing
如您想要客製化此一行事曆,請您撥冗查閱一下DPL的使用手冊(DPL manual)特別是include 參數及format 參數。在我們的範例中Template:calendar month zh-tw, 設有:
#Summary,#Participants,#Location
#主旨,#參加人員,#地點
分別將顯示 Summary, Participants 及 Location 等章節。(which means to take the content of Summary, Participants and Location sections.)
You could modify the name of sections, the number of sections or even take the parameters of a template inside the event page. Again, see the DPL manual.
Demo
您可以如下的方式使用{{:Current events zh-tw|namespace=Test|purpose=Michael's events¦dpl group's event|width=500px}} 此行事曆有如下的參數(parameters):
- year - 預設值為今年。
- month - 預設值為本月。
- purpose - 可不設定本參數,一經設定本參數後,則僅屬於指定分類(category)的記事(events)才會被顯示出來,本項目可以設定多個項目,以管線符號(¦)來分隔多項。
- namespace - 可不設定本參數,一經設定本參數後,則僅屬於指定名字空間(namespace)的記事(events)才會被顯示出來,且新增記事時該頁面名稱也會配套的使用該名字空間。
- show - 可不設定本參數,或設定記事頁面中的章節名稱(chpater name),而該章節的內容則會在行事曆中被顯示出來,若內容含有圖片(images)時,該圖片亦會被顯示出來。
- eventList = {no|current|all}, 預設值為'current';可產生一可表格式的報表來呈現您所指定的記事(events)。
- width = 可不設定本參數,或指定一寬度值像是'500px' 或 '100%'; 預設值為將使您的行事曆以最小面積的方式來呈現。
- noadd = 可不設定本參數或可設為 '1'; 當您設定此一參數為'1'時,則此一行事曆將不會顯示可用於新增記事的超連結(link)。
- nolink = 可不設定本參數或可設為 '1'; 當您設定此一參數為'1'時,則此一行事曆上的記事將不會顯示可連到該頁面的超連結(link)而是由該日的日期提供您連至頁面所需的超連結,使用此一參數配合"eventList=no" 則是不合理的使用方式。如果此參數設為'1'則noadd參數也就設為'1'了。
{{:Current events zh-tw|namespace=Test|purpose=Michael's events¦dpl group's event|width=500px}}
{{#vardefine:year
|2024}}{{#vardefine:month |11}} {{#vardefine:width|500px}}{{#vardefine:noadd|}}{{#vardefine:nolink|}}{{#vardefine:purpose|Michael's events¦dpl group's event}}{{#vardefine:show|}}{{#vardefine:namespace|Test}}
|
Extension:DynamicPageList (DPL), version 3.2.1: Warning: Unknown parameter 'addnamespace' was ignored. Help: available parameters: addauthor, addcategories, addcontribution, addeditdate, addexternallink, addfirstcategorydate, addlasteditor, addpagecounter, addpagesize, addpagetoucheddate, adduser, allowcachedresults, allrevisionsbefore, allrevisionssince, articlecategory, cacheperiod, categoriesminmax, category, categorymatch, categoryregexp, columns, count, createdby, debug, distinct, dominantsection, eliminate, escapelinks, execandexit, firstrevisionsince, fixcategory, format, headingcount, headingmode, hiddencategories, hitemattr, hlistattr, ignorecase, imagecontainer, imageused, include, includematch, includematchparsed, includemaxlength, includenotmatch, includenotmatchparsed, includepage, includesubpages, includetrim, inlinetext, itemattr, lastmodifiedby, lastrevisionbefore, linksfrom, linksto, linkstoexternal, listattr, listseparators, maxrevisions, minoredits, minrevisions, mode, modifiedby, multisecseparators, namespace, noresultsfooter, noresultsheader, notcategory, notcategorymatch, notcategoryregexp, notcreatedby, notlastmodifiedby, notlinksfrom, notlinksto, notmodifiedby, notnamespace, nottitlematch, nottitleregexp, notuses, offset, oneresultfooter, oneresultheader, openreferences, order, ordercollation, ordermethod, qualitypages, randomcount, redirects, replaceintitle, reset, resultsfooter, resultsheader, rowcolformat, rows, rowsize, scroll, secseparators, showcurid, shownamespace, skipthispage, stablepages, suppresserrors, table, tablerow, tablesortcol, title, titlegt, titlelt, titlematch, titlemaxlength, titleregexp, usedby, userdateformat, uses
.
行事曆程式碼產生器(中文版)
{{#form: name=demo |action={{#replace:/dpldemo/index.php?title=Calendar_zh-tw
|%^([\/]\S*[index.php])([\/])([Calendar zh-tw]\S*)% |\1 }}|
{{#input: name= title |type= hidden | value = Special:Call/DPL Calendar code generater zh-tw }}
語言(Language) | {{#input: name=lang | type=select | value = |
}} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
指定年份(year) | {{#input: name=year | value = }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
指定月份(month) | {{#input: name=month | value = }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
指定名字空間(namespace) | {{#input: name=namespace | value = }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
用途(purpose) | {{#input: name=purpose | value = }} 例「張三記事,李四記事」 (e.g: Michael's events,dpl group's event) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
顯示指定章節(show) | {{#input: name=show | value = }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
顯示報表(eventList) | {{#input: name=eventList | type=select | value = |
}} 本月份(current),不顯示(no),顯示全部(all) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
寛度 (width) | {{#input: name=width | value = 500px }}例: "100%" 或 "500px" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
無法新增記事(noadd) | {{#input: name=noadd | type=select | value = |
}} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
不顯示記事之超連結(nolink) | {{#input: name=nolink | type=select | value = |
}} |
{{#input: type = submit | value = 產生(Generate)}} 放棄(reset) graph |
}}
{{#vardefine:year|2024}}{{#vardefine:month|11}} {{#vardefine:width|}}{{#vardefine:noadd|}}{{#vardefine:nolink|}}{{#vardefine:purpose|{{#replace:|,|¦}}}}{{#vardefine:show|}}{{#vardefine:namespace|}}
|
No events planned.
Your query used the following parameters:
{{:Current events
|width=
|noadd=
|nolink=
}}