Next: , Previous: , Up: make install   [Contents][Index]


Installing stylesheets

Installing stylesheets

The make stylesheets command (see make) produces a variety of stylesheets for presenting coNCePTuaL code in a more pleasant format than ordinary, monochromatic text. Stylesheets must currently be installed manually as per the following instructions:

ncptl.sty

ncptl.sty is typically installed in texmf/tex/latex/misc, where texmf is likely to be /usr/local/share/texmf. On a Web2c version of TeX the command kpsewhich -expand-var='$TEXMFLOCAL' should output the correct value of texmf. In most TeX distributions the filename database needs to be refreshed after a new package is installed. See http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages for more information. ncptl.sty is merely a customization of the listings package that defines a new language called ‘ncptl’. See the listings documentation for instructions on typesetting source code.

ncptl.ssh

Running a2ps --list=defaults outputs (among other things) the a2ps library path. ncptl.ssh should be installed in one of the sheets directories listed there, typically /usr/share/a2ps/sheets.

ncptl-mode.el
ncptl-mode.elc

ncptl-mode.el and ncptl-mode.elc belong in a local Elisp directory that is part of the Emacs load-path, e.g., /usr/share/emacs/site-lisp. The following Elisp code, which belongs in ~/.emacs for GNU Emacs or ~/.xemacs/init.el for XEmacs, makes Emacs set ncptl-mode whenever opening a file with extension .ncptl:

(autoload 'ncptl-mode "ncptl-mode"
  "Major mode for editing coNCePTuaL programs." t)
(add-to-list 'auto-mode-alist '("\\.ncptl$" . ncptl-mode))

Syntax highlighting should be enabled by default. If it isn’t, the Emacs command M-x font-lock-mode should enable it for the current buffer.

ncptl.vim

Vim’s syntax-file directory may be named after the Vim version, e.g., /usr/share/vim/vim61/syntax for Vim 6.1 . Put ncptl.vim there. To associate .ncptl files with coNCePTuaL code, the following lines need to be added to Vim’s filetype.vim file somewhere between the ‘augroup filetypedetect’ line and the ‘augroup END’ line:

" coNCePTuaL
au BufNewFile,BufRead *.ncptl           setf ncptl
ncptl.lang

Source-highlight stores all of its helper files in a single directory, typically /usr/share/source-highlight. Put ncptl.lang there. To associate .ncptl files with coNCePTuaL code you will also need to add the following line to the lang.map file in the same directory:

ncptl = ncptl.lang
ncptl.php

GeSHi stores all of its language files in a geshi subdirectory. Simply put ncptl.php there, and it should be ready for use. A quick way to convert coNCePTuaL programs to color-coded HTML is to use the command-line version of the PHP interpreter with the following shell script.

#__usr_bin_env_php___lt_html_gt___lt_head_gt___lt_title_gt__lt__php_echo_basename__argv_1______gt__lt__title_gt___lt__head_gt___lt_body_gt___lt__php_include_"GeSHi_directory/geshi.php");
$ncptl_code = file_get_contents($argv[1]);
geshi_highlight($ncptl_code, "ncptl");
?>
</body>
</html>

Simply replace GeSHi_directory with the name of your top-level GeSHi directory and run the script with the name of a coNCePTuaL file as its sole argument.

A GeSHi extension for Mediawiki introduces a ‘<syntaxhighlight>’ tag for presenting color-coded program listings on a wiki. ncptl.php makes it easy to use coNCePTuaL code in this context.


Next: , Previous: , Up: make install   [Contents][Index]

Scott Pakin, pakin@lanl.gov