ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* New module: simplebib
@ 2012-11-03 23:14 Zenlima
  2012-11-04  4:35 ` Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Zenlima @ 2012-11-03 23:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.

H.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: New module: simplebib
  2012-11-03 23:14 New module: simplebib Zenlima
@ 2012-11-04  4:35 ` Aditya Mahajan
  2012-11-04  6:38   ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2012-11-04  4:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.

The same applies for \getparameter[tmp]. It may be better to use something 
like \getparamenter[simplebib_tmp_]

3. Don't use camelCase for key-values

Most context keys are not camelCase. So, I would suggest "labelspace" 
instead of "labelSpace", "labelleft" instead of "labelLeft", etc.

4. \doifnot {...} {} vs \doifsomething {...}

You can make the code slightly cleaner by using \doifsomething{...} 
instead of the \doifnot {...} {}.


Some UI comments:

1. Dependence on crossref.

Can the dependence of crossref be optional. In particular, what if a user 
does just wants to link to the bibliography without the funny arrows from 
crossref module?

2. Setting style for labels.

You use

\sym{...\sc{\tmplabel}....}

It may be better to define style and color keys for the label rather than 
hardcoding \sc. In fact, all you need to do is set symstyle and symcolor 
for itemgroups.


3. Is it possible to change the format of an bibliographic item based on 
its type (journal paper, conference paper, book, etc.)? Is the current 
default formatting following a particular bibliographic style? If so, 
which one?

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: New module: simplebib
  2012-11-04  4:35 ` Aditya Mahajan
@ 2012-11-04  6:38   ` Wolfgang Schuster
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Schuster @ 2012-11-04  6:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 04.11.2012 um 05:35 schrieb Aditya Mahajan <adityam@umich.edu>:

> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-04  6:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-03 23:14 New module: simplebib Zenlima
2012-11-04  4:35 ` Aditya Mahajan
2012-11-04  6:38   ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).