<commit_before>local pairs, tcon, rawset, date = pairs, table.concat, rawset, os.date
local base, lfs = base, lfs
local str_replace, is_file = seawolf.text.str_replace, seawolf.fs.is_file

function page_set_title(header_title, title)
  if header_title then
    if title == nil then title = header_title end
    ophal.title = title
    ophal.header_title = (header_title and header_title .. ' | ' or '') .. settings.site.name
  else
    ophal.header_title = settings.site.name
  end
end

do
  local javascript = {}
  local order = {}
  add_js = {}

  setmetatable(add_js, {
    __call = function(t, options)
      if options == nil then
        options = {}
      elseif type(options) == 'string' then
        options = {data = options}
      elseif type(options) == 'table' then
        options.data = options[1]
        options[1] = nil
      end

      local data = options.data
      options.data = nil

      local scope = options.scope and options.scope or 'header'

      if javascript[scope] == nil then javascript[scope] = {} end
      if order[scope] == nil then order[scope] = {} end

      if data ~= nil then
        javascript[scope][data] = options
        order[scope][#order[scope] + 1] = data
      end
    end
  })


  function init_js()
    for _, v in pairs(theme.settings.js) do
      add_js(v)
    end
  end

  function get_js()
    local output = {}

    for scope, v in pairs(order) do
      output[scope] = {}
      for _, j in pairs(v) do
        local options = javascript[scope][j]
        if options ~= nil and options.type == 'inline' then
          output[scope][#output[scope] + 1] = ([[<script type="text/javascript">%s</script>
]]):format(options.content or '')
        elseif is_file(j) then
          output[scope][#output[scope] + 1] = ([[<script type="text/javascript" src="%s%s?%s"></script>
]]):format(base.route, j, lfs.attributes(j, 'modification'))
        end
      end
      output[scope] = tcon(output[scope])
    end
    return output
  end
end

function add_css() end
<commit_msg>#8: Remove undocumented param 'content' from function add_js()<commit_after>local pairs, tcon, rawset, date = pairs, table.concat, rawset, os.date
local base, lfs = base, lfs
local str_replace, is_file = seawolf.text.str_replace, seawolf.fs.is_file

function page_set_title(header_title, title)
  if header_title then
    if title == nil then title = header_title end
    ophal.title = title
    ophal.header_title = (header_title and header_title .. ' | ' or '') .. settings.site.name
  else
    ophal.header_title = settings.site.name
  end
end

do
  local javascript = {}
  local order = {}
  add_js = {}

  setmetatable(add_js, {
    __call = function(t, options)
      if options == nil then
        options = {}
      elseif type(options) == 'string' then
        options = {data = options}
      elseif type(options) == 'table' then
        options.data = options[1]
        options[1] = nil
      end

      local data = options.data
      options.data = nil

      local scope = options.scope and options.scope or 'header'

      if javascript[scope] == nil then javascript[scope] = {} end
      if order[scope] == nil then order[scope] = {} end

      if data ~= nil then
        javascript[scope][data] = options
        order[scope][#order[scope] + 1] = data
      end
    end
  })


  function init_js()
    for _, v in pairs(theme.settings.js) do
      add_js(v)
    end
  end

  function get_js()
    local output = {}

    for scope, v in pairs(order) do
      output[scope] = {}
      for _, j in pairs(v) do
        local options = javascript[scope][j]
        if options ~= nil and options.type == 'inline' then
          output[scope][#output[scope] + 1] = ([[<script type="text/javascript">
%s
</script>
]]):format(j or '')
        elseif is_file(j) then
          output[scope][#output[scope] + 1] = ([[<script type="text/javascript" src="%s%s?%s"></script>
]]):format(base.route, j, lfs.attributes(j, 'modification'))
        end
      end
      output[scope] = tcon(output[scope])
    end
    return output
  end
end

function add_css() end

{'fraction_non_alphanumeric': 0.12826777424871733, 'fraction_numerical': 0.0026875152699731247, 'mean_word_length': 2.698283649503162, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2534271', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1296, 'n_words': 363}