This is a new endeavor for Caltech Library. Our practices are
-evolving as we develop this project. You should expected periodically
-make course corrections. The following documentation will highlight our
-approaches and techniques to solving the challenges of developing a web
-component library for libraries, archives and museums.
New web components should be placed in the src
-directory. This is so they can be bundled into the complete
-cl-web-components.js. It also allows us to leverage other
-JavaScript or type script packages hosted at jsr.io. Bundled versions of the components are
-presented in the root repository along side the mod.js
-file.
-
Updating existing web
-components
-
If you need to update an existing web components you should do so in
-the src directory. If you “fix” the one in the root
-directory it’ll get overwritten the next time the bundler is run.
The CL-web-components repository provide web components for Library,
-Archive and Museum related projects implemented at Caltech Library. They
-are available for import from https://caltechlibrary.github.io/CL-web-components using
-the following import statement, `import * as clwc from
-“https://caltechlibrary.github.io/CL-web-compents/mod.js”.
-
It recommended that you download the Zip file containing the
-individual components as well as the bundled components from https://github.com/caltechlibrary/CL-web-components/releases.
-Each component is bundled individually as well as all together in the
-file cl-web-components.js.
-
The zip files are provided for each release. They include the release
-number in the filename. The combined bundle includes the version,
-releaseDate, releaseHash and licenseText in the bundle.
-
Here’s an example of getting the v0.0.11
-cl-web-components.js combined bundled from the release on
-macOS or Linux.
Installing an unsigned executable on Windows can also pose security
-risks, as Windows has built-in mechanisms to protect users from
-potentially harmful software. Here’s a general guide on how to do
-it:
-
Steps to
-Install an Unsigned Executable on Windows
-
-
Download the Executable: Download the unsigned
-executable file you want to install from a trusted source.
-
Locate the File: Use File Explorer to locate the
-downloaded file, which is often in the Downloads folder
-unless you specified a different location.
-
Attempt to Open the File: Double-click the file
-to open it. Windows may show a warning that the file is not commonly
-downloaded and could harm your computer.
-
Override Security Settings:
-
-
Option 1: Run Anyway
-
-
When you see the warning, click on More info in the
-dialog box.
-
A new option will appear to Run anyway. Click this to
-proceed with the installation.
-
-
Option 2: Disable Windows Defender SmartScreen
-(Temporarily)
-
Under Check apps and files, select Off.
-This will disable SmartScreen temporarily.
-
Try running the executable again.
-
Remember to turn SmartScreen back on after installation for
-continued protection.
-
-
-
Use Command Prompt (Advanced Users): If the
-above methods don’t work, you can use the Command Prompt to run the
-executable directly:
-
-
Open Command Prompt as an administrator.
-
Navigate to the directory where the file is located using the
-cd command.
-
Run the file by typing its name and pressing Enter.
-
-
-
Important Considerations
-
-
Security Risks: Running unsigned executables can
-expose your system to malware and other security risks. Only proceed if
-you trust the source of the software.
-
User Account Control (UAC): UAC might prompt you
-for permission to run the executable. Ensure you have administrative
-rights to proceed.
-
Antivirus Software: Your antivirus software might
-also block unsigned executables. You may need to temporarily disable it
-or add an exception for the file.
-
-
If you’re unsure about any of these steps or the safety of the file,
-it’s best to consult with someone who has more experience with Windows
-or to contact the software developer for support.
-
-
-
-
diff --git a/INSTALL_NOTES_Windows.md b/INSTALL_NOTES_Windows.md
deleted file mode 100644
index 159ce8a..0000000
--- a/INSTALL_NOTES_Windows.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-Installing an unsigned executable on Windows can also pose security risks, as Windows has built-in mechanisms to protect users from potentially harmful software. Here's a general guide on how to do it:
-
-### Steps to Install an Unsigned Executable on Windows
-
-1. **Download the Executable**: Download the unsigned executable file you want to install from a trusted source.
-
-2. **Locate the File**: Use File Explorer to locate the downloaded file, which is often in the `Downloads` folder unless you specified a different location.
-
-3. **Attempt to Open the File**: Double-click the file to open it. Windows may show a warning that the file is not commonly downloaded and could harm your computer.
-
-4. **Override Security Settings**:
- - **Option 1: Run Anyway**
- - When you see the warning, click on `More info` in the dialog box.
- - A new option will appear to `Run anyway`. Click this to proceed with the installation.
-
- - **Option 2: Disable Windows Defender SmartScreen (Temporarily)**
- - Open the Start menu and go to `Settings`.
- - Navigate to `Update & Security` > `Windows Security` > `App & browser control`.
- - Under `Check apps and files`, select `Off`. This will disable SmartScreen temporarily.
- - Try running the executable again.
- - Remember to turn SmartScreen back on after installation for continued protection.
-
-5. **Use Command Prompt (Advanced Users)**: If the above methods don't work, you can use the Command Prompt to run the executable directly:
- - Open Command Prompt as an administrator.
- - Navigate to the directory where the file is located using the `cd` command.
- - Run the file by typing its name and pressing Enter.
-
-### Important Considerations
-
-- **Security Risks**: Running unsigned executables can expose your system to malware and other security risks. Only proceed if you trust the source of the software.
-- **User Account Control (UAC)**: UAC might prompt you for permission to run the executable. Ensure you have administrative rights to proceed.
-- **Antivirus Software**: Your antivirus software might also block unsigned executables. You may need to temporarily disable it or add an exception for the file.
-
-If you're unsure about any of these steps or the safety of the file, it's best to consult with someone who has more experience with Windows or to contact the software developer for support.
\ No newline at end of file
diff --git a/INSTALL_NOTES_macOS.html b/INSTALL_NOTES_macOS.html
deleted file mode 100644
index 5cdcace..0000000
--- a/INSTALL_NOTES_macOS.html
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
-
-
-
-skip to main content
-
-
-
Installing an unsigned executable on macOS can be a bit tricky due to
-macOS’s security features designed to protect users from potentially
-harmful software. Here’s a general guide on how to do it:
-
-
Download the Executable: First, download the
-unsigned executable file you want to install.
-
Locate the File: Use Finder to locate the
-downloaded file. It’s often in the Downloads folder unless
-you specified a different location.
-
Attempt to Open the File: Double-click the file
-to open it. macOS will likely show a warning that the file cannot be
-opened because it is from an unidentified developer.
-
Override Security Settings:
-
-
Option 1: Open via Context Menu
-
-
Right-click (or Control-click) the file.
-
Select Open from the context menu.
-
You’ll see another warning, but this time there will be an option to
-Open the file anyway. Click Open.
-
-
Option 2: Allow Apps from Anywhere (Temporarily)
-
-
Open System Preferences and go to
-Security & Privacy.
-
Click the lock icon in the bottom left corner and enter your
-password to make changes.
-
Under the General tab, you might see a message about
-the app being blocked. Click Open Anyway.
-
If you don’t see this option, you can temporarily change the setting
-to allow apps downloaded from Anywhere. However, this
-option is not available in the latest versions of macOS by default. You
-may need to use the Terminal to do this:
-
-
Open Terminal and type:
-sudo spctl --master-disable
-
Press Enter and provide your password.
-
This will allow you to run apps from anywhere, but it’s recommended
-to re-enable security by typing sudo spctl --master-enable
-after installing your app.
-
-
-
-
Use Terminal (Advanced Users): If the above
-methods don’t work, you can use the Terminal to run the executable
-directly:
-
-
Open Terminal.
-
Navigate to the directory where the file is located using the
-cd command.
-
Make the file executable by typing:
-chmod +x filename
-
Run the file by typing: ./filename
-
-
Check for Updates: Sometimes, developers will
-sign their apps later. Check if there’s a signed version available to
-avoid these steps in the future.
-
-
Important Considerations
-
-
Security Risks: Running unsigned executables can
-expose your system to malware and other security risks. Only proceed if
-you trust the source of the software.
-
System Integrity Protection (SIP): Some steps might
-be restricted by SIP, which is designed to protect your system.
-Disabling SIP is not recommended unless absolutely necessary.
-
-
If you’re unsure about any of these steps or the safety of the file,
-it’s best to consult with someone who has more experience with macOS or
-to contact the software developer for support.
-
-
-
-
diff --git a/INSTALL_NOTES_macOS.md b/INSTALL_NOTES_macOS.md
deleted file mode 100644
index 46ba6f1..0000000
--- a/INSTALL_NOTES_macOS.md
+++ /dev/null
@@ -1,38 +0,0 @@
-
-Installing an unsigned executable on macOS can be a bit tricky due to macOS's security features designed to protect users from potentially harmful software. Here's a general guide on how to do it:
-
-1. **Download the Executable**: First, download the unsigned executable file you want to install.
-
-2. **Locate the File**: Use Finder to locate the downloaded file. It's often in the `Downloads` folder unless you specified a different location.
-
-3. **Attempt to Open the File**: Double-click the file to open it. macOS will likely show a warning that the file cannot be opened because it is from an unidentified developer.
-
-4. **Override Security Settings**:
- - **Option 1: Open via Context Menu**
- - Right-click (or Control-click) the file.
- - Select `Open` from the context menu.
- - You'll see another warning, but this time there will be an option to `Open` the file anyway. Click `Open`.
-
- - **Option 2: Allow Apps from Anywhere (Temporarily)**
- - Open `System Preferences` and go to `Security & Privacy`.
- - Click the lock icon in the bottom left corner and enter your password to make changes.
- - Under the `General` tab, you might see a message about the app being blocked. Click `Open Anyway`.
- - If you don't see this option, you can temporarily change the setting to allow apps downloaded from `Anywhere`. However, this option is not available in the latest versions of macOS by default. You may need to use the Terminal to do this:
- - Open Terminal and type: `sudo spctl --master-disable`
- - Press Enter and provide your password.
- - This will allow you to run apps from anywhere, but it's recommended to re-enable security by typing `sudo spctl --master-enable` after installing your app.
-
-5. **Use Terminal (Advanced Users)**: If the above methods don't work, you can use the Terminal to run the executable directly:
- - Open Terminal.
- - Navigate to the directory where the file is located using the `cd` command.
- - Make the file executable by typing: `chmod +x filename`
- - Run the file by typing: `./filename`
-
-6. **Check for Updates**: Sometimes, developers will sign their apps later. Check if there's a signed version available to avoid these steps in the future.
-
-### Important Considerations
-
-- **Security Risks**: Running unsigned executables can expose your system to malware and other security risks. Only proceed if you trust the source of the software.
-- **System Integrity Protection (SIP)**: Some steps might be restricted by SIP, which is designed to protect your system. Disabling SIP is not recommended unless absolutely necessary.
-
-If you're unsure about any of these steps or the safety of the file, it's best to consult with someone who has more experience with macOS or to contact the software developer for support.
diff --git a/about.html b/about.html
deleted file mode 100644
index e115a8b..0000000
--- a/about.html
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
-
-
-
-skip to main content
-
-
-
About this software
-
CL-web-components 0.0.16
-
This release adds a new <card-layout> component
-for displaying three-card layouts with images, titles, descriptions, and
-links. The component is responsive and uses attributes to set the
-content values.
CL-web-components provides a collection of Web Components used by
-Caltech Library across sites and projects.
-
The following are the components currently provided.
-
-
`footer-global`
-
-This component provides a standard footer with detailed information
-about the library
-
-
`footer-global-lite`
-
-This component provides a lighter weight version of the `footer-global`
-component
-
-
`ul-a-to-z`
-
-This component takes an innerHTML containing a UL list. The UL list is
-then turned into an A to Z navigatable UL List. If JavaScript is
-unavailable then the innerHTML UL remains as a fallback.
-
-
`textarea-csv`
-
-This is a textarea like component who's innerHTML content is CSV data.
-The component will display this as an editable table.
-
-
`textarea-agent-list`
-
-This element wraps a textarea containing a list of agents expressed as
-JSON.
-
-
`table-sortable`
-
-This is a component that takes an innerHTML containing table. It makes
-the table sortable by the column headings and provides a filter input
-that lets you enter text to filter by and pick a column to filter on.
-
-
-
-
-
\ No newline at end of file
diff --git a/building_web_components_with_deno.html b/building_web_components_with_deno.html
deleted file mode 100644
index b17939b..0000000
--- a/building_web_components_with_deno.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
-
-
-
-skip to main content
-
-
-
Building Web Components with
-Deno
-
Web components run in the browser as JavaScript. Generally speaking
-their built as independent modules. There is a growing library of
-standard modules at https://jsr.io. The standard modules work in Deno as
-well as the browser. This includes useful libraries like
-@std/csv, @std/path and
-@std/yaml. The referencing an import of these by full URLs
-is not ideal. It makes much more sense to take advantage Deno which
-provides additional functionality like check, lint, fmt and bundle. The
-last item is important for web components. With bundle we can generate a
-a web component including it’s dependent modules. This gives us much
-more reliability in deployments and flexibility of moving code between
-browser and server.
-
Un-bundled sources
-
If you are working on a web component the un-bundled source should be
-placed in the src/ directory. This allows you to include
-remote and local modules easily. The build process maintains the
-version.js module which includes the versioning of this
-repository as well as license text.
-
Current the following component(s) require bundling
-due to external dependencies.
You can build local bundles and test versions using the following
-Deno task command.
-
deno task build
-
Building CL-web-components
-
The process to build a release is a little more complex than is
-convenient for a Deno task. If your are on macOS or Linux you can use
-GNU Make to run the Makefile.
-
make build
-make website
-web release
-
On Windows you can use the related PowerShell scripts that replace
-make. Example,
The “release” option makes the zip files needed for a GitHub release.
-If you are on macOS or Linux you can run the ./replace.bash
-script to perform those chores if you have gh
-installed.
-
NOTE: The bundled JavaScript files are in the root directory. The
-source are in the src directory. If you need to fix
-something, add something, etc. It should go in the src/
-directory. You may need to either add or edit the tasks in
-deno.json, Makefile or
-make.ps1.
The vertical layout displays cards stacked on top of each other, with
-each card showing the image on the left and the title, description, and
-link on the right. This is useful for listing items or displaying
-priority content.
-
Adding Images
-
Add images to each card using the card[1-3]-image
-attributes. Images are automatically scaled and cropped to fit the card
-layout, so you don’t need exact dimensions.
-
Image sizing notes: - Images are scaled using
-object-fit: cover, which crops to fit while maintaining
-aspect ratio - For horizontal layout, use images at least 400px wide -
-For vertical layout, images display at 120px × 100px, so 200px+ wide
-works well - Landscape orientation recommended; keep important content
-centered as edges may be cropped
-
<card-layout
- card1-image="https://example.com/image1.jpg"
- card1-title="Digital Collections"
- card1-description="Browse digitized rare books, photographs, and manuscripts."
- card1-link="https://library.caltech.edu/archives/collections"
-
- card2-image="https://example.com/image2.jpg"
- card2-title="Workshops & Events"
- card2-description="Join us for research skills workshops and special events."
- card2-link="https://library.caltech.edu/events"
-
- card3-image="https://example.com/image3.jpg"
- card3-title="Course Reserves"
- card3-description="Access textbooks and materials for your courses."
- card3-link="https://library.caltech.edu/borrow/reserves"
-></card-layout>
-
Image Alt Text
-
For accessibility, you can provide custom alt text for each image
-using card[1-3]-alt. If not specified, the card title is
-used as the alt text.
-
<card-layout
- card1-image="https://example.com/library-interior.jpg"
- card1-alt="Students studying at tables in the Sherman Fairchild Library reading room"
- card1-title="Study Spaces"
- card1-description="Find quiet study areas and group collaboration rooms."
- card1-link="/spaces"
-
- card2-image="https://example.com/archives-photo.jpg"
- card2-alt="Historical photograph of Caltech's Throop Hall circa 1920"
- card2-title="Caltech Archives"
- card2-description="Explore Caltech's rich history."
- card2-link="/archives"
-
- card3-image="https://example.com/workshop.jpg"
- card3-alt="Librarian presenting research tools to a group of graduate students"
- card3-title="Workshops"
- card3-description="Learn new research skills."
- card3-link="/workshops"
-></card-layout>
-
Custom Link Text
-
By default, links display “Read more”. Customize with
-card[1-3]-link-text:
If you don’t provide a card[1-3]-link attribute, the
-link will be hidden for that card:
-
<card-layout
- card1-title="Information Only"
- card1-description="This card has no link."
-
- card2-title="With Link"
- card2-description="This card has a link."
- card2-link="/some-page"
-
- card3-title="Also No Link"
- card3-description="Another card without a link."
-></card-layout>
-
Complete Example
-
Here’s a fully configured card layout using all available
-options:
-
<card-layout
- card1-image="https://example.com/collections.jpg"
- card1-title="Digital Collections"
- card1-description="Browse digitized rare books, photographs, and manuscripts from Caltech's history."
- card1-link="https://library.caltech.edu/archives/collections"
- card1-link-text="Explore collections"
-
- card2-image="https://example.com/events.jpg"
- card2-title="Workshops & Events"
- card2-description="Join us for research skills workshops, author talks, and special events."
- card2-link="https://library.caltech.edu/events"
- card2-link-text="View calendar"
-
- card3-image="https://example.com/reserves.jpg"
- card3-title="Course Reserves"
- card3-description="Access textbooks, readings, and other materials for your courses."
- card3-link="https://library.caltech.edu/borrow/reserves"
- card3-link-text="Find reserves"
-></card-layout>
-
Attribute Reference
-
-
-
-
-
-
-
-
-
Attribute
-
Description
-
Default
-
-
-
-
-
layout
-
Card arrangement: horizontal or
-vertical
-
horizontal
-
-
-
card[1-3]-image
-
URL for the card image
-
Placeholder shown
-
-
-
card[1-3]-alt
-
Alt text for the card image (for accessibility)
-
Uses card title
-
-
-
card[1-3]-title
-
Card heading text
-
“Card One/Two/Three”
-
-
-
card[1-3]-description
-
Brief description text
-
“Add your content here.”
-
-
-
card[1-3]-link
-
URL for the link
-
Link hidden if not set
-
-
-
card[1-3]-link-text
-
Custom text for the link
-
“Read more”
-
-
-
-
Replace [1-3] with the card number (1, 2, or 3).
-
Responsive Behavior
-
-
Horizontal layout (default): Cards display
-side-by-side in a row on desktop, stacking vertically on mobile (<
-600px). Each card shows the image above the content.
-
Vertical layout: Cards stack vertically with image
-on the left and content on the right. Each card spans the full width of
-the container.
-
-
The component handles responsive behavior automatically with no
-additional configuration needed.
-
-
-
-
diff --git a/docs/building_web_components_with_deno.md b/docs/building_web_components_with_deno.md
index 64cd220..e0e2a7f 100644
--- a/docs/building_web_components_with_deno.md
+++ b/docs/building_web_components_with_deno.md
@@ -28,14 +28,6 @@ make website
web release
~~~
-On Windows you can use the related PowerShell scripts that replace make. Example,
-
-~~~pwsh
-make.ps1 build
-make.ps1 website
-make.ps1 release
-~~~
-
The "release" option makes the zip files needed for a GitHub release. If you are on macOS or Linux you can run the `./replace.bash` script to perform those chores if you have `gh` installed.
-NOTE: The bundled JavaScript files are in the root directory. The source are in the `src` directory. If you need to fix something, add something, etc. It should go in the `src/` directory. You may need to either add or edit the tasks in `deno.json`, `Makefile` or `make.ps1`.
+NOTE: The bundled JavaScript files are in the root directory. The source are in the `src` directory. If you need to fix something, add something, etc. It should go in the `src/` directory. You may need to add or edit the tasks in `deno.json`.
diff --git a/enhance_code_blocks.html b/enhance_code_blocks.html
deleted file mode 100644
index de18495..0000000
--- a/enhance_code_blocks.html
+++ /dev/null
@@ -1,238 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
-
-
-
-skip to main content
-
-
-
Enhancing code
-blocks with CSS and JavaScript
-
This document describes how to use the code-blocks.css
-and copyToClipboard.js files to style code blocks and add a
-“Copy to Clipboard” button to them.
-
Overview
-
The provided CSS and JavaScript files allow you to style
-<pre> and <code> elements and add
-a button to copy the code to the clipboard. This is useful for
-displaying code snippets on a webpage with a consistent style and
-enhanced functionality.
-
Files
-
-
code-blocks.css
-
-A CSS file that styles the <pre> and
-<code> elements and the copy button.
-
-
copyToClipboard.js
-
-A JavaScript module that adds a “Copy to Clipboard” button to each
-<pre> block containing a <code>
-element.
-
-
-
CSS Variables
-
The code-blocks.css file uses CSS variables to define
-the styling properties. These variables can be easily overridden to
-customize the appearance of the code blocks and the copy button.
-
Code Block Variables
-
-
--code-font-family
-
-Font family for the code block. Default is monospace.
-
-
--code-border-color
-
-Border color for the code block. Default is #ccc.
-
-
--code-background-color
-
-Background color for the code block. Default is #f5f5f5.
-
-
-
Copy Button Variables
-
-
--copy-button-bg-color
-
-Background color for the copy button. Default is #fff.
-
-
--copy-button-border-color
-
-Border color for the copy button. Default is #ccc.
-
-
--copy-button-text-color
-
-Text color for the copy button. Default is #000.
-
-
--copy-button-hover-bg-color
-
-Background color for the copy button on hover. Default is
-#f0f0f0.
-
-
-
Usage
-
Step 1: Include the CSS File
-
Link the code-blocks.css file in the
-<head> section of your HTML document:
Include the copyToClipboard.js module in your HTML
-document. This script should be included at the end of the
-<body> section or use the
-DOMContentLoaded event to ensure the DOM is fully loaded
-before executing the script.
Add <pre> and <code> elements
-to your HTML document. The JavaScript module will automatically add a
-“Copy to Clipboard” button to each <pre> block
-containing a <code> element.
-
<pre><code>public class HelloWorld {
- public static void main(String[] args) {
- System.out.println("Hello, world!");
- }
-}</code></pre>
-
-<pre><code>public class AnotherExample {
- public static void main(String[] args) {
- System.out.println("Another example!");
- }
-}</code></pre>
-
Example: Full HTML Document
-
Here is an example of a complete HTML document that includes the CSS
-and JavaScript files:
You can override the CSS variables to customize the appearance of the
-code blocks and the copy button. Add a <style> block
-to your HTML document and redefine the variables as needed.
The copyToClipboard.js module performs the following
-actions:
-
-
Waits for the DOMContentLoaded event to ensure the DOM
-is fully loaded.
-
Finds all <pre> elements in the document.
-
For each <pre> element, checks if it contains a
-<code> element.
-
Creates a button with the clipboard emoji (📋) and appends it to the
-<pre> element.
-
Adds an event listener to the button to copy the text content of the
-<code> element to the clipboard when clicked.
-
Provides feedback by changing the button text to “Copied!” for a
-short period after copying.
-
-
Conclusion
-
By following these steps, you can style code blocks and add a “Copy
-to Clipboard” button to them using the provided CSS and JavaScript
-files. This enhances the user experience by making it easy to copy code
-snippets from your webpage.
-
Example: Customized HTML
-Document
-
Here is an example of a complete HTML document with customized
-styling:
This setup allows you to maintain a clean and organized stylesheet
-with reusable variables and provides the flexibility to override these
-variables as needed.
This web component adds a branded footer to applications maintained
-by the library.
-
Versions
-
There are two versions of the footer:
-
-
Footer Global: Standard footer matching the library
-website with full customization options
-
Footer Global Lite: Streamlined footer with
-simplified content structure
-
-
Key Features
-
-
Automatic Updates: Once installed, the component
-automatically receives updates when new versions are released
-
Preset Configurations: Use archives
-presets for instant setup with common defaults
-
Full Customization: Override any preset value or
-create completely custom configurations
-
Flexible Content: Custom headings, links, contact
-info, social media, and branding options
-
Library-Specific Features: Optional breadcrumbs and
-login links for LibGuides integration
-
-
Installing
-
Footer Global
-
<!-- Add the component -->
-<footer-global></footer-global>
-
-<!-- Include the JavaScript -->
-<script type="module" src="https://media.library.caltech.edu/cl-webcomponents/footer-global.js"></script>
-
Footer Global Lite
-
<!-- Add the component -->
-<footer-global-lite></footer-global-lite>
-
-<!-- Include the JavaScript -->
-<script type="module" src="https://media.library.caltech.edu/cl-webcomponents/footer-global-lite.js"></script>
-
Quick Start with Presets
-
The footer defaults to library settings, or you can use the
-archives attribute to automatically configure all contact
-information, branding, and social media links for archives.
For application-specific footers or unique configurations, use the
-custom attribute to take full control over the first
-column.
-
-
Note: The customization examples below use
-footer-global, but the same attributes work for
-footer-global-lite. The only difference is the component
-name.
-
-
Understanding the
-custom Attribute
-
The custom attribute is a special flag that: -
-Hides the default library hours content in column 1 -
-Hides the “Hours” heading (unless you provide a custom
-header attribute) - Adjusts column widths
-for better layout with custom content
Required attributes on each link: -
-slot="custom-links" - Pulls content into Shadow DOM -
-class="custom-links" - Applies proper styling and hover
-states
Requirements: - Page must have element with
-id="s-lib-footer-login-link" containing the login link -
-The footer will mirror this link into the component
-
Breadcrumbs
-
Displays LibGuides breadcrumb navigation in the footer:
Requirements: - Page must have breadcrumb navigation
-with id="s-lib-bc" - The footer will clone this breadcrumb
-trail into the component - Breadcrumbs automatically align with the
-first column
-
Complete Example
-
Here’s a fully customized footer using all available options:
CL-web-components provides a collection of Web Components used by
-Caltech Library across sites and projects.
-
The following are the components currently provided.
-
-
footer-global
-
-This component provides a standard footer with detailed information
-about the library
-
-
footer-global-lite
-
-This component provides a lighter weight version of the
-footer-global component
-
-
ul-a-to-z
-
-This component takes an innerHTML containing a UL list. The UL list is
-then turned into an A to Z navigatable UL List. If JavaScript is
-unavailable then the innerHTML UL remains as a fallback.
-
-
textarea-csv
-
-This is a textarea like component who’s innerHTML content is CSV data.
-The component will display this as an editable table.
-
-
textarea-agent-list
-
-This element wraps a textarea containing a list of agents expressed as
-JSON.
-
-
table-sortable
-
-This is a component that takes an innerHTML containing table. It makes
-the table sortable by the column headings and provides a filter input
-that lets you enter text to filter by and pick a column to filter on.
-
-
-
Release Notes
-
-
version: 0.0.16
-
status: wip
-
released: 2026-01-28
-
-
This release adds a new `<card-layout>` component for
-displaying three-card layouts with images, titles, descriptions, and
-links. The component is responsive and uses attributes to set the
-content values.
One challenge and feature of web components is that they encapsulate
-the component as a single HTML element. This is a design feature of web
-components that insure safe default behaviors. If the web component
-itself contains HTML elements, the isolation may be important for
-component rendering and behavior. On the other hand, if the web
-component itself contains standard HTML elements and they should inherit
-form the page level style sheet you have a problem. The safety of an
-encapsulated component becomes a barrier to how we traditionally expect
-CSS to apply.
-
Adding inheritance inside the web component should be weighed
-carefully. If it is desirable to inherit an external CSS rule set, you
-have several options. First is to include the reference as an import in
-the HTML template for the object. This is useful where the component
-will be used in a design system and the design system specifies the
-required CSS files and their locations.
-
Another approach is to pass in styling or style sheet references via
-the web component’s attributes. This can be done by defining the
-attributes style and css-href (or something
-similar). Having the style attributes is the practice used
-generally with standard HTML elements. The style passed in can be vetted
-to make senses in the context of the whole component’s rendering. A use
-case that fits this approach is here you might want the color scheme or
-font choice to pass through to the component. The css-href
-approach is slightly more complex. Before the HTML template text is
-instantiated, you need to include the references to the CSS being
-included. It remains unclear if the web component can take advantage of
-the page’s own CSS cache or if it will require an additional explicit
-download of the CSS. This area needs exploration and testing to confirm
-behaviors.
-
All the approaches are reasonable assuming the trade offs and
-limitations are understood.
-
Master style sheet approach
-
Here’s are some use case examples of in using a master style sheet
-approach (explicitly include an @import rule in the
-component’s style element).
-
CSS Custom Properties
-(Variables)
-
Use CSS custom properties (also known as CSS variables) in your
-master CSS file. These variables can be defined globally and accessed
-within your web components.
Use Constructable Stylesheets to share styles across multiple shadow
-roots. This allows you to define styles once and use them in multiple
-components.
Some CSS properties are inherited by default (e.g., font-family,
-color). You can leverage these properties to style your web components
-without piercing the Shadow DOM.
By using these strategies, you can effectively integrate a master CSS
-file with your web components while respecting the encapsulation
-provided by the Shadow DOM.
-
Configurable CSS via
-component attributes
-
You can conditionally include CSS and supply default styles for web
-components. This can be achieved through a combination of JavaScript
-logic and CSS management. Here are some strategies to accomplish
-this:
-
Dynamic Stylesheet Loading:
-
You can use JavaScript to dynamically load stylesheets based on
-certain conditions. This allows you to include different stylesheets
-depending on the context or user preferences.
By using these techniques, you can conditionally include CSS and
-supply default styles for your web components, making them more flexible
-and adaptable to different contexts and user preferences.
Write an A to Z web component call a-to-z-ul who’s
-innerHTML contains HTML5 UL list. That list will be used to structure
-our links between our A to Z menu and the contents of the list.
-
The web component will be in a file called “a_to_z_ul.js”. Three
-example HTML files will demonstate the web component. The first example
-HTML with a short UL list. The second example HTML file with a long UL
-list demonostrating how the optional “back to the menu” anchor will
-work. The third HTML file that include two separate
-a-to-z-ul lists on the same page. One will be short and one
-will be long. The goal is to demonstrate that each A to Z UL list
-functions independently.
-
The A to Z index should use a “menu” element for UL list navigate.
-Each menu’s LI elements should contain anchors element representing the
-alphabetical starting letters found in the UL list. That menu’s li’s
-anchor will link into the UL list to the where the list’s items start
-with the same alphabetical character.
-
The A to Z web component use all the same attributes supported by
-HTML5 UL elements. In addition there is an optional attribute called
-“long”. If “long” is true then an anchor element iss added after the UL
-list that will take you back to the menu.
-
The web component should use HTML templates for structure and
-CSS.
-
The UL items should be taken form the a-to-z-ul
-innerHTML. The a-to-z-ul web component will need to detect
-when the alphabetical starting letters changes. For each new letter it
-needs to insert a new li that has a heading and identifying the
-alphabetical section it is starting. The heading should contain an
-anchor that links back to the menu.
-
The a-to-z-ul menu’s items should not contain bullets.
-The Letter section headings don’t need bullets. The UL list’s menu items
-should inherit the bullets from the page.
-
The a-to-z-ul web component may exist multiple times on
-a page.
-
The a-to-z-ul web component should be implemented as an
-ES6 module.
-
–
-
NOTE: The following is prompts added after the initial prompt
-generated code.
-
When you click on the letter in the menu the browser should center
-the virtial scroll so that section of the list is visible.
-
The innerHTML of a-to-z-ul is a UL list not a list of
-text one per line.
-
Update the HTML examples to use innerHTML UL elements
-
The back to menu link should scroll the menu into view.
-
-
-
\ No newline at end of file
diff --git a/llm_notes/a_to_z_ul_llm_specification.html b/llm_notes/a_to_z_ul_llm_specification.html
deleted file mode 100644
index 56f0340..0000000
--- a/llm_notes/a_to_z_ul_llm_specification.html
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
This JavaScript code defines a custom HTML element using the Web
-Components API. This custom element, named
-<a-to-z-ul>, is designed to create an alphabetical
-menu from a list of items. Here’s a detailed specification of the
-module:
-
Module Specification
-
Class: AToZUL
-
-
Inheritance: Extends HTMLElement.
-
Shadow DOM: Uses Shadow DOM with an open mode to
-encapsulate styles and markup.
-
-
Constructor
-
-
Purpose: Initializes the custom element and
-attaches a shadow root.
-
-
Lifecycle Methods
-
-
connectedCallback: Called when the
-element is added to the DOM. It triggers the render method
-to set up the component.
-
-
Methods
-
-
render:
-
-
Purpose: Renders the component’s UI and
-functionality.
-
Steps:
-
-
Creates a template element containing the styles and initial HTML
-structure.
-
Appends the template content to the shadow root.
-
Selects the list container and menu elements from the shadow
-DOM.
-
Retrieves the <ul> element from the light DOM
-(the main document) and processes its <li>
-items.
-
Groups the items by their first letter and creates menu links and
-sections accordingly.
-
Adds event listeners to menu links and section headings for smooth
-scrolling.
-
Optionally adds a “Back to Menu” link if the long
-attribute is present.
-
-
-
scrollToSection:
-
-
Purpose: Scrolls smoothly to a specified section
-with an offset.
-
Parameters:
-
-
section: The DOM element to scroll to.
-
-
Behavior: Uses window.scrollTo with
-smooth behavior and a customizable offset.
-
-
-
Attributes
-
-
long: If present, adds a “Back to
-Menu” link at the bottom of the component.
-
-
Styles
-
-
Menu: Horizontal list with inline items.
-
Letter Sections: Vertical lists with no text
-decoration.
-
Back to Menu Link: Block-level link with top
-margin.
-
-
Event Listeners
-
-
Menu Links: Prevent default link behavior and
-scroll to the corresponding section.
-
Section Headings: Prevent default link behavior and
-scroll back to the menu.
-
Back to Menu Link: Prevent default link behavior
-and scroll back to the menu.
The AToZUL component is a reusable web component that
-organizes a list of items into alphabetical sections with a navigable
-menu. It uses Shadow DOM for encapsulation and provides smooth scrolling
-between sections. The component can be extended or modified to fit
-different use cases by adjusting styles, attributes, or event
-listeners.
-
-
-
\ No newline at end of file
diff --git a/llm_notes/csvtextarea_llm_generated_specification.html b/llm_notes/csvtextarea_llm_generated_specification.html
deleted file mode 100644
index 2af310a..0000000
--- a/llm_notes/csvtextarea_llm_generated_specification.html
+++ /dev/null
@@ -1,200 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
CSVTextarea Web
-Component Specification
-
Overview
-
The CSVTextarea web component is designed to manage and
-display tabular data in an editable HTML table format. It supports CSV
-data input and output, autocomplete functionality, and various
-customization options. The component is built using the Web Components
-API and leverages Shadow DOM for encapsulation.
-
Dependencies
-
-
parseCSV, parseCSVRow,
-stringifyCSV: Functions imported from
-./parseCSV.js for parsing and stringifying CSV data. These
-functions are assumed to be available and correctly implemented.
-
-
HTML Structure
-
-
Shadow DOM: The component uses Shadow DOM to
-encapsulate its styles and structure.
-
Template: The component’s template includes a table
-with a thead and tbody, and buttons for
-appending rows and cleaning up the table.
-
-
Attributes
-
-
column-headings (required): A
-comma-delimited list of column headings. This attribute is parsed to
-create the table headers.
-
id: Sets the ID of the component.
-
class: Sets the class of the
-component.
-
caption: Sets the caption of the
-table.
-
text: Sets the text content of the
-component.
-
placeholder: Sets the placeholder text
-for input fields in the table.
-
css-href: A URL to custom CSS that
-replaces the default CSS provided by the HTML template.
-
debug: A boolean attribute that, when
-true, enables debug logging to the console.
-
-
Methods
-
-
Lifecycle Methods
-
-
constructor(): Initializes the
-component and attaches a Shadow DOM.
-
connectedCallback(): Called when the
-component is added to the DOM. Initializes the component and sets up
-event listeners.
-
attributeChangedCallback(name, old, newVal):
-Called when an observed attribute is added, removed, or changed.
-
-
Initialization Methods
-
-
initializeComponent(): Sets up the
-component’s template and styles. Returns a promise that resolves when
-the component is fully initialized.
-
initializeTable(): Initializes the
-table structure based on the column-headings attribute and
-populates the table body.
-
-
Event Handling
-
-
setupEventListeners(): Sets up event
-listeners for the component’s buttons and table cells.
-
-
Table Management
-
-
rowCount(): Returns the number of rows
-in the table body.
-
columnCount(): Returns the number of
-columns in the table headings.
-
isEmptyRow(rowIndex): Checks if a row
-is empty.
-
appendRow(): Adds an empty row to the
-table body.
-
cleanupTable(): Removes empty rows
-from the table body.
-
-
Data Conversion
-
-
toCSV(): Converts the table body to a
-CSV string.
-
fromCSV(csvText): Populates the table
-body from a CSV string.
-
toObjects(): Converts the table body
-to an array of objects representing each cell.
-
fromObjects(objects): Populates the
-table body from an array of objects.
-
toJSON(): Converts the table body to a
-JSON string.
-
fromJSON(jsonString): Populates the
-table body from a JSON string.
-
-
Textarea Integration
-
-
fromTextarea(): Reads CSV data from an
-inner <textarea> and populates the table body.
-
toTextarea(): Writes the table body’s
-CSV data to an inner <textarea>.
-
-
Cell Management
-
-
getCellValue(rowIndex, colIndexOrName):
-Gets the value of a cell.
-
setCellValue(rowIndex, colIndexOrName, value):
-Sets the value of a cell.
-
-
Autocomplete Functionality
-
-
setAutocomplete(colIndexOrName, options):
-Associates a datalist with a column’s input elements.
-
getAutocomplete(colIndexOrName):
-Returns the options associated with a column’s datalist.
-
-
Utility Methods
-
-
getColumnIndexByName(colName): Gets
-the index of a column by its name.
-
-
-
Events
-
-
changed: Emitted when the value of a
-cell changes. Contains the row index, column index, and new value.
-
focused: Emitted when a cell gains
-focus. Contains the row index, column index, and value.
-
-
Accessibility
-
-
The component follows W3C accessibility guidelines by providing
-keyboard navigation and focus management.
-
Includes a clickable help icon (ⓘ) that displays help text if the
-title or help-description attributes are
-present.
-
-
Customization
-
-
Supports custom CSS via the css-href attribute.
-
Allows customization of table captions, placeholder text, and debug
-logging.
Initialization: The component initializes its
-template and sets up the table structure based on the
-column-headings attribute.
-
Event Handling: It listens for changes and focus
-events on table cells, emitting custom events for external
-handling.
-
Data Management: Methods for converting between
-CSV, JSON, and table data, as well as appending and cleaning up
-rows.
-
Autocomplete: Correctly associates datalists with
-input fields and ensures options are set up properly.
-
Debug Mode: When the debug attribute
-is set, the component logs events and table contents to the
-console.
-
-
-
-
\ No newline at end of file
diff --git a/llm_notes/csvtextarea_llm_prompts.html b/llm_notes/csvtextarea_llm_prompts.html
deleted file mode 100644
index 968a377..0000000
--- a/llm_notes/csvtextarea_llm_prompts.html
+++ /dev/null
@@ -1,182 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
CSVTextarea Web Component
-
I would like to implement a web component in JavaScript called
-CSVTextarea.
-
The CSVTextarea uses an editable HTML5 table element to manage the
-tabular data. The CSVTextarea uses an HTML template to structure the
-table and provide default CSS.
-
“parseCSV” and “parseCSVRow” are imported from a module called
-“./parseCSV.js”;
-
The CSVTextarea element has an attribute called “column-headings”.
-This is a required attribute. This is a comma delimited list that use an
-imported “parseCSVRow” method to produce a list of headings that will be
-used for the HTML5 table.
-
The CSVTextarea may of the following attributes, “id”, “class”,
-“caption”, “text”, “placeholder”, “css-href”.
-
The CSVTextarea “css-href” attribute is used to fetch custom CSS for
-the CSVTextarea and replaces the default CSS provided by the HTML
-Template.
-
If the CSVTextarea’s innerHTML includes one or more datalist HTML
-elements those to be cloned into the HTML Template.
-
The CSVTextarea the async initializeComponent should instantiate the
-HTML template and return a promise if successfully complete.
-
The CSVTextarea initializeTable method is called after
-initializeComponent has completed and it should populate the HTML5
-table. The HTML5 table heading should be populated from by using the
-imported “parseCSVRow” method on the “column-headings” attribute. Each
-string in the array should become a column heading.
-
The CSVTextarea’s table body’s TD elements should use input elements
-to hold editable content. If there is a datalist associated with the
-column of the TD then each input element in the column should point to
-the datalist with it’s “list” attribute.
-
The CSVTextarea emits a “cell-change” event consisting of the row
-index, column index and value for the editable HTML5 table body TD’s
-input element change.
-
The CSVTextarea emits a “cell-focus” event consisting of the row
-index, column index and value for the editable HTML5 table body TD’s
-recieves focus.
-
The CSVTextarea has a debug attribute that is false by default. If
-debug is true the CSVTextarea will use the “toCSV” method to display
-contents of the HTML5 table’s body in the console when CSVTextarea is
-instantiated in the web page. CSVTextarea should emit events when the
-HTML5 table body’s TD are edited. If debug is true events are displayed
-in the console.
-
The CSVTextarea has a method called “rowCount” that returns the
-number of rows in the HTML5 table body. The minimum number of rows is
-zero when only the HTML5 table’s headings are populated.
-
The CSVTextarea has a method called “columnCount” that returns the
-number of columns in the HTML5 table headings. The minimum column count
-is one. A HTML5 table must have at least one column heading.
-
The CSVTextarea HTML5 table body must have the same number of columns
-as the heading columns.
-
The CSVTextarea has a method called “isEmptyRow”. It takes a row
-index. The method scans each TD of the row and if each TD has an enpty
-innerHTML then it returns true. If a TD’s innerHTML has content true is
-returned.
-
The CSVTextarea has a method “appendRow” that adds an row of empty TD
-at the bottom of the HTML5 table body. Set the input fosuc to the first
-TD in the added row.
-
The CSVTextarea has a method “cleanupTable” that looks at each row in
-the HTML5 table’s body and removes it if “isEmptyRow” returns true. It
-should start checking for the empty rows from the bottom and work it’s
-way to the top.
-
The CSVTextarea has a method “toCSV” method that returns the HTML5
-table’s body and a CSV text. The toCSV method should use “stringifyCSV”
-imported from “./parseCSV.js” to encode the rows array in CSV
-format.
-
The CSVTextarea has a method “fromCSV” that takes CSV text, uses the
-imported “parseCSV” function and result rows into the HTML5 table
-body.
-
The CSVTextarea has a method “toObjects”. The method returns a array
-objects representing each TD in the HTML5 table’s body. The objects will
-have the row index, column index and value of the TDs.
-
The CSVTextarea has a method “fromObjects”. The method takes an array
-of objects that have the row index, column index and value. It maps the
-objects into the HTML5 table body replacing or creating TD has
-needed.
-
When the CSVTextarea’s inner TEXTAREA’s innerText is an empty string
-then display the HTML5 table with a single empty row with the same
-number of cells as the number of column headings.
-
CSVTextarea should have methods the correspond to a HTML5 table’s
-methods.
-
CSVTextarea web component must follow W3C accessibilty
-guidelines.
-
Multiple CSVTextarea may occur in a web page.
-
The CSVTextarea will normally be used to wrap a TEXTAREA element. The
-innerHTML of the TEXTAREA element will provide CSV content used to
-initial the editable HTML5 table element’s body.
-
The CSVTextarea has a method “fromTextarea” that reads an innerHTML’s
-TEXTAREA, parses the content using “parseCSV” method and updates the
-HTML5 table body.
-
The CSVTextarea has a method “toTextarea” that takes the contents of
-the HTML5 table body and uses “stringifyCSV” when setting the
-innerHTML’s of TEXTAREA.
-
Example usage of the CSVTextarea should look like this.
When the CSVTextarea is initialized it reads the wrapped TEXTAREA’s
-innerText and has the Table object parse the CSV content and populate
-the table. There should not be a TEXTAREA rendered by the CSVTextarea
-web component.
-
The CSVTextarea has two buttons below the HTML5 table. The first
-button is labeled “Append Row”, it triggers the “appendRow” action. The
-second button is called “Cleanup” it triggers the “cleanupTable” action.
-If “debug” is true then those events are shown in the console.
-
If the CSVTextarea “debug” attribute is true then a third button with
-a label “Debug”. When clicked the the current fucus information and the
-content CSVTextarea’s TEXTAREA’s innerHTML will be display the results
-for toCSV in the console.
-
Please display the ES6 module, “csvtextarea.js”.
-
When text in a TD is selected and the backspace key is pressed delete
-the selected text. If not text is selected and the backspace key is
-pressed delete the character before the cursor.
-
When CSVTextarea is initialized without any CSV data the HTML5 table
-the header and use the appendRow method to add an empty row to the HTML5
-table’s body.
-
CSVTextarea should include “getCellValue” method that take a row
-index and column index or name. It should return the value of the
-corresponding input element contained in the TD of the table’s body
-corresponding row and index. If column index is not a number the column
-index value is dereved by matching the string against a
-column-heading.
-
CSVTextarea should include a “setCellValue” method that takes a row
-index, column index or name, and a value. It sets the value of the input
-element contained in the TD corresponding the the row and column index.
-If column index is not a number the column index value is dereved by
-matching the string against a column-heading.
-
CSVTextarea should include a method toJSON that uses
-toObjects and returns the results by using
-JSON.stringify.
-
CSVTextarea should include a method fromJSON that takes
-a JSON string and used JSON.parse and
-fromObjects to update the CSVTextarea table.
-
CSVTextarea should include a method called
-setAutocomplete that will associated a datalist in the HTML
-Template with a column’s input elements. The
-setAutocomplate takes a column index or name and an array
-of objects where each object’s value is used when creating the
-datalist’s options.
-
CSVTextarea should include a method called
-getAutocomplete. This method takes a column index or name.
-It returns an array of objects representing the options associated with
-the column’s datalist. If no datalist is found it returns undefined.
-
If the CSVTextarea as a title attribute, “help-description” attribute
-a clickable “ⓘ” should be included after the buttons. Clicking toggles
-the a help message. The help message is composed from the CSVTextarea’s
-title if available, the value in a “help-text” attribute if available
-and should describe navigating and editing the table.
-
-
-
\ No newline at end of file
diff --git a/llm_notes/parseCSV_llm_generated_specification.html b/llm_notes/parseCSV_llm_generated_specification.html
deleted file mode 100644
index 2d78539..0000000
--- a/llm_notes/parseCSV_llm_generated_specification.html
+++ /dev/null
@@ -1,139 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
Function Specifications
-
1. parseCSVRow
-
-
Purpose: Parses a single row of CSV data into an
-array of columns.
-
Input:
-
-
csvRowString (string): A single row of CSV data as a
-string.
-
-
Output:
-
-
An array of strings, where each string represents a column in the
-CSV row.
-
-
Behavior:
-
-
Handles quoted fields, allowing commas within quotes.
-
Trims whitespace from each column.
-
Ignores commas within quoted fields.
-
-
Example:
-
-
Input: "John,Doe,123"
-
Output: ["John", "Doe", "123"]
-
-
-
2. parseCSV
-
-
Purpose: Parses a full CSV string into a 2D array
-of rows and columns.
-
Input:
-
-
csvString (string): The entire CSV data as a
-string.
-
-
Output:
-
-
A 2D array of strings, where each sub-array represents a row of
-columns.
-
-
Behavior:
-
-
Splits the CSV string into rows based on newline characters.
-
Uses parseCSVRow to parse each row.
-
Ensures all rows have the same number of columns by padding with
-empty strings if necessary.
-
-
Example:
-
-
Input: "John,Doe\nJane,Smith"
-
Output: [["John", "Doe"], ["Jane", "Smith"]]
-
-
-
3. stringifyCSVRow
-
-
Purpose: Converts an array of strings into a
-CSV-encoded string.
-
Input:
-
-
array (array of strings): An array representing a
-single row of CSV data.
-
-
Output:
-
-
A CSV-encoded string.
-
-
Behavior:
-
-
Encloses fields containing commas, newlines, or double quotes in
-double quotes.
-
Escapes double quotes within fields by doubling them.
-
-
Example:
-
-
Input: ["John", "Doe", "123"]
-
Output: "John,Doe,123"
-
-
-
4. stringifyCSV
-
-
Purpose: Converts a 2D array of strings into a
-CSV-encoded string.
-
Input:
-
-
data (2D array of strings): A 2D array representing
-rows and columns of CSV data.
-
-
Output:
-
-
A CSV-encoded string.
-
-
Behavior:
-
-
Uses stringifyCSVRow to convert each row into a
-CSV-encoded string.
-
Joins the rows with newline characters.
-
-
Example:
-
-
Input: [["John", "Doe"], ["Jane", "Smith"]]
-
Output: "John,Doe\nJane,Smith"
-
-
-
General Requirements
-
-
The generated code should maintain the same functionality and
-behavior as the original JavaScript code.
-
The code should handle edge cases, such as empty strings, fields
-with special characters, and varying numbers of columns per row.
-
The code should be written in a clear and maintainable manner, with
-appropriate comments and documentation.
-
-
This specification can be used to guide an LLM in generating
-functionally equivalent code in another programming language or to
-rewrite the JavaScript code with the same functionality.
-
-
-
\ No newline at end of file
diff --git a/llm_notes/parseCSV_llm_prompts.html b/llm_notes/parseCSV_llm_prompts.html
deleted file mode 100644
index 960cee9..0000000
--- a/llm_notes/parseCSV_llm_prompts.html
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
parseCSV JavaScript
-module
-
-
I generated the Javacript Generated with the DuckDuckGo Anthromophic
-Claude LLM, it did better than Mistral LLM.
-
-
This is a JavaScript module with a single exported function called
-“parseCSV”.
-
This “parseCSV” function returns a two dimensional array of rows and
-columns. It takes a single string as a parameter. It is intended to
-accurately process CSV data.
-
“parseCSV” takes a string containing zero or more lines of text. It
-treats each line as a row. Each row may contain zero or more columns of
-data. Each column in the row may contain any valid UTF8 character. When
-evaluating a row it is scanned for column data. A column starts with the
-first non space character. A column starts with double quotes then the
-column will not end until a matching double quote is encountered. Commas
-are used to eparate the value of each column. Here is an example, this
-row as three columns "Doe, Jane", 20, "Rancho Cucamonga"
-the first column’s value is Doe, Jane, the second column
-value is 20 and the third column value is
-Rancho Cucamonga. When the rows are evaluated the highest
-column count should be remembered. Whan all rows have been processed
-make sure they call have the same number of columns, if not add the
-necessary columns for them to match. The parseCSV function should avoid
-using regular expressions.
-
Here is an example of using the “parseCSV” function.
-
let data =parseCSV(`one,two,three
-"Dean, Joe", 22, "And what?"
- to, "tell, the", something
-or other, in , may
-`);
-(data.length===4) ?console.log(`${data.length}$ lines read successfuly`) :console.log(`error: ${data.length} lines read, expected 4`);
-let i =0;
-for (let row of data) {
- (row.length===3) ?'':console.log(`row ${i} is wrong length, ${row}`);
-}
-
The “data” variable should be a two dimensional array of rows and
-columns.
-
-
-
\ No newline at end of file
diff --git a/llm_notes/prompt_to_generate_llm_specitication.html b/llm_notes/prompt_to_generate_llm_specitication.html
deleted file mode 100644
index 212dac9..0000000
--- a/llm_notes/prompt_to_generate_llm_specitication.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
What follows is the JavaScript ES6 moduled. Please analyze it and
-provide a comprehensive and detailed specification suitable to recreate
-it using an large langauge model.
-
-
-
\ No newline at end of file
diff --git a/llm_notes/sortable_table_llm_prompts.html b/llm_notes/sortable_table_llm_prompts.html
deleted file mode 100644
index a055163..0000000
--- a/llm_notes/sortable_table_llm_prompts.html
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
I need to created a web component called sortable-table.
-that wraps an HTML table element. The web component will
-allow you to sort the table descending or ascending by clicking the
-column heads. The column headings and rows are determined by the table
-being wrapped by the web component.
When the sortable-table web component instantiates it
-recreated the innerHTML table representation but makes the table
-sortable. When you click on a column it sorts the table by that column.
-There is also a search column form at the top of the table that will
-filter the table results by the column select and the text typed in.
-
Please generate the JavaScript to created this component.
-
-
-
-
-
\ No newline at end of file
diff --git a/table-sortable.html b/table-sortable.html
deleted file mode 100644
index 74bbd88..0000000
--- a/table-sortable.html
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
- CL-web-components
-
-
-
-
-
-
-
-
-
-skip to main content
-
-
-
Table Sortable Web Component
-
This web component wraps a standard HTML table. It displays the table
-and makes it sortable by the column headings and provides a search
-filter element that operates on the table by column.
-
Example
-
This is a standard table without the web component.
This is a web component targets a textarea that hold JSON of a list
-of agents. Agents are either people or organizations. People have a
-family and given names along with an ORCID. Organizations have a name
-along with a ROR. The list can contain either type of Agent.
-
Overview
-
Library and Archives often of lists of people and organizations. In
-bibliographic material this would be the case for authors or
-contributors to a book or other published material. Lists are not
-natively supported in HTML web forms. The closest native element is a
-textarea which can contain an arbitrary number of lines. An early
-practice before JavaScript was invented was to teach people how to type
-in delimited text. After the introduction of JavaScript the JSON
-notation became a native browser structured data representation. For
-complex metadata objects describing a person or organization JSON
-provides a reasonably effective representation. How typing JSON into a
-textarea is error prone, hence this web component. If web components are
-not supported by the browser then an inner textarea element functions as
-a fallback. Otherwise the wrapping web component provide a reasonable
-interface for managing the list of agents.
-
Key Features
-
-
falls back to JSON inside a textarea
-
agents support both the concept of a person or an organization
-
the form can use POST method and the browser default url encoding
-for form data
-
-
Attributes
-
-
style: Allows you to set the CSS color and font
-size
-
css-href: Allows you to overwrite the component’s
-own CSS
-
-
Usage
-
-
Include the Component: Ensure the component’s
-JavaScript file is included in your HTML.
-
HTML Structure: Use the
-<textarea-agent-list> tag and include a
-<textarea> element inside it. The textarea can have
-JSON expressing a list of agents (people and organizations).
-
-
Example
-
Here’s an example of how to use the
-<textarea-agent-list> component in an HTML file:
This is a web component intended to wrap a textarea where people
-would enter CSV encoded text. By wrapping the textarea element we
-provide a fallback should JavaScript be unavailable.
-
Overview
-
The TextareaCSV web component is designed to create an
-interactive table from CSV data, allowing users to edit the data
-directly in the table. It supports features like appending rows,
-cleaning up empty rows, and converting table data to and from CSV
-format.
-
Key Features
-
-
CSV Parsing: Automatically parses CSV data into a
-table format.
-
Editable Table: Allows users to edit table cells
-directly.
-
Row Management: Provides functionality to append
-rows and clean up empty rows.
-
Autocomplete: Supports autocomplete for table cells
-using <datalist> elements.
-
Event Handling: Dispatches custom events for cell
-changes and focus.
-
-
Attributes
-
-
column-headings: A comma-separated
-string of column headings for the table.
-
id: Sets the ID of the component.
-
class: Sets the class of the
-component.
-
caption: Sets a caption for the
-table.
-
text: Sets the initial text content of
-the table.
-
placeholder: Sets the placeholder text
-for input fields in the table.
-
css-href: Links to an external CSS
-file for styling.
-
debug: Enables debug mode, which logs
-additional information to the console.
-
title: Sets a title for the help
-icon.
-
help-description: Sets a description
-for the help icon.
-
-
Usage
-
-
Include the Component: Ensure the component’s
-JavaScript file is included in your HTML.
-
HTML Structure: Use the
-<textarea-csv> tag and include a
-<textarea> with CSV data inside it.
-
-
Example
-
Here’s an example of how to use the TextareaCSV
-component in an HTML file:
-
<textarea-csv id="people-table" name="people-table" column-headings="Name,Age,City" debug>
- <textarea id="people-table" name="people-table" rows="2" cols="36>
- John Doe,30,New York
- Jane Smith,25,Los Angeles
-</textarea>
-</textarea-csv>
-
Here is what that standard textarea looks like.
-
-
-
-
-Here’s the tablized version.
-
-
-
-
-
Explanation
-
-
Component Tag: The
-<textarea-csv> tag is used to define the
-component.
-
Column Headings: The column-headings
-attribute specifies the headings for the table columns.
-
Debug Mode: The debug attribute
-enables debug mode, which logs additional information to the
-console.
-
Textarea: The <textarea> inside
-the component contains the initial CSV data.
-
-
Customization
-
-
Styling: You can customize the styles by modifying
-the CSS in the initializeComponent method or by linking to
-an external CSS file using the css-href attribute.
-
Autocomplete: Use <datalist>
-elements to provide autocomplete options for table cells.
-
Event Listeners: Customize event listeners in the
-setupEventListeners method to handle specific
-interactions.
-
-
Conclusion
-
The TextareaCSV component simplifies the creation of
-editable tables from CSV data, making it easier to manage and interact
-with tabular data in web applications. By following the usage guidelines
-and customizing as needed, you can integrate this component into your
-web projects seamlessly.
This is a web component targeting simple A to Z lists derived from UL
-lists. It wraps an innerHTML that contains a UL list as the fallback if
-JavaScript is unavailable.
-
Overview
-
The ULAToZList web component is designed to create an
-alphabetical menu from a list of items. It organizes the items into
-sections based on their initial letter and provides navigation between
-these sections.
-
Key Features
-
-
Alphabetical Menu: Automatically generates a menu
-with links to each letter section.
-
Section Navigation: Allows smooth scrolling to each
-section when a menu item is clicked.
-
Back to Menu: Optionally displays a “Back to Menu”
-link when the long attribute is present.
-
-
Attributes
-
-
long: When this attribute is present,
-a “Back to Menu” link is displayed at the end of each section.
-
-
Usage
-
-
Include the Component: Ensure the component’s
-JavaScript file is included in your HTML.
-
HTML Structure: Use the
-<ul-a-to-z-list> tag and include a
-<ul> with <li> items inside
-it.
-
-
Example
-
Implementation
-
Here’s an example of how to use the ULAToZList component
-in an HTML file:
Here’s that UL list without the web component wraping it
-
-
Apple
-
Banana
-
Cherry
-
Date
-
Elderberry
-
-
-Here’s the version with an A to Z list integrated.
-
-
-
-
Explanation
-
-
Component Tag: The
-<ul-a-to-z-list> tag is used to define the
-component.
-
List Items: The <ul> inside the
-component contains the items to be organized alphabetically.
-
long Attribute: Adding the
-long attribute will display a “Back to Menu” link.
-
-
Customization
-
-
Styling: You can customize the styles within the
-component’s shadow DOM by modifying the CSS in the render
-method.
-
Behavior: The scrollToSection method
-can be adjusted to change the scrolling behavior or offset.
-
-
Conclusion
-
The ULAToZList component simplifies the creation of
-alphabetical navigation menus, making it easier to organize and navigate
-large lists of items. By following the usage guidelines and customizing
-as needed, you can integrate this component into your web projects
-seamlessly.
Naming things is one of the biggest problems in computer science.
-Picking good names for web components falls clearly in this problem
-space. A successful component may be used to years or longer. The name
-should make it clear what the component does and how it might be
-used.
-
The history of web components suggest an important naming convention,
-two or more words separate by a dash. We can take advantage of this to
-make our HTML use of the component clearer. In this spirit the consensus
-of the DLD team in Summer 2025 is to start a component name using the
-standard element you’re extending along with descriptive word or
-phrase.
-
Our textarea extending element that presents a table
-view of CSV text content starts with textarea as the prefix
-in the name. It then adds csv, the data it is presenting to
-manage. Thus the element should be named textarea-csv. Our
-A to Z list element that wraps a UL list follows this approach too,
-ul-a-to-z-list. When you see the markup below it looks like
-standard HTML and you can see what is being extended.