Docs:Config file
A number of options may be specified in a user-specific configuration file, providing defaults for arguments not specified on the command line (if the corresponding command line argument is specified, the command line takes priority over the configuration file).
The configuration file consists of section headers followed by one or more key-value pairs (the syntax is similar to that used in Windows .ini files, or the Samba configuration files). The configuration should be stored in a file called .courseprocessor.cfg stored in the user's home directory unless a different configuration file is specified via the --config
arguments to the processor and wiki2course tools.
It is important to note that all section names and directives are case sensitive, and must appear in the case specified.
An example configuration file would be:
[Processor]
output_handler = HTMLOutputHandler
verbosity = 0
debug = 0
[HTMLInputHandler]
latexcmd = /usr/bin/latex2html
latexargs = -nonavigation -noaddress -white -noinfo -antialias_text -html_version "4.1"
latexintro = \documentclass[12pt]{article}\n\usepackage{html}\n\usepackage[dvips]{color}\n\pagecolor{white}
cleanup = 1
[HTMLOutputHandler]
tidy = 1
tidybin = /usr/bin/tidy
tidyopts = -i -w 0 -b -q -c -asxhtml --join-classes no --join-styles no --merge-divs no --merge-spans no
templates = apecs_cbt_v3.7
#refhandler = IEEEReferenceHandler
[wiki2course]
wiki_url = http://elearn.cs.man.ac.uk/devwiki/
api_url = http://elearn.cs.man.ac.uk/devwiki/api.php
upload_url = http://elearn.cs.man.ac.uk/devwiki/index.php/Special:Upload
course_page = Course
data_page = coursedata
themes_title = Themes
modules_title = Modules
metadata = Metadata
media_page = Media
[Processor]
introduces the section in which the overall settings for the course processor can be specified. The section is optional, but if it is not provided the processor may not be able to determine which output handler to use if the user does not provide this information via the command line. The following directives may be specified within this section (any other directives in this section will be ignored):
output_handler
- This directive is optional.
- Specify the name of the output handler to use when processing courses. This should correspond to a valid output handler as listed when the processor is invoked with the
--listhandlers
argument.
verbosity
- This directive is optional.
- Set the default verbosity level for the processor. The value for this directive may be in the range 0 to 3, with 0 being the lowest verbosity (equivalent to invoking processor.pl without any
-v
argument), and 3 being the maximum (equivalent to-v -v -v
). If not specified, this defaults to 0.
debug
- This directive is optional.
- If set to 1, this will turn on additional debugging messages (which may produce more output than verbosity = 3). If not specified, this defaults to 0.
The course processor configuration file may contain a section that allows you to modify the behaviour of the HTMLInputHandler in various ways. This section, and all directives within it, are optional: the HTMLInputHandler will fall back on defaults if this section, or any directives, are not specified.
[HTMLInputHandler]
latexcmd = /usr/bin/latex2html
latexargs = -nonavigation -noaddress -white -noinfo -antialias_text -html_version "4.1"
latexintro = \documentclass[12pt]{article}\n\usepackage{html}\n\usepackage[dvips]{color}\n\pagecolor{white}
cleanup = 1
[HTMLInputHandler]
introduces the section in which the settings for the HTMLInputHandler can be specified. The following directives may be specified within this section (any other directives in this section will be ignored):
latexcmd
- This directive is optional.
- Allows you to specify the location of the latex2html command if it is not in the default '/usr/bin/latex2html' location.
latexargs
- This directive is optional.
- Specifies the arguments to pass to latex2html when processing
[latex]
blocks. You must specify at least-nonavigation -noaddress -white -noinfo
, otherwise the processing of[latex]
blocks will fail hilariously.
latexintro
- This directive is optional.
- Overrides the default LaTeX document preamble. This will be automatically placed at the start of temporary LaTeX files created while processing
[latex]
blocks. If you need multiple lines, insert \n to indicate a newline is needed.
cleanup
- This directive is optional.
- If set to 1, all temporary files are removed after processing, and all source steps are removed. If set to 0, temporary files and source steps are retained - this can be useful for debugging processing problems in some situations. If not specified, the default is to remove temporary and source files.
The course processor configuration file may contain a section that allows you to modify the behaviour of the HTMLOutputHandler in various ways. If you want to use the HTMLOutputHandler to process your course, you must include this section in your configuration file, and you must include the templates
directive. All other directives are optional.
[HTMLOutputHandler]
tidy = 1
tidybin = /usr/bin/tidy
tidyopts = -i -w 0 -b -q -c -asxhtml --join-classes no --join-styles no --merge-divs no --merge-spans no
templates = apecs_cbt_v3.7
#refhandler = IEEEReferenceHandler
[HTMLOutputHandler]
introduces the section in which the settings for the HTMLOutputHandler can be specified. The following directives may be specified within this section (any other directives in this section will be ignored):
templates
- This directive must be specified.
- Specify the name of the templates to use when processing the course through the HTMLOutputHandler. This may either be an absolute path to the template directory if you wish to use a template theme not provided by the processor, or it may be the name of a theme directory inside the processor's templates directory.
tidy
- This directive is optional.
- If set to 1, all steps generated by the HTMLOutputHandler will be passed through HTML Tidy. If 0, steps will not be tidied. Note that if this directive is not specified, the default is to process steps through HTML Tidy.
tidybin
- This directive is optional.
- Set the full path to the tidy program. This must be specified if your copy of tidy is not at '/usr/bin/tidy'.
tidyopts
- This directive is optional.
- Allows you to modify the arguments sent to the tidy program. If this is specified, you must ensure that both
--merge-divs
and--merge-spans
are set to no, otherwise the tidied output may break some features in the generated course (especially popups!)
The course processor configuration file may contain a section that allows you to modify the behaviour of the wiki2course.pl application in various ways. This section is optional, as are all the directives it contains, and the primary purpose of the section is to allow material in the wiki to use non-standard names for course elements.
[wiki2course]
wiki_url = http://elearn.cs.man.ac.uk/devwiki/
api_url = http://elearn.cs.man.ac.uk/devwiki/api.php
upload_url = http://elearn.cs.man.ac.uk/devwiki/index.php/Special:Upload
course_page = Course
data_page = coursedata
themes_title = Themes
modules_title = Modules
metadata = Metadata
media_page = Media
[wiki2course]
introduces the section in which the settings for wiki2course.pl can be specified. The following directives may be specified within this section (any other directives in this section will be ignored):
wiki_url
- This directive must be specified
- The URL of the wiki to export material from (when using course2wiki, this will be the wiki the course will be imported into).
api_url
- This directive must be specified
- The URL of the wiki api to communicate with when exporting (or importing when using course2wiki).
upload_url
- This directive must be specified
- The URL of the Special:Upload page to use when uploading files to the wiki (usually only needed by course2wiki).
course_page
- This directive is optional.
- Sets the course front page name within the course namespace, for example the OWB project uses "Book". This is case sensitive, and defaults to "Course".
data_page
- This directive is optional.
- Sets the coursedata page name searched for when processing the course page. This defaults to "coursedata" but other projects may use a different name (OWB uses "BookContents" for example). This is not case sensitive, so you will generally specify it in lowercase, unless you really want to do otherwise.
themes_title
- This directive is optional.
- The string that should appear within a level two == ... == header marking the location of the list of themes on the course data page, for example OWB uses 'Book Parts'. This is case sensitive, and defaults to 'Themes'.
modules_title
- This directive is optional.
- The string that should appear within a level two == ... == header marking the location of the list of modules on theme pages, for example OWB uses 'Chapters'. This is case sensitive, and defaults to 'Modules'.
metadata
- This directive is optional.
- The string that should appear within a level two == ... == header marking the location of the metadata block on course data and theme pages. This is case sensitive and defaults to 'Metadata'.
media_page
- This directive is optional.
- The name of the course media page. This is case sensitive and defaults to 'Media'.
|