### Example llms.txt File for FastHTML Project
Source: https://llmstxt.org/
This snippet provides a cut-down example of an `llms.txt` file, specifically for the FastHTML project. It demonstrates the structure and content typically found in such files, including a project description, important notes about compatibility, and links to relevant documentation and examples.
```Text
# FastHTML
> FastHTML is a python library which brings together Starlette, Uvicorn, HTMX, and fastcore's `FT` "FastTags" into a library for creating server-rendered hypermedia applications.
Important notes:
- Although parts of its API are inspired by FastAPI, it is *not* compatible with FastAPI syntax and is not targeted at creating API services
- FastHTML is compatible with JS-native web components and any vanilla JS library, but not with React, Vue, or Svelte.
## Docs
- [FastHTML quick start](https://answerdotai.github.io/fasthtml/tutorials/quickstart_for_web_devs.html.md): A brief overview of many FastHTML features
- [HTMX reference](https://raw.githubusercontent.com/path/reference.md): Brief description of all HTMX attributes, CSS classes, headers, events, extensions, js lib methods, and config options
## Examples
- [Todo list application](https://raw.githubusercontent.com/path/adv_app.py): Detailed walk-thru of a complete CRUD app in FastHTML showing idiomatic use of FastHTML and HTMX patterns.
## Optional
- [Starlette full documentation](https://gist.githubusercontent.com/path/starlette-sml.md): A subset of the Starlette documentation useful for FastHTML development.
```
--------------------------------
### Install Cobalt JavaScript SDK
Source: https://gocobalt.github.io/cobalt-js
Commands to install the @cobaltio/cobalt-js SDK using popular package managers like npm and Yarn, adding it to your project's dependencies.
```bash
npm install @cobaltio/cobalt-js
```
```bash
yarn add @cobaltio/cobalt-js
```
--------------------------------
### Install Cobalt Javascript SDK with npm
Source: https://context7_llms
This snippet shows how to install the @cobaltio/cobalt-js package using the npm package manager. It's a standard command-line installation for Node.js projects.
```bash
npm install @cobaltio/cobalt-js
```
--------------------------------
### Install Cobalt JS SDK with npm
Source: https://gocobalt.github.io/cobalt-js/llms.txt
This snippet demonstrates how to install the @cobaltio/cobalt-js package using npm, a popular package manager for JavaScript. It adds the SDK to your project's dependencies.
```bash
npm install @cobaltio/cobalt-js
```
--------------------------------
### Install Cobalt Javascript SDK with yarn
Source: https://context7_llms
This snippet demonstrates how to install the @cobaltio/cobalt-js package using the yarn package manager. It provides an alternative to npm for dependency management.
```bash
yarn add @cobaltio/cobalt-js
```
--------------------------------
### Get All Applications in Cobalt.js
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Returns a list of all enabled and ecosystem applications available in Cobalt.
```APIDOC
getApps(): Promise
Returns: Promise - The list of applications.
```
--------------------------------
### Get Configurations for Application in Cobalt.js
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Returns a list of all configurations created for a specified application.
```APIDOC
getConfigs(slug: string): Promise
slug: The application slug.
Returns: Promise - The configs created for the specified application.
```
--------------------------------
### Install Cobalt JS SDK with Yarn
Source: https://gocobalt.github.io/cobalt-js/llms.txt
This snippet shows how to install the @cobaltio/cobalt-js package using Yarn, another widely used package manager for JavaScript. It adds the SDK to your project's dependencies.
```bash
yarn add @cobaltio/cobalt-js
```
--------------------------------
### llms.txt File Structure Example
Source: https://llmstxt.org/
Illustrates the required and optional sections of an `llms.txt` file, including the H1 project name, blockquote summary, optional details, and H2-delimited file lists with hyperlinks and optional notes. The 'Optional' section has a special meaning for context shortening, indicating content that can be skipped if a shorter context is needed.
```llms.txt Format
# Title
> Optional description goes here
Optional details go here
## Section name
- [Link title](https://link_url): Optional link details
## Optional
- [Link title](https://link_url)
```
--------------------------------
### Include Cobalt JS SDK in Browser via CDN
Source: https://gocobalt.github.io/cobalt-js
HTML script tags for including the Cobalt JavaScript SDK directly in a web browser using a CDN. Examples show how to specify exact versions, version ranges, or the latest version, along with a workaround for `exports` errors.
```html
```
--------------------------------
### Include Cobalt JS SDK in Node.js
Source: https://gocobalt.github.io/cobalt-js/llms.txt
This JavaScript snippet demonstrates how to import the Cobalt SDK in a Node.js environment. It shows examples for both ES Modules (import) and CommonJS (require) syntax.
```javascript
import { Cobalt } from "@cobaltio/cobalt-js";
// or, if you're using CommonJS
const { Cobalt } = require("@cobaltio/cobalt-js");
```
--------------------------------
### Get Application Details in Cobalt.js
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Retrieves details for a specified application or a list of all enabled applications. If a slug is provided, it returns details for that specific application; otherwise, it returns all enabled applications.
```APIDOC
getApp(): Promise
Returns: Promise - The list of enabled applications and their details.
getApp(slug: string): Promise
slug: The application slug.
Returns: Promise - The application details for the specified application, provided the application is enabled in Cobalt.
```
--------------------------------
### Include Cobalt Javascript SDK in Node.js
Source: https://context7_llms
This JavaScript snippet illustrates how to import the Cobalt SDK in a Node.js environment. It provides examples for both ES module `import` syntax and CommonJS `require` syntax, catering to different module systems.
```js
import { Cobalt } from "@cobaltio/cobalt-js";
// or, if you're using CommonJS
const { Cobalt } = require("@cobaltio/cobalt-js");
```
--------------------------------
### Get Configuration in Cobalt.js
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Retrieves a specific configuration for an application. It requires the application slug and can optionally take a config ID to fetch a particular configuration.
```APIDOC
getConfig(slug: string, configId?: string): Promise
slug: The application slug.
configId?: The unique ID of the config.
Returns: Promise - The specified config.
```
--------------------------------
### Get Workflows API Method
Source: https://context7_llms
Fetches a list of public workflows. This method can be used to retrieve all available workflows or filter them based on an optional payload of parameters.
```APIDOC
getWorkflows(params?: PublicWorkflowsPayload): Promise
Parameters:
params?: PublicWorkflowsPayload - Optional parameters for filtering workflows.
Returns: Promise
```
--------------------------------
### Get Field Options API Method
Source: https://context7_llms
Retrieves the available options for a specified field within an application. This method allows dynamic population of field choices based on the application slug, field ID, and optionally a workflow ID, and the selected value of a left-hand side (LHS) field.
```APIDOC
getFieldOptions(lhs: string, slug: string, fieldId: string, workflowId?: string): Promise
Parameters:
lhs: string - The selected value of the lhs field.
slug: string - The application slug.
fieldId: string - The unique ID of the field.
workflowId?: string - The unique ID of the workflow, if this is a workflow field.
Returns: Promise - The specified rule field's options.
```
--------------------------------
### Get Configuration Field in Cobalt.js
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Retrieves a specific field within a configuration. It requires the application slug and the field's unique ID. An optional workflow ID can be provided.
```APIDOC
getConfigField(slug: string, fieldId: string, workflowId?: string): Promise
slug: The application slug.
fieldId: The unique ID of the field.
workflowId?: The unique ID of the workflow.
Returns: Promise - The specified config field.
```
--------------------------------
### JavaScript GLightbox Initialization and Event Handlers
Source: https://llmstxt.org/
This snippet initializes the GLightbox library for creating image lightboxes with specific configurations. It also registers event listeners for `slide_before_load` to handle images with `data:` URIs by updating the slide's `href`, and `slide_after_load` to apply math typesetting using `window.Quarto.typesetMath` within the loaded slide content.
```javascript
var lightboxQuarto = GLightbox({"closeEffect":"zoom","descPosition":"bottom","loop":false,"openEffect":"zoom","selector":".lightbox"}); (function() { let previousOnload = window.onload; window.onload = () => { if (previousOnload) { previousOnload(); } lightboxQuarto.on('slide_before_load', (data) => { const { slideIndex, slideNode, slideConfig, player, trigger } = data; const href = trigger.getAttribute('href'); if (href !== null) { const imgEl = window.document.querySelector(`a\\[href=\"${href}\"\] img`); if (imgEl !== null) { const srcAttr = imgEl.getAttribute("src"); if (srcAttr && srcAttr.startsWith("data:")) { slideConfig.href = srcAttr; } } } }); lightboxQuarto.on('slide_after_load', (data) => { const { slideIndex, slideNode, slideConfig, player, trigger } = data; if (window.Quarto?.typesetMath) { window.Quarto.typesetMath(slideNode); } }); }; })();
```
--------------------------------
### Initialize AnchorJS and DOM Ready Handlers
Source: https://llmstxt.org/
Sets up event listeners for DOM content loaded, initializes AnchorJS for adding anchor links to headings, and defines helper functions for code copying and link handling within the main DOMContentLoaded callback.
```javascript
window.document.addEventListener("DOMContentLoaded", function (event) {
const icon = "";
const anchorJS = new window.AnchorJS();
anchorJS.options = {
placement: 'right',
icon: icon
};
anchorJS.add('.anchored');
const isCodeAnnotation = (el) => {
for (const clz of el.classList) {
if (clz.startsWith('code-annotation-')) {
return true;
}
}
return false;
}
const onCopySuccess = function(e) {
// button target
const button = e.trigger;
// don't keep focus
button.blur();
// flash "checked" button
button.classList.add('code-copy-button-checked');
var currentTitle = button.getAttribute("title");
button.setAttribute("title", "Copied!");
let tooltip;
if (window.bootstrap) {
button.setAttribute("data-bs-toggle", "tooltip");
button.setAttribute("data-bs-placement", "left");
button.setAttribute("data-bs-title", "Copied!");
tooltip = new bootstrap.Tooltip(button, {
trigger: "manual",
customClass: "code-copy-button-tooltip",
offset: [0, -8]
});
tooltip.show();
}
setTimeout(function() {
if (tooltip) {
tooltip.hide();
button.removeAttribute("data-bs-title");
button.removeAttribute("data-bs-toggle");
button.removeAttribute("data-bs-placement");
}
button.setAttribute("title", currentTitle);
button.classList.remove('code-copy-button-checked');
}, 1000);
// clear code selection
e.clearSelection();
}
const getTextToCopy = function(trigger) {
const codeEl = trigger.previousElementSibling.cloneNode(true);
for (const childEl of codeEl.children) {
if (isCodeAnnotation(childEl)) {
childEl.remove();
}
}
return codeEl.innerText;
}
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
text: getTextToCopy
});
clipboard.on('success', onCopySuccess);
if (window.document.getElementById('quarto-embedded-source-code-modal')) {
const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
text: getTextToCopy,
container: window.document.getElementById('quarto-embedded-source-code-modal')
});
clipboardModal.on('success', onCopySuccess);
}
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
var mailtoRegex = new RegExp(/^mailto:/);
var filterRegex = new RegExp("https:\/\/llmstxt\.org\/");
var isInternal = (href) => {
return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
}
// Inspect non-navigation links and adorn them if external
var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
for (var i=0; i {
// Strip column container classes
const stripColumnClz = (el) => {
el.classList.remove("page-full", "page-columns");
if (el.children) {
for (const child of el.children) {
stripColumnClz(child);
}
}
}
stripColumnClz(note)
if (id === null || id.startsWith('sec-')) {
// Special case sections, only their first couple elements
const container = document.createElement("div");
if (note.children && note.children.length > 2) {
container.appendChild(note.children[0].cloneNode(true));
for (let i = 1; i < note.children.length; i++) {
const child = note.children[i];
if (child.tagName === "P" && child.innerText === "") {
continue;
} else {
container.appendChild(child.cloneNode(true));
break;
}
}
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(container);
}
return container.innerHTML
} else {
if (window.Quarto?.typesetMath) {
window.Quarto.typesetMath(note);
}
return note.innerHTML;
}
} else {
// Remove any anchor links if they are present
const anchorLink = note.querySelector
```
--------------------------------
### Initialize Cobalt JS SDK Client
Source: https://gocobalt.github.io/cobalt-js
JavaScript code to initialize the Cobalt SDK client. It shows how to instantiate `Cobalt` with a session token and an optional custom base URL, or how to initialize without a token and set it later for flexible usage.
```javascript
// initialize with token
const cobalt = new Cobalt({
// the token you generate for linked accounts using the cobalt backend SDK
token: "COBALT_SESSION_TOKEN",
// OPTIONAL: set custom base url for all API requests. only useful if you are hosting Cobalt on premise.
baseUrl: "https://cobalt.example.com/backend"
});
// Or, initialize without token
const cobalt = new Cobalt();
// and you can set the token later.
cobalt.token = "COBALT_SESSION_TOKEN";
```
--------------------------------
### Initialize Cobalt JS SDK
Source: https://gocobalt.github.io/cobalt-js/llms.txt
This JavaScript snippet illustrates how to initialize the Cobalt SDK. It shows two methods: initializing with a session token and an optional custom base URL, or initializing without a token and setting it later.
```javascript
// initialize with token
const cobalt = new Cobalt({
// the token you generate for linked accounts using the cobalt backend SDK
token: "COBALT_SESSION_TOKEN",
// OPTIONAL: set custom base url for all API requests. only useful if you are hosting Cobalt on premise.
baseUrl: "https://cobalt.example.com/backend"
});
// Or, initialize without token
const cobalt = new Cobalt();
// and you can set the token later.
cobalt.token = "COBALT_SESSION_TOKEN";
```
--------------------------------
### Cobalt Class API Documentation
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Detailed API documentation for the `Cobalt` class, the main entry point for the Cobalt Frontend SDK. It includes information on its constructor, properties, and key methods for interacting with the Cobalt backend.
```APIDOC
Classes:
Cobalt:
Defined in: cobalt.ts:196
Constructors:
Constructor:
new Cobalt(options: CobaltOptions): Cobalt
Defined in: cobalt.ts:206
Description: Cobalt Frontend SDK
Parameters:
options: CobaltOptions - The options to configure the Cobalt SDK.
Returns: Cobalt
Properties:
token: public string - Defined in: cobalt.ts:198
Methods:
config(payload: ConfigPayload): Promise
Defined in: cobalt.ts:453
Description: Returns the specified config, or creates one if it doesn't exist.
Parameters:
payload: ConfigPayload - The payload object for config.
Returns: Promise - The specified config.
connect(slug: string, payload?: Record): Promise
Defined in: cobalt.ts:393
Description: Connect the specified application, optionally with the auth data that user provides.
Parameters:
slug: string - The application slug.
payload?: Record - The key value pairs of auth data.
Returns: Promise - Whether the connection was successful.
createEcosystemLead(payload: EcosystemLeadPayload): Promise
Defined in: cobalt.ts:565
Description: Create a lead for an ecosystem app.
Parameters:
payload: EcosystemLeadPayload - The payload object for the lead.
Returns: Promise
createWorkflow(params: PublicWorkflowPayload): Promise
Defined in: cobalt.ts:718
Description: Create a public workflow for the linked account.
Parameters:
params: PublicWorkflowPayload
Returns: Promise - The created public workflow.
```
--------------------------------
### Initial Page Load and Theme Script
Source: https://gocobalt.github.io/cobalt-js
This JavaScript snippet handles initial page display, preventing a flash of unstyled content, and sets the document theme based on local storage or OS preference. It ensures the page is hidden until the application is ready.
```javascript
document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";
document.body.style.display="none";
setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)
```
--------------------------------
### Initialize Cobalt Javascript SDK
Source: https://context7_llms
This JavaScript snippet demonstrates how to initialize the Cobalt SDK. It shows two methods: initializing with a session token directly, including an optional custom base URL, and initializing without a token to set it later.
```js
// initialize with token
const cobalt = new Cobalt({
// the token you generate for linked accounts using the cobalt backend SDK
token: "COBALT_SESSION_TOKEN",
// OPTIONAL: set custom base url for all API requests. only useful if you are hosting Cobalt on premise.
baseUrl: "https://cobalt.example.com/backend"
});
// Or, initialize without token
const cobalt = new Cobalt();
// and you can set the token later.
cobalt.token = "COBALT_SESSION_TOKEN";
```
--------------------------------
### API Interface: CobaltOptions
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Represents the options available for configuring the Cobalt client. This interface defines the structure for setting up the Cobalt SDK, although no specific properties are detailed in the provided snippet.
```APIDOC
interface CobaltOptions
```
--------------------------------
### Cobalt Class API Documentation
Source: https://context7_llms
Detailed API documentation for the `Cobalt` class, the main entry point for the Cobalt Frontend SDK. It includes information on its constructor, properties, and key methods for interacting with the Cobalt backend.
```APIDOC
Class: Cobalt
Defined in: cobalt.ts:196
Constructors:
Constructor: new Cobalt(options: CobaltOptions): Cobalt
Defined in: cobalt.ts:206
Description: Cobalt Frontend SDK
Parameters:
options: CobaltOptions - The options to configure the Cobalt SDK.
Returns: Cobalt
Properties:
token: public string
Defined in: cobalt.ts:198
Methods:
config(payload: ConfigPayload): Promise
Defined in: cobalt.ts:453
Description: Returns the specified config, or creates one if it doesn't exist.
Parameters:
payload: ConfigPayload - The payload object for config.
Returns: Promise - The specified config.
connect(slug: string, payload?: Record): Promise
Defined in: cobalt.ts:393
Description: Connect the specified application, optionally with the auth data that user provides.
Parameters:
slug: string - The application slug.
payload?: Record - The key value pairs of auth data.
Returns: Promise - Whether the connection was successful.
createEcosystemLead(payload: EcosystemLeadPayload): Promise
Defined in: cobalt.ts:565
Description: Create a lead for an ecosystem app.
Parameters:
payload: EcosystemLeadPayload - The payload object for the lead.
Returns: Promise
createWorkflow(params: PublicWorkflowPayload): Promise
Defined in: cobalt.ts:718
Description: Create a public workflow for the linked account.
Parameters:
params: PublicWorkflowPayload
Returns: Promise - The created public workflow.
```
--------------------------------
### API Method: getApps
Source: https://context7_llms
Returns a list of all enabled and ecosystem applications.
```APIDOC
getApps(): Promise
Returns: Promise - The list of applications.
```
--------------------------------
### API Method: getConfigs
Source: https://context7_llms
Returns all configurations created for a specified application. Requires the application slug.
```APIDOC
getConfigs(slug: string): Promise
slug: The application slug.
Returns: Promise
```
--------------------------------
### EcosystemLead Interface Properties
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Defines the properties for the `EcosystemLead` interface, representing a lead entity within the Cobalt ecosystem. It includes a unique identifier (`_id`), creation timestamp (`created_at`), email, and optional name and description.
```APIDOC
EcosystemLead:
_id: string
created_at: string
description?: string
email: string
name?: string
```
--------------------------------
### Include Cobalt JS SDK in Node.js
Source: https://gocobalt.github.io/cobalt-js
JavaScript code demonstrating how to import the Cobalt SDK in Node.js environments using both ES Modules (`import`) and CommonJS (`require`) syntax for module inclusion.
```javascript
import { Cobalt } from "@cobaltio/cobalt-js";
// or, if you're using CommonJS
const { Cobalt } = require("@cobaltio/cobalt-js");
```
--------------------------------
### API: EcosystemLeadPayload Interface Definition
Source: https://context7_llms
Defines the payload structure for creating or updating an Ecosystem Lead, including email, name, description, and a unique slug.
```APIDOC
EcosystemLeadPayload:
properties:
description?: string
email: string
name?: string
slug: string
```
--------------------------------
### EcosystemLeadPayload Interface Properties
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Defines the properties for the `EcosystemLeadPayload` interface, used for creating or updating `EcosystemLead` entities. It specifies a unique slug, email, and optional name and description for the payload.
```APIDOC
EcosystemLeadPayload:
description?: string
email: string
name?: string
slug: string
```
--------------------------------
### Core JavaScript Utilities for Document Interaction and Code Highlighting
Source: https://llmstxt.org/
This extensive JavaScript code block implements several key functionalities for a dynamic web page. It processes cross-references to fetch and display content in interactive tooltips, handles code annotations by dynamically highlighting specific lines, and includes a throttling mechanism for window resize events to ensure smooth performance. It interacts heavily with the DOM to manipulate elements and styles.
```JavaScript
('a.anchorjs-link'); if (anchorLink) { anchorLink.remove(); } if (window.Quarto?.typesetMath) { window.Quarto.typesetMath(note); } if (note.classList.contains("callout")) { return note.outerHTML; } else { return note.innerHTML; } } } for (var i=0; i res.text())
.then(html => { const parser = new DOMParser(); const htmlDoc = parser.parseFromString(html, "text/html"); const note = htmlDoc.getElementById(id); if (note !== null) { const html = processXRef(id, note); instance.setContent(html); } }).finally(() => { instance.enable(); instance.show(); }); } } else { // See if we can fetch a full url (with no hash to target)
// This is a special case and we should probably do some content thinning / targeting
fetch(url)
.then(res => res.text())
.then(html => { const parser = new DOMParser(); const htmlDoc = parser.parseFromString(html, "text/html"); const note = htmlDoc.querySelector('main.content'); if (note !== null) { // This should only happen for chapter cross references
// (since there is no id in the URL)
// remove the first header
if (note.children.length > 0 && note.children[0].tagName === "HEADER") { note.children[0].remove(); } const html = processXRef(null, note); instance.setContent(html); } }).finally(() => { instance.enable(); instance.show(); }); } }, function(instance) { }); } let selectedAnnoteEl; const selectorForAnnotation = ( cell, annotation) => { let cellAttr = 'data-code-cell="' + cell + '"'; let lineAttr = 'data-code-annotation="' + annotation + '"'; const selector = 'span[' + cellAttr + '][' + lineAttr + ']'; return selector; } const selectCodeLines = (annoteEl) => { const doc = window.document; const targetCell = annoteEl.getAttribute("data-target-cell"); const targetAnnotation = annoteEl.getAttribute("data-target-annotation"); const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation)); const lines = annoteSpan.getAttribute("data-code-lines").split(","); const lineIds = lines.map((line) => { return targetCell + "-" + line; })
let top = null; let height = null; let parent = null; if (lineIds.length > 0) { //compute the position of the single el (top and bottom and make a div)
const el = window.document.getElementById(lineIds[0]); top = el.offsetTop; height = el.offsetHeight; parent = el.parentElement.parentElement; if (lineIds.length > 1) { const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]); const bottom = lastEl.offsetTop + lastEl.offsetHeight; height = bottom - top; } if (top !== null && height !== null && parent !== null) { // cook up a div (if necessary) and position it
let div = window.document.getElementById("code-annotation-line-highlight"); if (div === null) { div = window.document.createElement("div"); div.setAttribute("id", "code-annotation-line-highlight"); div.style.position = 'absolute'; parent.appendChild(div); } div.style.top = top - 2 + "px"; div.style.height = height + 4 + "px"; div.style.left = 0; let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter"); if (gutterDiv === null) { gutterDiv = window.document.createElement("div"); gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter"); gutterDiv.style.position = 'absolute'; const codeCell = window.document.getElementById(targetCell); const gutter = codeCell.querySelector('.code-annotation-gutter'); gutter.appendChild(gutterDiv); } gutterDiv.style.top = top - 2 + "px"; gutterDiv.style.height = height + 4 + "px"; } selectedAnnoteEl = annoteEl; } }; const unselectCodeLines = () => { const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"]; elementsIds.forEach((elId) => { const div = window.document.getElementById(elId); if (div) { div.remove(); } }); selectedAnnoteEl = undefined; }; // Handle positioning of the toggle
window.addEventListener("resize", throttle(() => { elRect = undefined; if (selectedAnnoteEl) { selectCodeLines(selectedAnnoteEl); } }, 10) ); function throttle(fn, ms) { let throttle = false; let timer; return (...args) => { if(!throttle) { // first call gets through
fn.apply(this, args); throttle = true; } else { // all the others get throttled
if(timer) clearTimeout(timer); // cancel #2
timer = setTimeout(() => { fn.apply(this, args); timer = throttle = false; }, ms); } }; } // Attach click handler to the DT
const annoteDls = window.document.querySelectorAll(
```
--------------------------------
### ConfigPayload Interface Definition
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Specifies the data structure used as a payload for configuration-related operations. It includes the application slug, an optional unique configuration ID, and dynamic label mappings.
```APIDOC
ConfigPayload:
Description: The payload object for config.
config_id?: string
Description: Unique ID for the config.
labels?: Label[]
Description: The dynamic label mappings.
slug: string
Description: The application slug.
```
--------------------------------
### API: PluginConfigProperties Interface Definition
Source: https://context7_llms
Defines common configuration properties for a plugin or component, including its identifier, name, description, enabled status, and associated configuration fields.
```APIDOC
PluginConfigProperties:
properties:
description?: string
enabled: boolean
fields?: ConfigField[]
id: string
name: string
```
--------------------------------
### API Interface: Application
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Represents an application in Cobalt, detailing its properties such as authentication type, connection status, description, and various identifiers. This interface defines the structure for application objects, including fields for authentication input, connection status, and descriptive metadata.
```APIDOC
interface Application
Properties:
auth_input_map?: InputField[] - The fields required from the user to connect the application (for keybased auth type).
auth_type: "oauth2" | "keybased" - The type of auth used by application.
connected?: boolean - Whether the user has connected the application.
description: string - The application description.
icon: string - The application icon.
name: string - The application name.
reauth_required?: boolean - Whether the connection has expired and re-auth is required.
slug?: string - The application slug for custom apps.
type: string - The application slug for native apps.
```
--------------------------------
### JSON Configuration for Website Navbar Search
Source: https://llmstxt.org/
This JSON object specifies configuration parameters for a website's navigation bar, primarily focusing on search functionality. It includes settings for the search bar's location, copy button visibility, collapse behavior, and defines a comprehensive set of localized text strings for various search UI elements, such as 'No results' and 'Clear' button titles.
```JSON
{ "location": "navbar", "copy-button": false, "collapse-after": 3, "panel-placement": "end", "type": "overlay", "limit": 50, "keyboard-shortcut": [ "f", "/", "s" ], "show-item-context": false, "language": { "search-no-results-text": "No results", "search-matching-documents-text": "matching documents", "search-copy-link-title": "Copy link to search", "search-hide-matches-text": "Hide additional matches", "search-more-match-text": "more match in this document", "search-more-matches-text": "more matches in this document", "search-clear-button-title": "Clear", "search-text-placeholder": "", "search-detached-cancel-button-title": "Cancel", "search-submit-button-title": "Submit", "search-label": "Search" } }
```
--------------------------------
### Include Cobalt Javascript SDK in Browser
Source: https://context7_llms
This HTML snippet demonstrates various ways to include the Cobalt Javascript SDK in a web browser using CDN links. It shows options for specific versions, version ranges, and the latest version, along with a workaround for `exports` not defined errors.
```html
```
--------------------------------
### Include Cobalt JS SDK in Browser
Source: https://gocobalt.github.io/cobalt-js/llms.txt
This HTML snippet shows various ways to include the Cobalt JavaScript SDK in a web browser using a CDN. It provides options for using a specific version, a version range, or the latest version (not recommended for production).
```html
```
--------------------------------
### Config Interface Definition
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Describes the structure of the `Config` object, which encapsulates various aspects of application configuration, including fields, potential errors, and associated workflows.
```APIDOC
Config:
config_id?: string
field_errors?: object[]
fields?: ConfigField[]
slug: string
workflows?: ConfigWorkflow[]
```
--------------------------------
### API: EcosystemLead Interface Definition
Source: https://context7_llms
Defines the structure for an Ecosystem Lead entity, including unique identifier, creation timestamp, and contact details.
```APIDOC
EcosystemLead:
properties:
_id: string
created_at: string
description?: string
email: string
name?: string
```
--------------------------------
### Cobalt API Client Properties
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Defines the core properties for configuring the Cobalt API client, including the base URL and session token. These properties are typically set during client initialization.
```APIDOC
baseUrl?: string
Description: The base URL of the Cobalt API. You don't need to set this.
token?: string
Description: The session token.
```
--------------------------------
### API Method: getConfig
Source: https://context7_llms
Retrieves a specified configuration. Requires the application slug and optionally the configuration ID.
```APIDOC
getConfig(slug: string, configId?: string): Promise
slug: The application slug.
configId: The unique ID of the config.
Returns: Promise - The specified config.
```
--------------------------------
### Configuration Object Properties
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Defines a set of properties commonly used for configuration objects within the Cobalt.js library. These properties include an identifier, name, optional description, enabled status, and an array of configuration fields.
```APIDOC
Configuration Object:
id: string
name: string
description?: string
enabled: boolean
fields?: ConfigField[]
```
--------------------------------
### CobaltOptions Interface Definition
Source: https://context7_llms
Defines the options available for configuring Cobalt. This interface is typically used when initializing or setting up the Cobalt client.
```APIDOC
interface CobaltOptions {
// No properties listed in the provided text.
}
```
--------------------------------
### API Method: getApp
Source: https://context7_llms
Retrieves details for a specific application or a list of all enabled applications. Can be called with or without an application slug.
```APIDOC
getApp(): Promise
Returns: Promise - The list of enabled applications and their details.
```
```APIDOC
getApp(slug: string): Promise
slug: The application slug.
Returns: Promise - The application details.
```
--------------------------------
### API Interface: ConfigPayload
Source: https://context7_llms
Describes the payload object used for sending configuration data to the Cobalt API. It includes the application slug, an optional unique ID for the config, and dynamic label mappings.
```APIDOC
interface ConfigPayload {
config_id?: string - Unique ID for the config.
labels?: Label[] - The dynamic label mappings.
slug: string - The application slug.
}
```
--------------------------------
### Define RuleOptions Properties
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Defines the configuration options for a rule, encompassing conditional code output, error handling details, and the structure for defining rule column operations. This includes specifying operators, their types, and right-hand side values.
```APIDOC
RuleOptions:
conditional_code_stdout?: string[]
error?: object
error.message?: string
error.stack?: string
rule_column: object
rule_column.operator: object
rule_column.operator.name: string
rule_column.operator.options: Label[]
rule_column.operator.type: "select"
rule_column.rhs: object
rule_column.rhs.name: string
rule_column.rhs.options?: Label[]
rule_column.rhs.type: "text" | "select"
```
--------------------------------
### API Interface: ConfigWorkflow
Source: https://context7_llms
Represents a configuration workflow. The provided text defines the interface name but does not detail its specific properties.
```APIDOC
interface ConfigWorkflow {}
```
--------------------------------
### Define PublicWorkflowsPayload Properties
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Describes the payload structure for querying public workflows. This type extends `PaginationProps`, allowing for pagination parameters like limit and page, and includes an optional application slug for filtering.
```APIDOC
PublicWorkflowsPayload:
Extends: PaginationProps
Properties:
limit?: number (Inherited from PaginationProps.limit)
page?: number (Inherited from PaginationProps.page)
slug?: string
```
--------------------------------
### API Properties for Cobalt Client Configuration
Source: https://context7_llms
Describes the base properties available for configuring the Cobalt API client, including the API base URL and the session token. These properties are typically set during client initialization.
```APIDOC
Properties:
baseUrl?: string - The base URL of the Cobalt API. You don't need to set this.
token?: string - The session token.
```
--------------------------------
### APIDOC: UpdateConfigPayload Interface Definition
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Defines the structure for updating application configuration. This payload includes a unique configuration ID, the application slug, a map of application-specific fields, and an array of associated workflow payloads. It is used to manage and modify application settings.
```APIDOC
UpdateConfigPayload:
description: The configuration data for an application.
properties:
slug:
type: string
description: The application slug
config_id?:
type: string
description: Unique ID for the config.
fields:
type: Record
description: A map of application fields and their values.
workflows:
type: WorkflowPayload[]
description: The config workflows data.
```
--------------------------------
### CSS Styling for Document Layout and Code Highlighting
Source: https://llmstxt.org/
This CSS block provides styling rules for various document elements, including layout for columns, indents, and task lists. It also defines extensive styles for `sourceCode` blocks, ensuring proper display, line numbering, and responsive behavior across different media, enhancing the readability and presentation of code snippets within the document.
```CSS
code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} div.columns{display: flex; gap: min(4vw, 1.5em);} div.column{flex: auto; overflow-x: auto;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} ul.task-list li input\[type="checkbox"\] { width: 0.8em; margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ vertical-align: middle; } /* CSS for syntax highlighting */ html { -webkit-text-size-adjust: 100%; } pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; } pre.numberSource { margin-left: 3em; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } }
```
--------------------------------
### API Method: updateConfig
Source: https://gocobalt.github.io/cobalt-js/llms.txt
Updates an existing configuration. This method requires an UpdateConfigPayload object containing the necessary data for the update, such as the configuration's identifier and the new values. It returns a Promise that resolves to the updated Config object.
```APIDOC
updateConfig(payload: UpdateConfigPayload): Promise
Parameters:
payload: UpdateConfigPayload - The update payload.
Returns:
Promise - The specified config.
```