PageSourceSearch

https://yani.ai/js/teaching.js

js yani.ai collected 2026-10-05 13:20:03 UTC 2,052 bytes, 42 lines download raw bytes

1"use strict";
2var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4    return new (P || (P = Promise))(function (resolve, reject) {
5        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8        step((generator = generator.apply(thisArg, _arguments || [])).next());
9    });
10};
11function loadTeaching() {
12    return __awaiter(this, void 0, void 0, function* () {
13        try {
14            const response = yield fetch('_data/teaching.yml');
15            if (!response.ok) {
16                throw new Error(`HTTP error! status: ${response.status}`);
17            }
18            const yamlText = yield response.text();
19            const courses = jsyaml.load(yamlText);
20            const teachingContainer = document.querySelector('#teaching .list-group');
21            if (!teachingContainer) {
22                console.error('Teaching container not found');
23                return;
24            }
25            teachingContainer.innerHTML = ''; // Clear existing courses
26            for (const course of courses) {
27                const courseElement = document.createElement('a');
28                courseElement.href = course.url;
29                courseElement.className = 'list-group-item list-group-item-action';
30                courseElement.innerHTML = `
31                <h5 class="mb-1">${course.title}</h5>
32                <p class="mb-1">${course.description}</p>
33            `;
34                teachingContainer.appendChild(courseElement);
35            }
36        }
37        catch (error) {
38            console.error('Failed to load teaching data:', error);
39        }
40    });
41}
42document.addEventListener('DOMContentLoaded', loadTeaching);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.