thegetty / mummyportraits

“Mummy Portraits of Roman Egypt: Emerging Research from the APPEAR Project,” edited by Marie Svoboda and Caroline R. Cartwright
https://www.getty.edu/publications/mummyportraits/
0 stars 0 forks source link

Convert the bibliography and add the q-cite shortcodes #3

Closed geealbers closed 4 years ago

geealbers commented 4 years ago

Here are the instructions for adding the references. Let's go over it once together in person before you dive in.

  1. Convert the bibliography to markdown, and add it to the data/references.yml file, formatting it following the pattern of the examples already in there. Each reference needs a short and a full value and the short value must match exactly those used in the chapters. Once you’ve finished, it would be a good idea to run it through an online YAML validator.
  2. In each chapter, search for years by using Atom’s Regex (regular expressions) option and the string [0-9]{4}. This matches and instance where there are four ({4}) numerals between zero and nine ([0-9]) in a row.
  3. Look at each to determine if it is an author date reference, and if so, highlight the author and date with the cursor and type two curly brackets.
  4. Once you’ve gone through the whole manuscript, you can do a global find and replace (again using regex) to convert the references you’ve tagged to proper shortcodes (ie., changing {{Smith 2010}} to {{< q-cite "Smith 2010" >}}).

    Find:

    \{\{([^<].[^\}]+)?\}\}

    Replace with:

    {{< q-cite "$1" >}}

    This translates as:

    \{\{ = two opening curly brackets (the backslashes are just escape characters) [^<] = followed by anything BUT an angle bracket < .[^\}]+ = followed by one or more + of any kind of character . except a curly bracket ^\} \}\} = followed by two closing curly brackets

    $1 = Whatever text was found inside the regular parentheses in the search pattern \{\{([^<].[^\}]+)?\}\}

geealbers commented 4 years ago

Completed with 853d406