Am 04.11.2012 um 05:35 schrieb Aditya Mahajan
On Sun, 4 Nov 2012, Zenlima wrote:
Hallo,
here is my third module for you guys: a simple bibliography without a database but with items:
http://modules.contextgarden.net/simplebib
http://wiki.contextgarden.net/Simple_Bibliography
Please feel free to comment.
I don't really understand what is the advantage of this module over the bib module (The bib module can be used without a bibtex database by writing a bibliography in a key-value way. In fact all that when you use a bibtex database, the first step is to convert the bib file to a key-value file and then proceed by processing it).
Some stylistic comments:
1. Spacing around =
%D \module [ %D file = t-simplebib, %D version = 0.8 %D title = \CONTEXT\ User Module, %D subtitle = Simple Bibliography, %D author = Zenlima, %D date = 2012.11.03 %D copyright = Henning Haeske, %D license = '' %D ]
This will fail when you generate the documentation. Use
\module[ file=t-simplebib, version=0.8, ... ]
that is, no space around the = sign.
2. Use a internal namespace for macros.
For example, you have
\def\labelspace{\moduleparameter{simplebib}{labelSpace}}
The macro \labelspace is not meant to be used by the user. So, it is better to name is \simplebib_labelspace to avoid conflict with other user defined macros.
I would do the same with the \isbn command, define it in the module as \def\simplebib_isbn#1{\hyphenatedurl{#1}} and copy it to the \isbn later \def\bibitem[#1]% {\begingroup \let\isbn\simplebib_isbn … \endgroup}
The same applies for \getparameter[tmp]. It may be better to use something like \getparamenter[simplebib_tmp_]
I would use \getdummyparameters instead because you don’t have to preset the keys and you can use \dummyparameter to access the values. \def\decodebibitem[#1]% {\begingroup \getdummyparameters[#1]% \doifsomething{\dummyparameter{author}}{\dummyparameter{author}\doifsomething{\dummyparameter{year}}{ }}% ... \endgroup} Wolfgang