Citation Formatter

Under preference there is a line for citation formatter, has this been added or still in development. Forums and newsgroup only talk about the different citation formats but not the actual addon.

Only the built-in Citation plug-in exists at this point. Just the framework has been built and the original Citation format has been migrated.

So current testing should just verify the features that using citations still works as it did previously. (Identifying any new oddity and correcting that.)

The feature has been added. It is now possible to write your own citation formatter. In this release it is limited to plain text citations

2 Likes

The new default citation plugin has an altogether-too-generic filename of “default.py

Won’t this cause confusion when searching modules?

Could the name be change to a less generic module before Gramps becomes locked into a poor name by a full public release?

Is this better?

The source is formatted as ‘Author, “Title”, Publisher, (Abbreviation)’ the citation is formatted as ‘Page - Date [Confidence]’.

I didn’t want to go down this route because it won’t be consistent with future plugins.

That is interesting too.

But I was talking about when searching the gramps source code. Having default.py show in the list doesn’t differentiate anything.

So instead of:
https://github.com/gramps-project/gramps/blob/master/gramps/plugins/cite/default.py
have
https://github.com/gramps-project/gramps/blob/master/gramps/plugins/cite/citedefault.py

So you’ll know this isn’t a module about resetting the defaults to a different locale’s societal norms or flushing all the .ini files for views then refreshing the active view.

1 Like

The default would be the only citation formatter in the core code. Any additional formats would be an addon.

I have already played around making my own in a folder Citations (similar to how filters are grouped) with a few modifications of the Source leaving the Citation format as is.

Any alternates would follow the default as the example. Having the name describe what it does should prompt how others create the alternative name for their options.

I updated the PR to add the citation example.

In general, a formatter won’t produce a single output format. I have two examples that I have been working on:

  1. A Citation Style Language (CSL) formatter

This will take variables, which may be stored as attributes, and format them using citeproc-py. The user will be able to choose from the available styles that citeproc-py supports. For example, it could be used to produce citations that conform to the Chicago Manual of Style.

  1. A template formatter

Again the variables will probably be stored as attributes. The user will be able to create a template to format a citation. We may provide a selection of templates to provide a citation format based on that described in Evidence Explained by Elizabeth Shown Mills.

These are only at a prototype stage of development at the moment.

The default plugin is provided to replicate the legacy Gedcom format.

2 Likes

maybe that could be the module name?

citegedcomlegacy.py

This is one of the problems I had when looking at the various styles; Chicago, APA, MLa, etc.

Citation Styles: APA, MLA, Chicago, Turabian, IEEE,

Citation Styles Guide | Examples for All Major Styles

Even within the Chicago style, the format changes depending on the type of source. For a book, the title should be in italics. Gramps cannot do this (or can it?). While articles or parts of a larger source has the title in quotations. Currently we can only have one format for everything.

Okay.

Is the ability to reshuffle what Gramps has now a function of 5.2.

And is the future citation enhancement something for 5.3 where what we currently have would be obsolete and this question of naming would be revisited?

We will be able to do this in the future.

With the new citation formatters we are no longer restricted to a fixed format for every type of source.

We can revisit the naming at a later stage. In v5.2 the developers can start to demonstrate possibilities. This is only just the start.

2 Likes

I think that I prefer “Legacy”. We use Gedcom fields, but our citation format is not actually specified by Gedcom.

1 Like

‘legacy’ is good. Sets expectations to a closer neighborhood than ‘default’

1 Like

Pushed the change to “Legacy”

1 Like

That pushed the part visible to end-users. But how about the module name?

gramps/plugins/cite/default.py
and the related line 40 in the cite.gpr.py
fname="default.py",

Check again. Just did it!

1 Like

Thanks! It persists in showing default.py when looking at the master branch. But now shows the commit with the fname changes.

The unit test is failing. There are two files that still need updating. You may also want to change the description to match the name.

1 Like