### Install Project Dependencies Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/ReadMe.md Installs all necessary libraries for development and running the Open Ordinal Metadata library. ```bash npm install ``` -------------------------------- ### Audiobook Metadata Example (JSON) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/documents/Introduction.md An example of metadata for an audiobook following the Release protocol. It includes the title, type, artists, and tracks, with track details provided as inline objects. ```JSON { "title": "1984 Audiobook", "type": "audiobook", "artists": ["Gary Ohwell"], "tracks": [ { "title": "Part 1" }, { "title": "Part 2" } ] } ``` -------------------------------- ### JSON Audiobook Metadata Example Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/README.md An example of metadata for an audiobook following the Release protocol. It includes the title, type, artists, and tracks, with track details provided as inline objects. ```JSON { "title": "1984 Audiobook", "type": "audiobook", "artists": ["Gary Ohwell"], "tracks": [ { "title": "Part 1" }, { "title": "Part 2" } ] } ``` -------------------------------- ### JSON Example: Single Track Metadata Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/_media/Music.md An example of metadata for a single track, including track title and media duration/decoder. ```json { "track": { "title": "Dream" }, "media": { "duration": 69.68299999999999, "decoder": { "@id": "6a96a763093b30319ab9f38e5043405c4853e72c86eb1107dbf92f68e64d7cb5i0" } } } ``` -------------------------------- ### JSON Audiobook Metadata Example Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/index.html An example of JSON metadata for an audiobook, adhering to the Release protocol. It includes title, type, artists, and tracks with their respective titles. ```JSON { "title": "1984 Audiobook", "type": "audiobook", "artists": ["Gary Ohwell"], "tracks": [ { "title": "Part 1" }, { "title": "Part 2" } ] } ``` -------------------------------- ### Namespaced Metadata Example (JSON) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/documents/Introduction.md Demonstrates namespacing in JSON metadata to handle potential property name collisions between different protocols. The 'release' and 'book' protocols have their properties namespaced accordingly. ```JSON { "release": { "title": "1984 Audiobook", "artists": ["Gary Ohwell"], "tracks": [ { "title": "Chapter 1" }, ] }, "book": { "title": "1984", "authors": ["George Orwell"] } } ``` -------------------------------- ### Audiobook Metadata Example (JSON) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/src/docs/Index.md An example of metadata for an audiobook adhering to the Open Ordinal Metadata standard. It includes the audiobook's title, type, artists, and a list of tracks, with each track having its own title. ```JSON { "title": "1984 Audiobook", "type": "audiobook", "artists": ["Gary Ohwell"], "tracks": [ { "title": "Part 1" }, { "title": "Part 2" } ] } ``` -------------------------------- ### JSON Example: Track Metadata Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/documents/Use_Cases.Music.html An example of metadata for a single music track, including its title and media details like duration and decoder. ```json { "track": { "title": "Dream" }, "media": { "duration": 69.68299999999999, "decoder": { "@id": "6a96a763093b30319ab9f38e5043405c4853e72c86eb1107dbf92f68e64d7cb5i0" } } } ``` -------------------------------- ### JSON Example: Artist Inscription Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/_media/Music.md Example JSON for inscribing artist metadata, including the artist's name. ```json { "artist": { "name": "DJ Tiny" } } ``` -------------------------------- ### Example Collection Metadata JSON Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/documents/Use_Cases.Collection.html Provides an example of JSON metadata for a collection, adhering to the 'Collection' protocol. It includes details like name, description, total count, URL, and a comprehensive list of attributes with their possible values. ```json { "collection": { "name": "Tiny Vikings", "description": "Tiny Vikings are the vikings of Bitcoin.", "totalCount": 20000, "url": "https://tinyvikings.xyz", "allAttributes": { "Background": [ "Snowy", "Gold", "..." ], "Outfit": [ "Green Cloak", "Wizard", "..." ], "Skin": [ "Classic", "..." ], "Headwear": [ "Fire", "..." ], "Beard": [ "Loki’s Mischief (Blonde)", "..." ], "Eyewear": [ "Night Vision", "..." ], "Tool": [ "Axe" "..." ], } } } ``` -------------------------------- ### Example Collection Inscription (JSON) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/_media/Collection.md An example of how to structure the JSON metadata for inscribing a collection parent, adhering to the Collection protocol. ```json { "collection": { "name": "Tiny Vikings", "description": "Tiny Vikings are the vikings of Bitcoin.", "totalCount": 20000, "url": "https://tinyvikings.xyz", "allAttributes": { "Background": [ "Snowy", "Gold", "..." ], "Outfit": [ "Green Cloak", "Wizard", "..." ], "Skin": [ "Classic", "..." ], "Headwear": [ "Fire", "..." ], "Beard": [ "Loki’s Mischief (Blonde)", "..." ], "Eyewear": [ "Night Vision", "..." ], "Tool": [ "Axe" "..." ] } } } ``` -------------------------------- ### JSON Example: Release Inscription Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/_media/Music.md Example JSON for inscribing release metadata as a child of an artist, including title, type, and cover art. ```json { "release": { "title": "Tiny Vikings OST", "type": "album", "cover": { "@id": "3a504956f370c0362e48f7a1daf53d51c250c3c0d2054eb0b018d60caad0be77i0" } } } ``` -------------------------------- ### JSON Audiobook Metadata Example Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/documents/Introduction.html An example of metadata for an inscribed audiobook, specifying its title, type, artists, and tracks. Tracks are defined as inline objects conforming to the Track protocol. ```JSON { "title": "1984 Audiobook", "type": "audiobook", "artists": ["Gary Ohwell"], "tracks": [ { "title": "Part 1" }, { "title": "Part 2" } ] } ``` -------------------------------- ### Namespaced Metadata Example (JSON) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/src/docs/Index.md Demonstrates how to use namespacing in JSON metadata to avoid property name collisions when adhering to multiple Open Ordinal Metadata protocols. This example shows metadata for both a 'release' and a 'book' protocol within a single inscription. ```JSON { "release": { "title": "1984 Audiobook", "artists": ["Gary Ohwell"], "tracks": [ { "title": "Chapter 1" }, ] }, "book": { "title": "1984", "authors": ["George Orwell"] } } ``` -------------------------------- ### JSON Example: Track Inscription with Media Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/_media/Music.md Example JSON for inscribing track metadata as a child of a release, including track title, media duration, and decoder. ```json { "track": { "title": "Dream" }, "media": { "duration": 69.68299999999999, "decoder": { "@id": "6a96a763093b30319ab9f38e5043405c4853e72c86eb1107dbf92f68e64d7cb5i0" } } } ``` -------------------------------- ### Example Item Inscription (JSON) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/_media/Collection.md An example of how to structure the JSON metadata for inscribing an individual item as a child of a collection, using the Attributes protocol. ```json { "name": "Tiny Viking #0", "attributes": { "Background": "Snowy", "Outfit": "Green Cloak", "Skin": "Classic", "Headwear": "Fire", "Beard": "Loki’s Mischief (Blonde)", "Eyewear": "Night Vision", "Tool": "Axe" } } ``` -------------------------------- ### Example Item Metadata JSON Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/documents/Use_Cases.Collection.html Shows an example of JSON metadata for an individual item, combining 'Common' and 'Attributes' protocols. It specifies the item's name and its unique attributes within the collection. ```json { "name": "Tiny Viking #0", "attributes": { "Background": "Snowy", "Outfit": "Green Cloak", "Skin": "Classic", "Headwear": "Fire", "Beard": "Loki’s Mischief (Blonde)", "Eyewear": "Night Vision", "Tool": "Axe" } } ``` -------------------------------- ### JSON Metadata with Namespacing Example Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/index.html Demonstrates how to use namespacing in JSON metadata to include properties from multiple protocols (e.g., 'release' and 'book') without name collisions. ```JSON { "release": { "title": "1984 Audiobook", "artists": ["Gary Ohwell"], "tracks": [ { "title": "Chapter 1" }, ] }, "book": { "title": "1984", "authors": ["George Orwell"] } } ``` -------------------------------- ### JSON Namespaced Metadata Example (Audiobook and Book) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/documents/Introduction.html Demonstrates namespacing in JSON metadata, combining audiobook and book information within a single inscription. Each protocol's properties are nested within a dedicated object named after the protocol to prevent title collisions. ```JSON { "release": { "title": "1984 Audiobook", "artists": ["Gary Ohwell"], "tracks": [ { "title": "Chapter 1" }, ] }, "book": { "title": "1984", "authors": ["George Orwell"] } } ``` -------------------------------- ### Initialize Mermaid Diagrams (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Metadata.html Initializes Mermaid.js for rendering diagrams on the page. It adds a 'mermaid-enabled' class to the document element and configures Mermaid to start rendering on load. It also includes a mechanism to check for and insert SVG elements for Mermaid diagrams. ```JavaScript import mermaid from "https://unpkg.com/mermaid@11.3.0/dist/mermaid.esm.min.mjs"; document.documentElement.classList.add("mermaid-enabled"); mermaid.initialize({startOnLoad:true}); requestAnimationFrame(function check() { let some = false; document.querySelectorAll("div.mermaid:not(\[data-inserted\])").forEach(div => { some = true; if (div.querySelector("svg")) { div.dataset.inserted = true; } }); if (some) { requestAnimationFrame(check); } }); ``` -------------------------------- ### Google Analytics Configuration (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Module.html Configures Google Analytics by initializing the dataLayer and setting up the gtag function for tracking. This is a standard setup for integrating Google Analytics into a web page. ```JavaScript window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XHBQC2GFXJ'); ``` -------------------------------- ### JSON Namespaced Metadata Example Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/README.md Demonstrates namespacing in OOMD, where metadata for different protocols ('release' and 'book') are organized into separate objects to prevent property name collisions, even when properties like 'title' exist in both. ```JSON { "release": { "title": "1984 Audiobook", "artists": ["Gary Ohwell"], "tracks": [ { "title": "Chapter 1" }, ] }, "book": { "title": "1984", "authors": ["George Orwell"] } } ``` -------------------------------- ### Run All Build Processes Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/ReadMe.md Executes the build, schema, and documentation generation processes in sequence. ```bash npm run all ``` -------------------------------- ### Build Documentation Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/ReadMe.md Generates the project documentation. ```bash npm run docs ``` -------------------------------- ### Theme and Display Initialization Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.BootstrapResource.html Initializes the theme from local storage and sets up the display logic for the application, ensuring the body is shown after a short delay or when the app is ready. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Build and Minimize Library Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/ReadMe.md Builds the source code into the 'lib' folder and then minimizes it into the 'dist' folder. ```bash npm run build ``` -------------------------------- ### Set Theme and Show Page Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.BootstrapOpenOrdinalModules.html Initializes the application's theme from local storage and controls the display of the page content after a short delay. This script ensures the UI is ready before becoming visible. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Initialize Theme and Show Page Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/modules/OOMD.html This JavaScript snippet initializes the application's theme based on local storage or OS preference and controls the display of the main content. It sets the theme and then uses a timeout to ensure the application or body content is displayed after a short delay. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Set Theme and Show Page Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.DecoderModule.html Sets the theme from local storage or defaults to 'os', hides the body, and then shows the page after a delay, either by calling app.showPage() or removing the display style. ```JavaScript Metadatocument.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Build Schema Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/ReadMe.md Generates the schema for the library. ```bash npm run schema ``` -------------------------------- ### Set Theme and Show Page (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Chapter.html This JavaScript code snippet sets the theme for the document based on local storage and then displays the page content after a short delay. It handles cases where the 'app' object might not be immediately available. ```javascript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### JavaScript Theme and Display Logic Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Common.html This JavaScript snippet demonstrates how to set the theme based on local storage and manage the initial display of the application. It hides the body and then reveals it after a short delay, potentially showing the app's main page. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Initialize Theme and Display Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.DecoderResult.html Initializes the theme based on local storage and sets the body display to none, then shows the page after a delay. This is a common pattern for initializing web applications with theme support and smooth loading. ```JavaScript Metadatadocument.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### JavaScript for Theme and Display Management Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Book.html This JavaScript code snippet sets the theme based on local storage, hides the body initially, and then shows the page content after a short delay, potentially by calling an 'app.showPage()' method or removing the display style. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Theme Initialization Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Bootstrap.html Initializes the theme based on local storage or defaults to 'os'. It also hides the body content temporarily and shows it after a short delay or when the app is ready. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### JavaScript Theme Management Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/modules.html This snippet manages the theme of the application by reading from local storage or defaulting to 'os'. It also controls the initial display of the body and shows the application page after a short delay. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Theme and Page Display Management (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Module.html This snippet demonstrates how to manage the theme of a web page by reading from local storage and controlling the page's display until the application is ready. It sets the theme and uses a timeout to reveal the page content. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Set Theme and Load App - JavaScript Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/enums/OOMD.BootstrapMode.html Sets the theme from local storage and controls the display of the application or body element after a delay. This script is responsible for initializing the UI based on user preferences and application state. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Set Theme and Show Page Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/hierarchy.html This JavaScript code snippet sets the theme based on local storage or OS preference and controls the display of the application page after a short delay. It ensures the page is visible after potential loading or initialization processes. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Release Protocol Definition (TypeScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/markdown/documents/Introduction.md Defines the structure for Release metadata, including type, title, cover, artists, and tracks. It uses linked types for artists and tracks, allowing for inline objects or references to other inscriptions. ```TypeScript export interface Release { type: "album" | "single" | "ep" | "compilation" | "audiobook" | string; title: string; cover?: LinkedVisual; artists?: (Linked | string)[]; // otherwise assumed to be parent inscriptions implementing Artist tracks?: Linked[]; // otherwise assumed to be child inscriptions implementing Track } ``` -------------------------------- ### Set Theme and Show Page with Timeout Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Torrent.html This JavaScript code snippet sets the document's theme based on local storage and then displays the page content after a short delay. It handles cases where the 'app' object might not be immediately available. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Initialize Theme and Display Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Stitch.html This JavaScript code snippet initializes the theme based on local storage and controls the initial display of the body element, showing the app or removing the display property after a short delay. ```javascript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Google Analytics Configuration Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Artist.html Configures Google Analytics by initializing the dataLayer and setting up the gtag function to send events and page views. ```javascript window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-XHBQC2GFXJ'); ``` -------------------------------- ### Set Theme from Local Storage Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/documents/Use_Cases.html This JavaScript code snippet retrieves the theme preference from local storage or defaults to 'os'. It then applies this theme to the document's dataset. The code also includes a mechanism to initially hide the body and then display it after a short delay, potentially to allow for theme application or initial rendering. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Set Theme from Local Storage (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Media.html This JavaScript code snippet retrieves the theme preference from local storage, defaulting to 'os' if not found, and applies it to the document's data attributes. It also handles the initial display of the body content after a short delay. ```javascript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Set Theme and Show Page (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Organization.html This JavaScript code snippet sets the theme for the document based on local storage and controls the display of the body element. It ensures the application or page content is shown after a short delay. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Set Theme and Display Logic in JavaScript Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Author.html This JavaScript code snippet sets the document's theme based on local storage or defaults to 'os'. It then hides the body and uses a timeout to either display the application or remove the display property from the body. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Set Theme and Display Delay in JavaScript Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Collection.html This JavaScript code snippet sets the theme based on local storage or defaults to 'os'. It then hides the body and uses a timeout to either show the app or remove the display style, likely for a smooth page transition. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Google Analytics Configuration Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.BootstrapResource.html Configures Google Analytics by initializing the dataLayer and setting up the gtag event for page view tracking. ```JavaScript window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XHBQC2GFXJ'); ``` -------------------------------- ### Mermaid Graph: Music Logic Structure (Default Theme) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/documents/Use_Cases.Music.html Visualizes the hierarchical relationship between Artist, Releases, Tracks, and Media using Mermaid syntax with the default theme. ```mermaid %%{init:{"theme":"default"}}%% graph LR Artist --> r1[Release 1] Artist --> r2[Release 2] r1 --> r1t1[Track 1] r1t1 --> t1m1[Media] r1 --> r1t2[Track 2] r1t2 --> t2m2[Media] r2 --> r2t1[Track 1] r2t1 --> t2m1[Media] ``` -------------------------------- ### Set Theme and Show Page Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/documents/ChangeLog.html This JavaScript code snippet sets the theme based on local storage or OS preference and controls the display of the application page after a short delay. It ensures the page is visible after the application is ready or a timeout occurs. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Mermaid Initialization Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/documents/Use_Cases.Music.html This JavaScript snippet initializes the Mermaid library to render diagrams from SVG elements within the document. It includes a check to ensure Mermaid is enabled and handles the rendering process. ```javascript import mermaid from "https://unpkg.com/mermaid@11.3.0/dist/mermaid.esm.min.mjs"; document.documentElement.classList.add("mermaid-enabled"); mermaid.initialize({startOnLoad:true}); requestAnimationFrame(function check() { let some = false; document.querySelectorAll("div.mermaid:not(\"[data-inserted]")").forEach(div => { some = true; if (div.querySelector("svg")) { div.dataset.inserted = true; } }); if (some) { requestAnimationFrame(check); } }); ``` -------------------------------- ### Set Theme and Show Page (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/types/OOMD.Link.html This JavaScript code snippet sets the document's theme based on local storage and controls the display of the application or body element after a short delay. It's used for initializing the UI and applying user preferences. ```javascript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Theme and Display Settings Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/types/OOMD.DecoderFunction.html This snippet demonstrates how to set the theme based on local storage and control the initial display of the body element. It includes a timeout to show the page after the app is ready or after a delay. ```javascript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Set Theme and Show Page Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Attributes.html This JavaScript code snippet sets the theme based on local storage or OS preference and controls the display of the application page after a short delay. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Set Theme and Show Page - JavaScript Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/types/OOMD.Linked.html This JavaScript code snippet sets the theme from local storage and controls the display of the page content. It waits for 500 milliseconds before showing the page, potentially using an 'app' object or removing a display style. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Set Theme and Display Delay Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Artist.html This JavaScript snippet sets the theme based on local storage and controls the initial display of the body element, delaying its visibility until the application is ready or a timeout occurs. ```javascript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Google Analytics Configuration Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/modules.html This JavaScript code configures Google Analytics by initializing the dataLayer and setting up the gtag function for tracking events and page views. ```JavaScript window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-XHBQC2GFXJ'); ``` -------------------------------- ### Release Protocol Definition (TypeScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/src/docs/Index.md Defines the structure for metadata related to releases (albums, singles, audiobooks, etc.) within the Open Ordinal Metadata standard. It includes properties like type, title, cover, artists, and tracks, with support for linked objects or references. ```TypeScript export interface Release { type: "album" | "single" | "ep" | "compilation" | "audiobook" | string; title: string; cover?: LinkedVisual; artists?: (Linked | string)[]; // otherwise assumed to be parent inscriptions implementing Artist tracks?: Linked[]; // otherwise assumed to be child inscriptions implementing Track } ``` -------------------------------- ### Set Theme and Show Page (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/types/OOMD.SatNo.html This snippet sets the theme based on local storage or OS preference and controls the display of the page content after a short delay. It's used for initializing the user interface. ```JavaScript document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"; document.body.style.display="none"; setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500) ``` -------------------------------- ### Mermaid Initialization and Rendering Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/documents/Use_Cases.Collection.html JavaScript code for initializing and rendering Mermaid diagrams dynamically on a webpage. It includes logic to detect and insert Mermaid diagrams that are not yet rendered. ```javascript import mermaid from "https://unpkg.com/mermaid@11.3.0/dist/mermaid.esm.min.mjs"; document.documentElement.classList.add("mermaid-enabled"); mermaid.initialize({startOnLoad:true}); requestAnimationFrame(function check() { let some = false; document.querySelectorAll("div.mermaid:not(\[data-inserted\])").forEach(div => { some = true; if (div.querySelector("svg")) { div.dataset.inserted = true; } }); if (some) { requestAnimationFrame(check); } }); ``` -------------------------------- ### Google Analytics Configuration (JavaScript) Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/interfaces/OOMD.Organization.html This JavaScript code configures Google Analytics by initializing the dataLayer and setting up the gtag function for tracking events and page views. ```JavaScript window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XHBQC2GFXJ'); ``` -------------------------------- ### Google Analytics Configuration Source: https://github.com/open-ordinal/open-ordinal-metadata/blob/develop/docs/html/hierarchy.html This JavaScript code configures Google Analytics (gtag.js) by initializing the dataLayer and setting the configuration for tracking. It's a standard implementation for integrating website analytics. ```JavaScript window.dataLayer = window.dataLayer || []; function gtag(){ dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'G-XHBQC2GFXJ'); ```