Configuration
yawk uses a configuration file. It's name is the wiki's name ("wiki" if no name is specified) with "-yawk.conf" appended to it. The configuration file that belongs to the URL http://my-server.example.conf/cgi-bin/yawk/ would be named "wiki-yawk.conf" and located in yawk's configuration directory (see beginning of the CGI script).
At a minimum the dir option must be set.
Configuration option
The following configuration options are supported:
- css url ...
-
inserts links to the listed stylesheet URLs into the output.
- dir directory
-
sets the wiki's file directory.
All files in this directory and every subdirectory can be served by yawk. However, no part of the request path may start with a dot.
- handler code
-
inserts the Javascript code code into the BODY tag of formatted wikifiles. Example:
handler onDblClick = 'windows.location.href="?op=edit"'
opens file editor when the window id double clicked.
- header filename
-
inserts the contents of filename on top (before the navigator) of each wikifile. filename must contain HTML code.
- include filename
-
reads configuration options from filename. If filename does not start with a slash the filename is expected to be relative to the wiki's base directory. Included configuration files may set any configuration option but not dir.
- index filename
-
sets filename as main page, the default is 00-WikiIndex.
The index file is returned when a client requests a directory of the wiki server.
- internal-styles yes|no
-
turns yawk's internal stylesheet off.
- listfontsize val
-
sets the font size of search result lists to val (default is 100%). val can be any valid CSS size value. This value is not used in horizontal frame modes.
- name name
-
defines the name of the wikispace.
name My Wiki
- personal-mode yes|no|closed
-
sets the wiki's access mode: yes (the default) makes the wiki public accessable, no makes it public readable but writeable only from the localhost and closed restricts all accesses to the localhost.
- readonly yes|no
-
makes the wiki readonly.
- rel type url
-
defines url as type related link.
rel home: /00-WikiHome
Any rel link set in the configuration can be overwritten by the options found in a wikifile.
- script url
-
inserts a reference to url into HTML output.
script /path/to/script.js
- search-height num
-
the height of the search list frame in percent, 50 if not set.
- send-404 yes|no
-
if set to yes, yawk replies to requests to non-existing files with a 404 response if it's not an edit request.
- style string
-
add string to the style definition.
style P.top-nav { background: #FFFFCC; } - text-area rows cols
-
defines the size of the editor's text area.
- text-display par chars
-
displays up to chars characters from the first par paragraphs for each file in the search result list. The defaults are "3" and "120".
- type mime-type ext ...
-
defines files with one of the listed extension to be of MIME type mime-type.
- uploads yes|no
-
enables file uploads.
- usetablenav yes|no
-
renders the wiki navigators as (one row) HTML table.
- word key string
- defines string as display text for the navigation text key. Defined keys are: close, edit, home, main, open, reset, save and search. If an ampersand is found in string it is removed and the following character is set as access key.
Conditional configuration
yawk supports conditional configuration options depending on some aspects of the client request. Conditional options start with a comma separated list of condition terms having all terms enclosed by angle brackets. If the conditions match the request, the following options are set until either an empty line or a new angle bracket line is found.Each condition in the list can be prefixed with either a minus or a plus. If a condition that is preceded with a plus (the plus is optional) matches, the options are processed, preceeding with a minus negates this. If a list of conditions is given, all conditions are evaluated and the lists's result after the last condition is used. Some examples:
| Expression | Comment |
| r=^/yawk/ | returns true is the client's requests starts with /yawk/. |
| r=^/yawk/, -pda | returns true is the client's requests starts with /yawk/ (same as above) and the display mode is not pda. |
| pda, sidebar | true if the display mode is eiher sidebar or pda. |
Possible conditionals are:
- m=display-mode
-
Valid mode names are
- sidebar, pda
-
which refer to the normal display modes.
- plain
-
like pda but larger font size, intended for non-graphical console only browser.
- regular
-
keyword to select or unselect the standard display in a "normal" browser.
- *
- a star to match all mode names.
- r=regexp
- Conditions starting with r= are matched against the client's wiki request.
index 00-WikiIndex [r=00-WikiIndex] readonly yes [m=pda] index 00-PdaIndex [m=*, -m=sidebar] link ? 00-WikiHelp
The example above defines a separate main page for PDA mode and adds a link to the navigator for all modes but sidebar. Furthermore the wiki's index will not show the edit link.