Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance bibliographic display and functionality #99

Closed
ericleasemorgan opened this issue Jun 8, 2020 · 5 comments
Closed

Enhance bibliographic display and functionality #99

ericleasemorgan opened this issue Jun 8, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@ericleasemorgan
Copy link
Owner

At its core, the Reader ingests unstructured textual data and outputs a set of structured data. In our case, the textual data comes from scholarly journal articles. Thus, the Reader's input comes with bibliographic characteristics: authors, titles, dates, abstracts, DOIs, URLs, permissions (licenses), etc. Given a journal article, we are able to compute additional bibliographics such as but not limited to: keywords, readability scores, extent (size of document measured in words or sentences), sentiment, etc.

A carrel's bibliographic information is made accessible via an HTML file called "./htm/bibliographics.htm", for example:

https://cord.distantreader.org/carrels/tiny-carrel/htm/bibliographics.htm

This file is created through the use of two scripts and one template:

  1. reader:/bin/db2tsv-bibliographics.py
  2. reader:/bin/tsv2htm-bibliographics.py
  3. reader:/etc/tsv2htm-bibliographics.htm

The first script does the hard work, namely dumping all the desired bibliographic information to a tab-delimited file. The second script reads the tab-delimited file, creates a set of HTML tr/td combinations for each record, opens the template, replaces a token found in the template with the combinations, and sends the resulting HTML to STDOUT.

Your mission, if you choose to accept it, it to simplify/enhance ./htm/bibliographics.htm in three ways. First, remove the column named "pages" because our data has zero bits of pagination. Second, remove the column called "cache" because its existence significantly hinders usability. Third, hyperlink the values in the column labeled "text" so they point to the corresponding plain text files found in the carrel's ./txt directory. To do this work, you will only need to edit tsv2htm-bibliographics.py and tsv2htm-bibliographics.htm. As of right now, no editing against db2tsv-bibliographics.py is necessary.

Once this is done, additional fields may be available for inclusion in the table. Fields may include DOI, URL, etc. In addition, next steps will be to exploit the functionality of the underlying Javascript library (DataTables) for the purposes of filtering and sorting.

For extra credit, create a link at the top of ./htm/bibliographics.htm, and call it "View as bibliography". When the student, researcher, or scholar clicks the link, then the output will take the form of a narrative report -- a sort of annotated bibliography suitable for sharing or printing.

@mcarro10
Copy link
Collaborator

bibchanges.zip
changed files - reader:/etc/tsv2htm-bibliographics.htm, reader:/bin/tsv2htm-bibliographics.py
python script changed so that it now requires two arguments (tsv file, path to carrel). I did this because it seemed like a simple way to have the path to a given carrel, and this is necessary to open the text files.

@nkmeyers nkmeyers added the enhancement New feature or request label Jun 26, 2020
@ericleasemorgan
Copy link
Owner Author

ericleasemorgan commented Jun 26, 2020 via email

@mcarro10
Copy link
Collaborator

annotatedbib.zip
I finally added the annotated bibliography option to the tsv2htm-bibliographics.htm file - sorry that this took so long. I think that it has basic information in a simple format, but I assume it should probably also include summaries. The way that I did it uses the data that is in the table so I am still trying to figure out how I would have summaries in the bibliography and not in the table. The other limitation of this approach is that if, for example, the user had selected 'view 10 items' in the table, then there will only be items in the bibliography (I think this is an easier thing to change).

@ericleasemorgan
Copy link
Owner Author

ericleasemorgan commented Jul 10, 2020 via email

@mcarro10
Copy link
Collaborator

mcarro10 commented Jul 10, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants