Beispiel #1
0
    def rec(self, ctx, req):
        data = {}
        if interfaces.IContribution.providedBy(ctx):
            genre = 'incollection'
            data['author'] = [
                c.name for c in chain(ctx.primary_contributors,
                                      ctx.secondary_contributors)
            ]
            data['booktitle'] = req.dataset.description
            data['editor'] = [c.contributor.name for c in req.dataset.editors]
            id_ = '%s-%s' % (req.dataset.id, ctx.id)
        else:
            genre = 'book'
            data['editor'] = [c.contributor.name for c in ctx.editors]
            id_ = req.dataset.id

        return bibtex.Record(genre,
                             id_,
                             title=getattr(ctx, 'citation_name',
                                           ctx.__unicode__()),
                             url=req.resource_url(ctx),
                             address=req.dataset.publisher_place,
                             publisher=req.dataset.publisher_name,
                             year=str(req.dataset.published.year),
                             **data)
Beispiel #2
0
    def rec(self, ctx, req):
        """
        @article{dictionaria-daakaka,
            author    = {von Prince, Kilu},
            journal = {Dictionaria},
            number = {1},
            pages = {1-2175},
            doi = {00.0000/clld.2017.00.0.000},
            issn = {0000-0000},
        }
        """
        if not interfaces.IContribution.providedBy(ctx):
            return Base.rec(self, ctx, req)

        return bibtex.Record('article',
                             '{0}-{1}'.format(req.dataset.id, ctx.id),
                             author=[
                                 c.last_first()
                                 for c in chain(ctx.primary_contributors,
                                                ctx.secondary_contributors)
                             ],
                             title=getattr(ctx, 'citation_name',
                                           ctx.__unicode__()),
                             url=req.resource_url(ctx),
                             journal=req.dataset.name,
                             number='{0}'.format(ctx.number),
                             pages='1-{0}'.format(len(ctx.words)),
                             address=req.dataset.publisher_place,
                             publisher=req.dataset.publisher_name,
                             year='{0}'.format(ctx.published.year))
Beispiel #3
0
 def rec(self, ctx, req):
     url = '%s accessed %s' % (req.resource_url(ctx), datetime.date.today())
     return bibtex.Record('misc', req.dataset.id,
         author=[c.contributor.name for c in ctx.editors],
         title=getattr(ctx, 'citation_name', ctx.__unicode__()),
         url=url,
         address=req.dataset.publisher_place,
         howpublished=req.dataset.publisher_name,
         year=str(req.dataset.published.year))
Beispiel #4
0
 def rec(self, ctx, req):
     return bibtex.Record(
         'incollection',
         ctx.id,
         title=getattr(ctx, 'citation_name', ctx.__unicode__()),
         url=req.resource_url(ctx),
         address='Oxford',
         publisher='Oxford University Press',
         year='2013',
         author=ctx.format_authors(),
         booktitle='The atlas of pidgin and creole language structures',
         editor=' and '.join(c.contributor.name
                             for c in list(req.dataset.editors)))
Beispiel #5
0
 def rec(self, ctx, req):
     return bibtex.Record(
         'inbook',
         '%s-%s' % (req.dataset.id, ctx.id),
         url=req.resource_url(ctx),
         address=req.dataset.publisher_place,
         publisher=req.dataset.publisher_name,
         year=str(req.dataset.published.year),
         title='%s sound inventory (%s)' % (
             ctx.language.name, ctx.primary_contributors[0].id),
         author=ctx.primary_contributors[0].name.split(' and '),
         booktitle=req.dataset.description,
         editor=[c.contributor.name for c in list(req.dataset.editors)])
Beispiel #6
0
 def rec(self, ctx, req):
     return bibtex.Record(
         'incollection',
         ctx.id,
         title=ctx.name,
         url=req.resource_url(ctx),
         address='Oxford',
         publisher='Oxford University Press',
         year='2013',
         author=ctx.formatted_contributors(),
         booktitle='The survey of pidgin and creole languages. {0}'.format(
             ctx.description),
         editor=' and '.join(c.contributor.name
                             for c in list(req.dataset.editors)))
Beispiel #7
0
 def rec(self, ctx, req):
     if interfaces.IContribution.providedBy(ctx):
         return bibtex.Record(
             'article',
             '{}-{}'.format(req.dataset.id, ctx.id),
             author = [
                 c.name
                 for c in chain(ctx.primary_contributors, ctx.secondary_contributors)],
             year=str(ctx.published.year),
             title=getattr(ctx, 'citation_name', str(ctx)),
             journal=req.dataset.description,
             volume=str(ctx.number),
             address=req.dataset.publisher_place,
             publisher=req.dataset.publisher_name,
             url=req.resource_url(ctx),
             doi=ctx.doi)
     else:
         return super().rec(ctx, req)