Introduction
This guide provides a comprehensive overview of the assets and utilities available in the /resources directory. It covers usage patterns, best practices, and reference examples to help you integrate these resources efficiently.
Getting Started
To include a resource, reference its relative path from your HTML or CSS files. Example:
<link rel="stylesheet" href="styles/main.css">
<script src="scripts/util.js"></script>
All resources are organized into subfolders such as css, js, images, and docs.
API Overview
The JavaScript utilities expose the following global functions:
fetchJSON(url)– Retrieves JSON data viafetchwith error handling.debounce(func, wait)– Returns a debounced version offunc.formatDate(date, locale)– Formats aDateobject according to locale.
Example usage:
import { fetchJSON } from '../js/api.js';
fetchJSON('/api/data')
.then(data => console.log(data))
.catch(err => console.error(err));
Examples
Below is a live snippet demonstrating how to load a Markdown file from the docs folder and render it as HTML.
fetch('/resources/docs/intro.md')
.then(r => r.text())
.then(md => {
const html = marked.parse(md);
document.getElementById('demo').innerHTML = html;
});
FAQ
- Q: Where should I place custom assets?
A: Create a subdirectory inside/resources(e.g.,/resources/custom/) and update paths accordingly. - Q: How do I contribute updates?
A: Fork the repository, commit changes, and open a pull request following the contribution guidelines.