### Install project dependencies Source: https://github.com/baldissaramatheus/tasks.md/blob/main/frontend/README.md Use this command to install all required project dependencies after cloning the repository. ```bash $ npm install # or pnpm install or yarn install ``` -------------------------------- ### Run development server Source: https://github.com/baldissaramatheus/tasks.md/blob/main/frontend/README.md Starts the application in development mode with hot reloading enabled. ```bash npm dev ``` ```bash npm start ``` -------------------------------- ### Docker Installation Command Source: https://github.com/baldissaramatheus/tasks.md/blob/main/README.md Use this command to run Tasks.md as a Docker container. Ensure PUID and PGID are set to your user's IDs and map local directories for tasks and configuration. ```bash docker run -d \ --name tasks.md \ -e PUID=1000 \ -e PGID=1000 \ -e TITLE="" \ -e BASE_PATH="" \ -e LOCAL_IMAGES_CLEANUP_INTERVAL=1440 \ -p 8080:8080 \ -v /path/to/tasks/:/tasks/ \ -v /path/to/config/:/config/ \ --restart unless-stopped \ baldissaramatheus/tasks.md ``` -------------------------------- ### Get Resources (Lanes and Cards) Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Retrieves all lanes and their associated cards from a specified board path. Use this to fetch the current state of your task board. ```bash curl -X GET "http://localhost:8080/_api/resource/" # Get lanes and cards from a specific sub-board curl -X GET "http://localhost:8080/_api/resource/project-alpha" ``` -------------------------------- ### GET /_api/title Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Retrieves the configured board title from the TITLE environment variable. ```APIDOC ## GET /_api/title ### Description Retrieves the configured board title from the TITLE environment variable. ### Method GET ### Endpoint /_api/title ### Response #### Success Response (200) - **title** (string) - The configured board title. #### Response Example "My Task Board" ``` -------------------------------- ### Implement Card Movement Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Example implementation for moving a card to a different lane. This function sends a PATCH request to the API with the new path for the card. Requires the 'api' client to be imported. ```javascript // Example: Implementing card movement function moveCardToLane(card, targetLane) { fetch(`${api}/resource/${encodeURIComponent(card.lane)}/${encodeURIComponent(card.name)}.md`, { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ newPath: `/${targetLane}/${card.name}.md` }) }); } ``` -------------------------------- ### Get Resources (Lanes and Cards) Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Retrieves all lanes and their cards for a given board path. Each lane contains file metadata including content, last updated time, and creation time. ```APIDOC ## GET /_api/resource ### Description Retrieves all lanes (directories) and their cards (Markdown files) for a given board path. Returns an array of lanes, each containing file metadata including content, last updated time, and creation time. ### Method GET ### Endpoint `/_api/resource` ### Query Parameters - **boardPath** (string) - Optional - The path to the specific board to retrieve resources from. If not provided, the root board is used. ### Response #### Success Response (200) - **Array of Lanes**: Each lane object contains: - **name** (string) - The name of the lane. - **files** (Array of File Objects) - An array of files within the lane. Each file object contains: - **name** (string) - The name of the file (card). - **content** (string) - The Markdown content of the file. - **lastUpdated** (string) - The last updated timestamp of the file. - **createdAt** (string) - The creation timestamp of the file. ### Request Example ```bash # Get all lanes and cards from root board curl -X GET "http://localhost:8080/_api/resource/" # Get lanes and cards from a specific sub-board curl -X GET "http://localhost:8080/_api/resource/project-alpha" ``` ### Response Example ```json [ { "name": "Backlog", "files": [ { "name": "implement-feature", "content": "[tag:urgent] [due:2024-12-01]\n\n# Implement Feature\n\nDescription here...", "lastUpdated": "2024-01-15T10:30:00.000Z", "createdAt": "2024-01-10T08:00:00.000Z" } ] }, { "name": "In Progress", "files": [] } ] ``` ``` -------------------------------- ### Get and Update Tags Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Retrieves tag color configurations for a board or updates tag colors. Tags are stored in the config directory as JSON. ```APIDOC ## Tags API (/api/tags) ### Description Retrieves tag color configurations for a board or updates tag colors. Tags are stored in the config directory as JSON. ### Method GET, PATCH ### Endpoint `/_api/tags/[boardPath]` (GET) `/_api/tags/` (PATCH) ### Parameters #### Path Parameters (for GET) - **boardPath** (string) - Optional - The path to the specific board to retrieve tags from. If not provided, the root board's tags are retrieved. #### Request Body (for PATCH) - **tagColors** (Object) - A mapping of tag names to their CSS color variable values. - **tagName** (string) - The name of the tag. - **colorValue** (string) - The CSS color variable (e.g., `var(--color-alt-1)`). ### Request Example ```bash # Get tags for root board curl -X GET "http://localhost:8080/_api/tags/" # Get tags for a specific board curl -X GET "http://localhost:8080/_api/tags/project-alpha" # Update tag colors (maps tag names to CSS color variables) curl -X PATCH "http://localhost:8080/_api/tags/" \ -H "Content-Type: application/json" \ -d '{ "urgent": "var(--color-alt-1)", "feature": "var(--color-alt-3)", "bug": "var(--color-alt-2)" }' ``` ### Response (GET) #### Success Response (200) - **tagColors** (Object) - A mapping of tag names to their CSS color variable values. - **tagName** (string) - The name of the tag. - **colorValue** (string) - The CSS color variable. ### Response Example (GET) ```json { "urgent": "var(--color-alt-1)", "feature": "var(--color-alt-3)", "bug": "var(--color-alt-2)" } ``` ``` -------------------------------- ### Get and Update Tags Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Manages tag color configurations for your boards. You can retrieve existing tag colors or update them by mapping tag names to CSS color variables. ```bash # Get tags for root board curl -X GET "http://localhost:8080/_api/tags/" # Get tags for a specific board curl -X GET "http://localhost:8080/_api/tags/project-alpha" # Update tag colors (maps tag names to CSS color variables) curl -X PATCH "http://localhost:8080/_api/tags/" \ -H "Content-Type: application/json" \ -d '{ "urgent": "var(--color-alt-1)", "feature": "var(--color-alt-3)", "bug": "var(--color-alt-2)" }' ``` -------------------------------- ### Get and Update Sort Order Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Retrieves or updates the manual sort order of lanes and cards within lanes. ```APIDOC ## Sort Order API (/api/sort) ### Description Retrieves or updates the manual sort order of lanes and cards within lanes. ### Method GET, PUT ### Endpoint `/_api/sort/` ### Parameters #### Request Body (for PUT) - **laneSortOrder** (Object) - A mapping of lane names to arrays of card names in their desired order. - **laneName** (string) - The name of the lane. - **cardNames** (Array of strings) - An array of card names in the desired display order within that lane. ### Request Example ```bash # Get sort order for root board curl -X GET "http://localhost:8080/_api/sort/" # Update sort order (maps lane names to arrays of card names) curl -X PUT "http://localhost:8080/_api/sort/" \ -H "Content-Type: application/json" \ -d '{ "Backlog": ["high-priority-task", "medium-task", "low-priority"], "In Progress": ["current-work"], "Done": ["completed-task-1", "completed-task-2"] }' ``` ### Response (GET) #### Success Response (200) - **laneSortOrder** (Object) - A mapping of lane names to arrays of card names in their current sort order. - **laneName** (string) - The name of the lane. - **cardNames** (Array of strings) - An array of card names in the current display order. ### Response Example (GET) ```json { "Backlog": ["high-priority-task", "medium-task", "low-priority"], "In Progress": ["current-work"], "Done": ["completed-task-1", "completed-task-2"] } ``` ``` -------------------------------- ### Get and Update Sort Order Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Manages the manual sort order of lanes and cards. You can retrieve the current sort order or update it by providing a JSON object that maps lane names to ordered arrays of card names. ```bash # Get sort order for root board curl -X GET "http://localhost:8080/_api/sort/" # Update sort order (maps lane names to arrays of card names) curl -X PUT "http://localhost:8080/_api/sort/" \ -H "Content-Type: application/json" \ -d '{ "Backlog": ["high-priority-task", "medium-task", "low-priority"], "In Progress": ["current-work"], "Done": ["completed-task-1", "completed-task-2"] }' ``` -------------------------------- ### Build for production Source: https://github.com/baldissaramatheus/tasks.md/blob/main/frontend/README.md Compiles the application into the dist folder with minification and performance optimizations. ```bash npm run build ``` -------------------------------- ### Deploy with Docker Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Commands for deploying the container with volume mounts and environment variables. ```bash # Basic deployment docker run -d \ --name tasks.md \ -e PUID=1000 \ -e PGID=1000 \ -p 8080:8080 \ -v /path/to/tasks:/tasks \ -v /path/to/config:/config \ --restart unless-stopped \ baldissaramatheus/tasks.md # Full deployment with all options docker run -d \ --name tasks.md \ -e PUID=1000 \ -e PGID=1000 \ -e TITLE="My Project Board" \ -e BASE_PATH="/tasks" \ -e LOCAL_IMAGES_CLEANUP_INTERVAL=1440 \ -p 8080:8080 \ -v ~/Documents/tasks:/tasks \ -v ~/.config/tasks.md:/config \ --restart unless-stopped \ baldissaramatheus/tasks.md ``` -------------------------------- ### Create Resource (Lane or Card) Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Creates a new lane (directory) or a new card (Markdown file) within a specified path. For cards, you can provide initial content and metadata. ```bash # Create a new lane curl -X POST "http://localhost:8080/_api/resource/NewLane" \ -H "Content-Type: application/json" # Create a new card with initial content curl -X POST "http://localhost:8080/_api/resource/Backlog/my-new-task.md" \ -H "Content-Type: application/json" \ -d '{ "isFile": true, "content": "[tag:feature]\n\n# My New Task\n\nTask description here." }' # Create an empty card curl -X POST "http://localhost:8080/_api/resource/Backlog/empty-card.md" \ -H "Content-Type: application/json" \ -d '{"isFile": true}' ``` -------------------------------- ### Deploy with Docker Compose Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Configuration file for managing the service deployment. ```yaml # docker-compose.yml version: "3" services: tasks.md: image: baldissaramatheus/tasks.md container_name: tasks.md environment: - PUID=1000 - PGID=1000 - TITLE=Project Tasks - LOCAL_IMAGES_CLEANUP_INTERVAL=720 volumes: - ./tasks:/tasks - ./config:/config restart: unless-stopped ports: - 8080:8080 ``` -------------------------------- ### Create Resource (Lane or Card) Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Creates a new lane (directory) or card (Markdown file). For cards, `isFile` should be set to true. ```APIDOC ## POST /_api/resource ### Description Creates a new lane (directory) or card (Markdown file). For cards, set `isFile: true` and optionally provide initial content. ### Method POST ### Endpoint `/_api/resource/[laneName]/[cardName.md]` or `/_api/resource/[newLaneName]` ### Parameters #### Path Parameters - **laneName** (string) - Optional - The name of the lane where the new card will be created. If creating a lane, this is the name of the new lane. - **cardName.md** (string) - Optional - The name of the new card file. Required when creating a card. - **newLaneName** (string) - Optional - The name of the new lane to create. Required when creating a lane. #### Request Body - **isFile** (boolean) - Required - Set to `true` if creating a card (file). Omit or set to `false` if creating a lane (directory). - **content** (string) - Optional - The initial Markdown content for the new card. ### Request Example ```bash # Create a new lane curl -X POST "http://localhost:8080/_api/resource/NewLane" \ -H "Content-Type: application/json" # Create a new card with initial content curl -X POST "http://localhost:8080/_api/resource/Backlog/my-new-task.md" \ -H "Content-Type: application/json" \ -d '{ "isFile": true, "content": "[tag:feature]\n\n# My New Task\n\nTask description here." }' # Create an empty card curl -X POST "http://localhost:8080/_api/resource/Backlog/empty-card.md" \ -H "Content-Type: application/json" \ -d '{"isFile": true}' ``` ``` -------------------------------- ### Retrieve Board Title via API Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Fetches the configured board title from the TITLE environment variable. ```bash curl -X GET "http://localhost:8080/_api/title" # Response: "My Task Board" ``` -------------------------------- ### Customize Theme with CSS Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Define custom colors and import built-in themes using CSS custom properties in `/config/stylesheets/custom.css`. Supports dark mode overrides. ```css /* /config/stylesheets/custom.css */ /* Import a built-in theme (adwaita, nord, or catppuccin) */ @import url("/stylesheets/color-themes/catppuccin.css"); /* Or define custom colors */ :root { /* Main colors */ --color-accent: #7c3aed; /* Highlight/accent color */ --color-foreground: #1f2937; /* Text color */ /* Background layers (darkest to lightest) */ --color-background-1: #f9fafb; /* Main app background */ --color-background-2: #f3f4f6; /* Lanes, header, dialogs */ --color-background-3: #ffffff; /* Cards */ --color-background-4: #e5e7eb; /* Buttons, inputs */ /* Tag colors (used for [tag:name] elements) */ --color-alt-1: #ef4444; /* Red - errors, past due */ --color-alt-2: #f97316; /* Orange */ --color-alt-3: #eab308; /* Yellow - current due date */ --color-alt-4: #22c55e; /* Green */ --color-alt-5: #06b6d4; /* Cyan */ --color-alt-6: #3b82f6; /* Blue */ --color-alt-7: #8b5cf6; /* Purple */ } /* Dark mode overrides */ @media (prefers-color-scheme: dark) { :root { --color-foreground: #f9fafb; --color-background-1: #111827; --color-background-2: #1f2937; --color-background-3: #374151; --color-background-4: #4b5563; } } ``` -------------------------------- ### Keyboard Shortcuts Reference Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt A reference object mapping keyboard keys to actions within the Tasks.md application, including navigation, card movement, and general actions. This object is used to implement keyboard-driven interactions. ```javascript // Keyboard shortcuts reference const keyboardShortcuts = { // Navigation (vim-style) 'ArrowDown': 'Move to card below', 'j': 'Move to card below (vim)', 'ArrowUp': 'Move to card above', 'k': 'Move to card above (vim)', 'ArrowRight': 'Move to first card in next lane', 'l': 'Move to first card in next lane (vim)', 'ArrowLeft': 'Move to first card in previous lane', 'h': 'Move to first card in previous lane (vim)', // Card movement (with Alt modifier) 'Alt+ArrowUp': 'Move card up within lane', 'Alt+ArrowDown': 'Move card down within lane', 'Alt+ArrowLeft': 'Move card to previous lane', 'Alt+ArrowRight': 'Move card to next lane', // Card actions 'Enter': 'Open/edit focused card', 'e': 'Open/edit focused card', 'n': 'Create new card in current lane', 'r': 'Rename focused card', 'd': 'Delete focused card (with confirmation)', // General 'Escape': 'Clear focus / close dialog', '?': 'Show keyboard shortcuts help' }; ``` -------------------------------- ### Fetch Board Data Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Fetches all data for the current board, including resources, tags, and sort order. It then transforms resources into lanes and cards, and sorts cards by manual sort order. Requires the 'api' client to be imported. ```javascript import { api } from "./api"; // Fetch all data for the current board async function fetchBoardData(boardPath = "") { const [resources, tags, sortOrder] = await Promise.all([ fetch(`${api}/resource${boardPath}`).then(res => res.json()), fetch(`${api}/tags${boardPath}`).then(res => res.json()), fetch(`${api}/sort${boardPath}`).then(res => res.json()) ]); // Transform resources into lanes and cards const lanes = resources.map(r => r.name); const cards = resources.flatMap(resource => resource.files.map(file => ({ ...file, lane: resource.name, tags: extractTags(file.content), dueDate: extractDueDate(file.content) })) ); // Sort cards by manual sort order const sortedCards = cards.sort((a, b) => { const indexA = sortOrder[a.lane]?.indexOf(a.name) ?? -1; const indexB = sortOrder[b.lane]?.indexOf(b.name) ?? -1; return indexA - indexB; }); return { lanes, cards: sortedCards, tags }; } ``` -------------------------------- ### Docker Compose Configuration Source: https://github.com/baldissaramatheus/tasks.md/blob/main/README.md A docker-compose configuration for setting up Tasks.md. It mirrors the environment variables and volume mappings from the Docker run command. ```yaml version: "3" services: tasks.md: image: baldissaramatheus/tasks.md container_name: tasks.md environment: - PUID=1000 - PGID=1000 volumes: - /path/to/tasks:/tasks - /path/to/config:/config restart: unless-stopped ports: - 8080:8080 ``` -------------------------------- ### Update Resource (Rename or Update Content) Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Updates the content of an existing card or renames/moves a resource (card or lane) by specifying a new path. Ensure the `newPath` format is correct for renaming or moving. ```bash # Update card content curl -X PATCH "http://localhost:8080/_api/resource/Backlog/my-task.md" \ -H "Content-Type: application/json" \ -d '{ "content": "[tag:urgent] [tag:bug] [due:2024-12-15]\n\n# Updated Task\n\nNew content with tags and due date." }' # Rename a card (move within same lane) curl -X PATCH "http://localhost:8080/_api/resource/Backlog/old-name.md" \ -H "Content-Type: application/json" \ -d '{"newPath": "/Backlog/new-name.md"}' # Move card to different lane curl -X PATCH "http://localhost:8080/_api/resource/Backlog/my-task.md" \ -H "Content-Type: application/json" \ -d '{"newPath": "/Done/my-task.md"}' # Rename a lane curl -X PATCH "http://localhost:8080/_api/resource/OldLaneName" \ -H "Content-Type: application/json" \ -d '{"newPath": "/NewLaneName"}' ``` -------------------------------- ### Delete Resource Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Deletes a specified card (file) or an entire lane (directory and its contents). Use with caution as deletion is permanent. ```bash # Delete a card curl -X DELETE "http://localhost:8080/_api/resource/Backlog/task-to-delete.md" # Delete an entire lane and all its cards curl -X DELETE "http://localhost:8080/_api/resource/OldLane" ``` -------------------------------- ### Manage Due Dates in Markdown Content Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Utility functions for setting and retrieving due dates formatted as [due:YYYY-MM-DD]. ```javascript import { setDueDateInContent, getDueDateFromContent } from './card-content-utils'; // Set a due date on content without one const content = "[tag:feature]\n\n# Implement API"; const withDueDate = setDueDateInContent(content, "2024-12-31"); // Result: "[due:2024-12-31]\n\n[tag:feature]\n\n# Implement API" // Update an existing due date const existingContent = "[due:2024-12-01]\n\n# Old Task"; const updatedContent = setDueDateInContent(existingContent, "2024-12-15"); // Result: "[due:2024-12-15]\n\n# Old Task" // Extract due date from content const dueDate = getDueDateFromContent("[due:2024-12-01] [tag:urgent]\n\n# Task"); // Result: "2024-12-01" const noDueDate = getDueDateFromContent("# Task without due date"); // Result: null ``` -------------------------------- ### Upload Image Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Uploads an image file to be used within cards. The API returns a generated filename, typically UUID-based, which you can then reference in your Markdown content. ```bash # Upload an image curl -X POST "http://localhost:8080/_api/image" \ -F "file=@screenshot.png" ``` -------------------------------- ### Upload Image Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Uploads an image file for embedding in cards. Returns the generated filename (UUID-based). ```APIDOC ## POST /_api/image ### Description Uploads an image file for embedding in cards. Returns the generated filename (UUID-based). ### Method POST ### Endpoint `/_api/image` ### Parameters #### Form Data - **file** (File) - Required - The image file to upload. ### Request Example ```bash # Upload an image curl -X POST "http://localhost:8080/_api/image" \ -F "file=@screenshot.png" ``` ### Response #### Success Response (200) - **filename** (string) - The generated filename (UUID) of the uploaded image. ### Response Example ```json { "filename": "a1b2c3d4-e5f6-7890-1234-567890abcdef.png" } ``` ``` -------------------------------- ### Update Resource (Rename or Update Content) Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Updates a card's content or renames/moves a card or lane. The `newPath` parameter is used for renaming and moving. ```APIDOC ## PATCH /_api/resource ### Description Updates a card's content or renames/moves a card or lane. The `newPath` parameter moves the resource to a new location. ### Method PATCH ### Endpoint `/_api/resource/[currentPath]` ### Parameters #### Path Parameters - **currentPath** (string) - Required - The current path of the resource (lane or card) to update. #### Request Body - **content** (string) - Optional - The new Markdown content for the card. Use this to update a card's content. - **newPath** (string) - Optional - The new path for the resource. Use this to rename or move a card or lane. The path should include the filename for cards (e.g., `/NewLane/new-card-name.md`) or just the lane name for lanes (e.g., `/NewLaneName`). ### Request Example ```bash # Update card content curl -X PATCH "http://localhost:8080/_api/resource/Backlog/my-task.md" \ -H "Content-Type: application/json" \ -d '{ "content": "[tag:urgent] [tag:bug] [due:2024-12-15]\n\n# Updated Task\n\nNew content with tags and due date." }' # Rename a card (move within same lane) curl -X PATCH "http://localhost:8080/_api/resource/Backlog/old-name.md" \ -H "Content-Type: application/json" \ -d '{"newPath": "/Backlog/new-name.md"}' # Move card to different lane curl -X PATCH "http://localhost:8080/_api/resource/Backlog/my-task.md" \ -H "Content-Type: application/json" \ -d '{"newPath": "/Done/my-task.md"}' # Rename a lane curl -X PATCH "http://localhost:8080/_api/resource/OldLaneName" \ -H "Content-Type: application/json" \ -d '{"newPath": "/NewLaneName"}' ``` ``` -------------------------------- ### Create New Card Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Creates a new card in a specified lane with an optional content. This function sends a POST request to the API. ```javascript // Create a new card async function createCard(lane, cardName, content = "") { await fetch(`${api}/resource/${encodeURIComponent(lane)}/${encodeURIComponent(cardName)}.md`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ isFile: true, content }) }); } ``` -------------------------------- ### Bulk Set Due Date for Cards Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Sets a due date for multiple selected cards. It maps over the selected cards, updates their content with the new due date, and sends PATCH requests to the API. Requires helper functions 'setDueDateInContent'. ```javascript // Bulk set due date async function bulkSetDueDate(selectedCards, dueDate, boardPath = "") { const updatePromises = selectedCards.map(async (card) => { const newContent = setDueDateInContent(card.content || "", dueDate); return fetch(`${api}/resource${boardPath}/${encodeURIComponent(card.lane)}/${encodeURIComponent(card.name)}.md`, { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ content: newContent }) }); }); await Promise.all(updatePromises); } ``` -------------------------------- ### Delete Resource Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Deletes a card (file) or lane (directory with all contents). ```APIDOC ## DELETE /_api/resource ### Description Deletes a card (file) or lane (directory with all contents). ### Method DELETE ### Endpoint `/_api/resource/[resourcePath]` ### Parameters #### Path Parameters - **resourcePath** (string) - Required - The path to the card or lane to delete. ### Request Example ```bash # Delete a card curl -X DELETE "http://localhost:8080/_api/resource/Backlog/task-to-delete.md" # Delete an entire lane and all its cards curl -X DELETE "http://localhost:8080/_api/resource/OldLane" ``` ``` -------------------------------- ### Manage Tags in Markdown Content Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Utility functions for adding, removing, and extracting tags formatted as [tag:tagname]. ```javascript import { addTagToContent, removeTagFromContent, getTagsFromContent } from './card-content-utils'; // Add a tag to card content const content = "# My Task\n\nTask description"; const withTag = addTagToContent(content, "urgent"); // Result: "[tag:urgent] \n\n# My Task\n\nTask description" // Add multiple tags let multiTagContent = addTagToContent(content, "feature"); multiTagContent = addTagToContent(multiTagContent, "high-priority"); // Result: "[tag:high-priority] [tag:feature] \n\n# My Task\n\nTask description" // Remove a tag from content const withoutUrgent = removeTagFromContent(multiTagContent, "feature"); // Result: "[tag:high-priority] \n\n# My Task\n\nTask description" // Extract all tags from content const cardContent = "[tag:bug] [tag:urgent] [due:2024-12-01]\n\n# Fix Login Issue"; const tags = getTagsFromContent(cardContent); // Result: ["bug", "urgent"] ``` -------------------------------- ### Bulk Add Tag to Cards Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Adds a specified tag to multiple selected cards. It iterates through selected cards, updates their content with the new tag, and sends PATCH requests to the API. Requires helper functions 'addTagToContent'. ```javascript // Bulk add tag to multiple cards async function bulkAddTag(selectedCards, tagName, boardPath = "") { const updatePromises = selectedCards.map(async (card) => { const newContent = addTagToContent(card.content || "", tagName); return fetch(`${api}/resource${boardPath}/${encodeURIComponent(card.lane)}/${encodeURIComponent(card.name)}.md`, { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ content: newContent }) }); }); await Promise.all(updatePromises); } ``` -------------------------------- ### Bulk Delete Cards Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Deletes multiple selected cards. It maps over the selected cards and sends DELETE requests to the API for each. Requires 'selectedCards' to be an array of card objects. ```javascript // Bulk delete cards async function bulkDeleteCards(selectedCards, boardPath = "") { const deletePromises = selectedCards.map(card => fetch(`${api}/resource${boardPath}/${encodeURIComponent(card.lane)}/${encodeURIComponent(card.name)}.md`, { method: "DELETE" }) ); await Promise.all(deletePromises); } ``` -------------------------------- ### Update Card Content Source: https://context7.com/baldissaramatheus/tasks.md/llms.txt Updates the content of an existing card in a specified lane. This function sends a PATCH request to the API. ```javascript // Update card content async function updateCard(lane, cardName, newContent) { await fetch(`${api}/resource/${encodeURIComponent(lane)}/${encodeURIComponent(cardName)}.md`, { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ content: newContent }) }); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.