<commit_before>Mod.require 'Docscript.Parser', (Parser) ->
 code = document.getElementById 'code'
 main = document.getElementById 'main'
 sidebar = document.getElementById 'sidebar'

 parser = new Parser
  text: code.textContent
 parser.parse()
 parser.collectElements
  main: main
  sidebar: sidebar
 window.requestAnimationFrame ->
  parser.mediaLoaded ->
   parser.setFills()
   n = 0
   int = setInterval ->
    parser.setFills()
    n++
    if n is 10
     clearInterval int
   , 1000

document.addEventListener 'DOMContentLoaded', ->
 Mod.set 'Weya', Weya
 Mod.set 'Weya.Base', Weya.Base
<commit_msg>blog client rendering<commit_after>Mod.require 'Docscript.Parser', (Parser) ->
 process = (n, doc) ->
  code = doc.getElementsByClassName 'docscript-code'
  if code.length isnt 1
   throw new Error 'No code element'
  code = code[0]
  main = doc.getElementsByClassName 'docscript-main'
  if main.length isnt 1
   throw new Error 'No main element'
  main = main[0]
  sidebar = doc.getElementsByClassName 'docscript-sidebar'
  if sidebar.length isnt 1
   throw new Error 'No sidebar element'
  sidebar = sidebar[0]

  parser = new Parser
   text: code.textContent
   id: n * 10000
  parser.parse()
  parser.collectElements
   main: main
   sidebar: sidebar
  window.requestAnimationFrame ->
   parser.mediaLoaded ->
    parser.setFills()
    n = 0
    int = setInterval ->
     parser.setFills()
     n++
     if n is 10
      clearInterval int
    , 1000

 docs = document.getElementsByClassName 'docscript'
 for doc, i in docs
  process i, doc

document.addEventListener 'DOMContentLoaded', ->
 Mod.set 'Weya', Weya
 Mod.set 'Weya.Base', Weya.Base

{'fraction_non_alphanumeric': 0.1033857315598549, 'fraction_numerical': 0.015114873035066506, 'mean_word_length': 3.378306878306878, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '3996135', 'n_tokens_mistral': 550, 'n_tokens_neox': 508, 'n_words': 149}