C2DH / journal-of-digital-history

frontend app for our Digital Journal
GNU General Public License v3.0
20 stars 4 forks source link

Migration to citation manager : 2 uses cases to take into account #615

Closed eliselavy closed 8 months ago

eliselavy commented 8 months ago

Linked to : https://github.com/C2DH/journal-of-digital-history-jupyter-stack/issues/8

Article written with the citation manager plugin:

Example provided here: https://github.com/C2DH/jdh-notebook/blob/master/examples/cite2c-citationmanager/citation_from_citation_manager.ipynb

In frontend: Screenshot 2024-02-21 at 10 12 04

In the raw: https://raw.githubusercontent.com/C2DH/jdh-notebook/master/examples/cite2c-citationmanager/citation_from_citation_manager.ipynb

In the markdown cell:

modelling and printing techniques (<cite id=\"ysmr4\"><a href=\"#zotero%7C8918850%2FHEZNECAM\">(Papadopoulos &#38; Earl, 2014)</a></cite>

At the level of the cell metadata is defined the zotero key:

 "ysmr4": [
       {
        "id": "8918850/HEZNECAM",
        "source": "zotero"
       }
      ]

At the level of the notebook metadata, all the zotero metadata

 "8918850/HEZNECAM": {
      "URL": "https://www.degruyter.com/document/doi/10.1515/9783110266436.135/html",
      "abstract": "Formal three-dimensional computational analyses of archaeological spaces was published in Spatial analysis and social spaces on page 135.",
      "accessed": {
       "date-parts": [
        [
         2021,
         4,
         27
        ]
       ]
      },
      "author": [
       {
        "family": "Papadopoulos",
        "given": "Constantinos"
       },
       {
        "family": "Earl",
        "given": "Graeme"
       }
      ],
      "container-title": "Spatial analysis and social spaces: Interdisciplinary approaches to the interpretation of prehistoric and historic built environments",
      "editor": [
       {
        "family": "Paliou",
        "given": "Eleftheria"
       },
       {
        "family": "Lieberwirth",
        "given": "Undine"
       },
       {
        "family": "Polla",
        "given": "Silvia"
       }
      ],
      "id": "8918850/HEZNECAM",
      "issued": {
       "date-parts": [
        [
         2014,
         4
        ]
       ]
      },
      "language": "English",
      "page": "135–165",
      "publisher": "De Gruyter",
      "system_id": "zotero|8918850/HEZNECAM",
      "title": "Formal three-dimensional computational analyses of archaeological spaces",
      "type": "chapter"
     },

Article written with the cite2c plugin but migrate to citation manager plugin:

Example provided here: https://github.com/C2DH/jdh-notebook/blob/master/examples/cite2c-citationmanager/citation_cit2c_migration.ipynb

In frontend:

Screenshot 2024-02-21 at 10 21 16

In the raw: https://raw.githubusercontent.com/C2DH/jdh-notebook/master/examples/cite2c-citationmanager/citation_cit2c_migration.ipynb

In the markdown cell: were enslaved (<cite id=\"cite2c-7748027/C6Q3NJHF\"><a href=\"#cite2c%7C7748027%2FC6Q3NJHF\">(Karasch, 1987)</a></cite>:60,

At the level of the cell metadata:

 "citation-manager": {
     "citations": {
      "cite2c-7748027/C6Q3NJHF": [
       {
        "id": "7748027/C6Q3NJHF",
        "source": "cite2c"
       }

At the level of notebook metadata: The definition of cite2c

"7748027/C6Q3NJHF": {
      "ISBN": "9780691196206 9780691655574",
      "abstract": "Rio de Janeiro in the first half of the nineteenth century had the largest population of urban slaves in the Americas-.",
      "accessed": {
       "day": 27,
       "month": 2,
       "year": 2021
      },
      "author": [
       {
        "family": "Karasch",
        "given": "Mary C"
       }
      ],
      "edition": "1",
      "event-place": "Princeton",
      "id": "7748027/C6Q3NJHF",
      "issued": {
       "year": 1987
      },
      "language": "English",
      "note": "OCLC: 1089531965",
      "number-of-pages": "448",
      "publisher": "Princeton University Press",
      "publisher-place": "Princeton",
      "system_id": "cite2c|7748027/C6Q3NJHF",
      "title": "Slave Life in Rio de Janeiro, 1808-1850",
      "type": "book"
     },

For the Bibliography

Screenshot 2024-02-21 at 10 27 47

danieleguido commented 8 months ago

Case 1 cfr: netlify preview regex on parsed markdown using this regex:

&lt;cite\s+[^&]+&gt;&lt;a\s+href=.#zotero%..([\dA-Z]+)%..([\dA-Z]+).&gt;(.+?)&lt;\/a&gt;&lt;\/cite&gt;
eliselavy commented 8 months ago

Missing underline

Image

eliselavy commented 8 months ago

here https://github.com/C2DH/jdh-notebook/tree/petit-chicago-author-date/examples/cite2c-citationmanager example with "style": "petit-chicago-author-date.csl"

The plugin in version 1.0.0 jupyterlab-citation-manager

[!WARNING]
By changing the style in the metadatas doesn't update the references - need to pass by the menu

eliselavy commented 8 months ago

Ok underline added by missing container-title in case URL how it was before:

NOW: Screenshot 2024-02-22 at 15 45 58

BEFORE:

Screenshot 2024-02-22 at 15 46 19

Ex: reference here https://github.com/C2DH/jdh-notebook/blob/master/examples/cite2c-citationmanager/citation_cit2c_migration.ipynb

   "7748027/CNCDVWQ5": {
      "URL": "https://www.slavevoyages.org/assessment/estimates",
      "container-title": "Slave Voyages",
      "id": "7748027/CNCDVWQ5",
      "issued": {
       "year": 2023
      },
eliselavy commented 8 months ago

year missing case 1 http://10.240.4.179/en/notebook-viewer/JTJGcHJveHktZ2l0aHVidXNlcmNvbnRlbnQlMkZDMkRIJTJGamRoLW5vdGVib29rJTJGbWFzdGVyJTJGZXhhbXBsZXMlMkZjaXRlMmMtY2l0YXRpb25tYW5hZ2VyJTJGY2l0YXRpb25fZnJvbV9jaXRhdGlvbl9tYW5hZ2VyLmlweW5i

eliselavy commented 8 months ago

In prod with v4.5.0