<commit_before>local yaml = require("yaml")

Pandoc = function (document)
  local versedata = yaml.loadpath(document.meta.versedatafile)

  document.blocks = pandoc.walk_block(pandoc.Div(document.blocks), {
      Note = function (element)
        return pandoc.walk_inline(element, {
            Link = function (element)
              local verse = element.content[1].text
              local versecontent = tostring(versedata[verse]):gsub("\n", "")
              return versecontent and { pandoc.Strong(element), pandoc.Space(), pandoc.Str(versecontent)} or element
            end
          })
      end
    })

  return pandoc.Doc(document.blocks, document.meta)
end
<commit_msg>Use link titles not text for full reference<commit_after>local yaml = require("yaml")

Pandoc = function (document)
  local versedata = yaml.loadpath(document.meta.versedatafile)

  document.meta.versedatafile = nil

  document.blocks = pandoc.walk_block(pandoc.Div(document.blocks), {
      Note = function (element)
        return pandoc.walk_inline(element, {
            Link = function (element)
              local verse = pandoc.pipe("./casile/bin/normalize_references.js", {}, element.title):gsub("^%s*(.-)%s*$", "%1")
              local versecontent = tostring(versedata[verse]):gsub("\n", "")
              return versecontent and { pandoc.Strong(element), pandoc.Space(), pandoc.Str(versecontent)} or element
            end
          })
      end
    })

  return pandoc.Doc(document.blocks, document.meta)
end

{'fraction_non_alphanumeric': 0.1267418712674187, 'fraction_numerical': 0.0013271400132714001, 'mean_word_length': 2.9270833333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '772889', 'n_tokens_mistral': 451, 'n_tokens_neox': 432, 'n_words': 89}