Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 2.66 KB

README-references.md

File metadata and controls

33 lines (24 loc) · 2.66 KB

How to update references

references.md

Before doing updates to the references, you should know the following:

  • references.md currently follows the citation style from the Distributed Computing- journal.
  • The citations are numbered, and therefore the references must be in specific order. Currently, the references are sorted by title, in ascending alphabetical order.
  • In references.md, there are also anchor elements with a unique id for each source, so that we can have citations as intra-document links. Currently, the unique ids are MD5-hashes from the title of the source to make it agnostic to ordering (see the scripts below how to generate them).

We've used Zotero for bibliography management. The ambients.rdf-file contains the bibliography in native Zotero format.

If there is any wrong information, bad formatting etc in references, always make the changes to Zotero first and then commit the autogenerated 11-references.md-file.

  1. Update the reference in the Zotero collection

  2. Generate a bibliography from the collection, with HTTP-links and using "Distributed Computing"-style (download it from settings if you don't have one already)

  3. Copy the bibliography to clipboard and save to a file 11-references.md

  4. Run following commands (works in Linux but unfortunately not in MacOS, see known issues):

    sed -i -r 's_^([0-9])\._0\1._g' 11-references.md
    while read -r line; do printf "$line "; printf "%s\n" "${line:4}" | md5sum | grep -oP '^.{6}'; done < 11-references.md | sed -E 's_^(.+) ([0-9a-z]{6})$_\1 <span id="\2"></span>_g' > 11-references.md.temp && mv 11-references.md.temp 11-references.md
    sed -i -r 's_^0([0-9])\._\1._g' 11-references.md
    sed -i '1s/^/# IX. References {references}\n\n/' 11-references.md
    grep -P "^[0-9].+" 11-references.md | sed -r 's_^([0-9]+).+span id="([a-f0-9]{6})".+_s/\\[[0-9]+\\]\\(#\2\\)/[\1](#\2)/g_g' | sort | uniq > fix_citations.txt && while read -r line; do sed -i -r "$line" *.md; done < fix_citations.txt && rm fix_citations.txt
    

    for 1) prefixing the numbered items with zero 2) inserting spans after every reference with order-agnostic md5-hash as anchor link id 3) removing the zero-prefixes 4) reinserting the header 5) replacing every citation in the paper with the new order-number

  5. Export the changed Zotero collection as new ambients.rdf-file.

Known issues

  • Commands for citation update do not work in MacOS.
  • Citation updates should be part of the tools, not separate commands to run