<commit_before>/**
 * This helper function gets the config object
 */
const getConfig = async () => {
  // get the YML config file with fetch:
  const fetchResult = await fetch("https://cdn.jsdelivr.net/gh/esri/esri.github.io@v2/src/data/projects.yml");
  const text = await fetchResult.text();
  // Use js-yaml (included in script tag) to parse the YAML into a JSON object
  // https://github.com/nodeca/js-yaml#load-string---options-
  const config = jsyaml.load(text);
  return config;
};

/**
 * This helper function creates a calcite "card" DOM element
 * given an object of details that the card should contain:
 */
const createCard = (cardInfo) => {
  const rootElement = document.createElement("calcite-card");
  rootElement.classList.add("basis-1/4");

  if (cardInfo.title) {
    const titleElement = document.createElement("span");
    titleElement.slot = "title";

    const link = document.createElement("calcite-link");
    link.innerHTML = cardInfo.title;
    link.href = cardInfo.link;

    titleElement.appendChild(link);
    rootElement.appendChild(titleElement);
  }
  if (cardInfo.content) {
    const contentElement = document.createElement("div");
    contentElement.innerHTML = cardInfo.content;

    if (cardInfo.link) {<commit_msg>load local copy of projects.xml<commit_after>/**
 * This helper function gets the config object
 */
const getConfig = async () => {
  // get the YML config file with fetch:
  const fetchResult = await fetch("./data/projects.yml");
  const text = await fetchResult.text();
  // Use js-yaml (included in script tag) to parse the YAML into a JSON object
  // https://github.com/nodeca/js-yaml#load-string---options-
  const config = jsyaml.load(text);
  return config;
};

/**
 * This helper function creates a calcite "card" DOM element
 * given an object of details that the card should contain:
 */
const createCard = (cardInfo) => {
  const rootElement = document.createElement("calcite-card");
  rootElement.classList.add("basis-1/4");

  if (cardInfo.title) {
    const titleElement = document.createElement("span");
    titleElement.slot = "title";

    const link = document.createElement("calcite-link");
    link.innerHTML = cardInfo.title;
    link.href = cardInfo.link;

    titleElement.appendChild(link);
    rootElement.appendChild(titleElement);
  }
  if (cardInfo.content) {
    const contentElement = document.createElement("div");
    contentElement.innerHTML = cardInfo.content;

    if (cardInfo.link) {
{'fraction_non_alphanumeric': 0.12918853451756157, 'fraction_numerical': 0.0020185708518368995, 'mean_word_length': 3.7745664739884393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '1281116', 'n_tokens_mistral': 729, 'n_tokens_neox': 713, 'n_words': 198}