### Install and Run Markwhen Timeline (Bash) Source: https://github.com/mark-when/timeline/blob/main/README.md Instructions to clone the Markwhen timeline repository, install dependencies, and run the development server. This process requires Node.js version 18 or higher and npm. The timeline will be available on port 6180 and is automatically detected by Meridiem. ```bash git clone https://github.com/mark-when/timeline.git cd timeline npm i npm run dev ``` -------------------------------- ### Configure Timeline Plugin Metadata (JSON) Source: https://context7.com/mark-when/timeline/llms.txt Defines the metadata for the OG Timeline plugin used in the Markwhen ecosystem. This JSON object specifies the plugin's name, a description of its features (timeline and Gantt chart views), the repository URL, an SVG path for its icon, example screenshots, and attribution. ```json { "name": "OG Timeline", "description": "A graph-like representation of events in a cascading timeline. Optionally view as a gantt chart as well.", "repo": "https://github.com/mark-when/timeline", "iconSvgPath": "M 8 12 h 11 L 19 13 L 8 13 Z Z Z M 12 18 h 8 L 20 19 L 12 19 Z Z M 5 6 L 8 6 L 8 7 L 5 7 Z M 6 16 Q 7 16 7 17 L 7 20 Q 7 21 6 21 L 5 21 Q 4 21 4 20 L 4 17 Q 4 16 5 16 Z", "screenshots": [ "https://timeline.markwhen.com/timeline1.png", "https://timeline.markwhen.com/timeline2.png" ], "by": "markwhen" } ``` -------------------------------- ### Build Markwhen Timeline (Bash) Source: https://github.com/mark-when/timeline/blob/main/README.md Command to build the Markwhen timeline project for production. This command bundles all HTML, CSS, and JavaScript assets into a single `index.html` file located in the `dist/` directory. ```bash npm run build ``` -------------------------------- ### TypeScript: Main Application Entry Point for Vue App Source: https://context7.com/mark-when/timeline/llms.txt This script serves as the main entry point for the Vue application, initializing the Vue instance with Pinia for state management and Vue Router for navigation. It also conditionally injects Vue DevTools for development environments. Dependencies include Vue, Pinia, and Vue Router. ```typescript // main.ts setup import { createApp } from "vue"; import { createPinia } from "pinia"; import App from "./App.vue"; import router from "@/router/router"; import "./assets/main.css"; const app = createApp(App); const pinia = createPinia(); app.use(router); app.use(pinia); app.mount("#app"); // Vue DevTools in development if (import.meta.env.DEV) { const script = document.createElement("script"); script.src = "http://localhost:8098"; document.head.append(script); } ``` -------------------------------- ### Manage Timeline State with Markwhen Store (TypeScript) Source: https://context7.com/mark-when/timeline/llms.txt Demonstrates how to use the Pinia store for managing parsed timeline data, application configuration, and bidirectional communication with parent applications using the LPC protocol. It covers accessing data, updating hover states, creating and editing events, loading data from URL hashes, and generating shareable links. ```typescript import { useMarkwhenStore } from "./Markwhen/markwhenStore"; import { parse } from "@markwhen/parser"; // Initialize store in component const markwhenStore = useMarkwhenStore(); // Access parsed timeline data const timeline = markwhenStore.markwhen?.parsed; const events = markwhenStore.markwhen?.transformed; // Set hovering state for event highlighting markwhenStore.setHoveringPath({ type: "pageFilePath", path: "page/0/1/2" }); // Create new event from date range markwhenStore.createEventFromRange( { fromDateTimeIso: "2024-01-15T10:00:00.000Z", toDateTimeIso: "2024-01-15T12:00:00.000Z" }, "hour", true ); // Edit existing event's date range markwhenStore.editEventDateRange( { type: "pageFilePath", path: "page/0/1" }, { fromDateTimeIso: "2024-01-20T09:00:00.000Z", toDateTimeIso: "2024-01-20T17:00:00.000Z" }, "hour", undefined ); // Load timeline from URL hash // URL format: #mw=base64EncodedMarkwhenText const encoded = btoa("2024-01-01: Project started\n2024-02-01: First milestone"); window.location.hash = `#mw=${encoded}`; // Generate shareable links console.log(markwhenStore.editorLink); // https://meridiem.markwhen.com/... console.log(markwhenStore.timelineLink); // https://timeline.markwhen.com/... console.log(markwhenStore.embedLink); //