{"id":50344709,"url":"https://github.com/osamaabusitta/mdstyled","last_synced_at":"2026-05-29T19:02:47.325Z","repository":{"id":360244013,"uuid":"1249111406","full_name":"OsamaAbuSitta/MDStyled","owner":"OsamaAbuSitta","description":"Style Markdown in VS Code with external CSS and JavaScript, without cluttering the Markdown itself.","archived":false,"fork":false,"pushed_at":"2026-05-25T16:12:21.000Z","size":6699,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-25T17:16:50.062Z","etag":null,"topics":["css","docs","documentation","js","markdown","md","style"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OsamaAbuSitta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-25T11:11:06.000Z","updated_at":"2026-05-25T16:43:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/OsamaAbuSitta/MDStyled","commit_stats":null,"previous_names":["osamaabusitta/mdstyled"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/OsamaAbuSitta/MDStyled","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OsamaAbuSitta%2FMDStyled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OsamaAbuSitta%2FMDStyled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OsamaAbuSitta%2FMDStyled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OsamaAbuSitta%2FMDStyled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OsamaAbuSitta","download_url":"https://codeload.github.com/OsamaAbuSitta/MDStyled/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OsamaAbuSitta%2FMDStyled/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33666290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","docs","documentation","js","markdown","md","style"],"created_at":"2026-05-29T19:02:46.454Z","updated_at":"2026-05-29T19:02:47.320Z","avatar_url":"https://github.com/OsamaAbuSitta.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MdStyled\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"img/Screenshot.png\" alt=\"MdStyled Preview Screenshot\" width=\"900\" /\u003e\n\u003c/p\u003e\n\nStyle Markdown in VS Code with external CSS and JavaScript, without cluttering the Markdown itself.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"img/workflow.png\" alt=\"MdStyled turns Markdown plus CSS and JS directives into a styled preview in VS Code\" width=\"900\" /\u003e\n\u003c/p\u003e\n\nMdStyled is a VS Code extension for authors who want rich, branded, interactive Markdown previews while keeping source files portable and AI-friendly. Add CSS and JS with frontmatter or invisible HTML comments, then open a live preview inside VS Code.\n\n## How to use\n\n1. Install **MdStyled** in VS Code.\n2. Open any Markdown file.\n3. Run **MdStyled: Apply Template** to scaffold a starter theme.\n4. Run **MdStyled: Open Preview** to see the styled result.\n5. Edit your Markdown, CSS, or JS and watch the preview refresh live.\n\n### Minimal example\n\nPut this at the top of a Markdown file:\n\n```md\n\u003c!-- @style: ./theme.css --\u003e\n\u003c!-- @script: ./behavior.js --\u003e\n\n# Product Brief\n\n\u003c!-- .hero --\u003e\nBuild polished Markdown documents with normal web tools.\n```\n\nThen create `theme.css`:\n\n```css\n.hero {\n  padding: 1rem 1.25rem;\n  border-left: 4px solid #2563eb;\n  background: #eff6ff;\n  font-size: 1.1rem;\n}\n```\n\nOpen **MdStyled: Open Preview** and the paragraph under `# Product Brief` will render with the `hero` class applied.\n\n## Why MdStyled\n\n- Keep Markdown clean while styling the preview with real CSS and JavaScript\n- Apply classes, IDs, and attributes using invisible comment selectors\n- Build branded documentation, slide-like pages, reports, and interactive notes\n- Use local assets instead of forcing presentation markup into the document body\n- Preview everything directly inside VS Code\n\n## Core syntax\n\n### Attach styles and scripts\n\n```md\n\u003c!-- @style: ./theme.css --\u003e\n\u003c!-- @script: ./behavior.js --\u003e\n```\n\nYou can also use frontmatter:\n\n```md\n---\nmdstyled:\n  styles:\n    - ./theme.css\n  scripts:\n    - ./behavior.js\n---\n```\n\n### Apply selectors to the next block\n\n```md\n\u003c!-- .callout --\u003e\nImportant note\n\n\u003c!-- #hero --\u003e\n# Landing Page\n\n\u003c!-- [data-theme=dark] --\u003e\n## Themed section\n```\n\nThese comments are removed from the final preview and only affect the next renderable block.\n\n## What you can do\n\n| Syntax | Result |\n|---|---|\n| `\u003c!-- .class --\u003e` | Add one or more classes to the next block |\n| `\u003c!-- #id --\u003e` | Set an `id` on the next block |\n| `\u003c!-- [key=value] --\u003e` | Add an attribute to the next block |\n| `\u003c!-- @style: ./file.css --\u003e` | Load a CSS file into the preview |\n| `\u003c!-- @script: ./file.js --\u003e` | Load a JS file into the preview |\n| `\u003c!-- @section: name --\u003e` | Wrap the following heading and content in a named `\u003csection\u003e` |\n| `\u003c!-- @page: name --\u003e` | Wrap the full document in `\u003cdiv class=\"mdstyled-root name\"\u003e` |\n\n## Built-in extras\n\nMdStyled ships with a few built-in preview extensions:\n\n| Extension | What it does |\n|---|---|\n| `mermaid` | Renders ` ```mermaid ` blocks as diagrams |\n| `copy-code` | Adds copy buttons to code blocks |\n| `highlight` | Applies basic code block styling |\n\nEnable or disable them in VS Code settings:\n\n```json\n{\n  \"mdstyled.extensions.enabled\": [\"mermaid\", \"copy-code\", \"highlight\"]\n}\n```\n\n## Templates\n\nApply any template with **MdStyled: Apply Template** and choose a theme from the list.\n\n### Default templates\n\nThe **default-light** and **default-dark** templates provide a clean documentation layout:\n\n- **TOC sidebar** — all heading levels (H1–H6) with hierarchical indentation and scroll-aware active highlighting\n- **Copy buttons** — fixed-position copy button on every code block that stays in place while scrolling horizontally\n- **Syntax highlighting** — code block styling with theme-appropriate colors\n- **Mermaid diagrams** — renders ` ```mermaid ` blocks inline\n\n### Interactive templates\n\nThe **interactive-light** and **interactive-dark** templates include everything in the default templates, plus client-side interactivity:\n\n#### Interactive tables\nEvery Markdown table automatically gets:\n\n| Feature | How it works |\n|---|---|\n| **Full-width search** | Type to filter rows across all columns |\n| **Column search** | Type `ColumnName: term` to search a single column (autocomplete suggests column names as you type) |\n| **Sortable headers** | Click any column header to sort ascending or descending |\n| **Pagination** | Long tables show 10 rows per page with Prev / Next / page number controls |\n\n#### Collapsible sections\nEvery heading (`h1`–`h6`) becomes an accordion with a toggle button. Click ▼ to collapse or expand the section content. Nested headings work independently — collapse a parent to hide all its children, or collapse a child while keeping the parent open.\n\n#### Table of contents\nThe right sidebar shows all heading levels (H1–H6) with hierarchical indentation and scroll-aware active highlighting. Clicking a TOC entry immediately highlights it and scrolls to the correct heading.\n\n## Commands\n\n| Command | Description |\n|---|---|\n| `MdStyled: Open Preview` | Open the styled preview in the current editor area |\n| `MdStyled: Open Preview to Side` | Open the styled preview beside the current editor |\n| `MdStyled: Apply Template` | Create a starter `.mdstyled/` folder and insert directives |\n\n## Auto-discovery\n\nIf a Markdown file has matching companion files, MdStyled can load them automatically:\n\n- `example.md` -\u003e `example.css`\n- `example.md` -\u003e `example.js`\n- `example.md` -\u003e `example.mdstyled`\n- `example.md` -\u003e `example.mdjs`\n\nYou can also define shared defaults with `mdstyled.config.json`.\n\n## Sample files\n\nThe repository includes examples in [`samples/`](https://github.com/OsamaAbuSitta/MDStyled/tree/main/code/samples):\n\n- `basic.md`\n- `test-all.md`\n- `default.md`\n- `test-diagram.md`\n\n## Development\n\n```bash\nnpm run compile\nnpm run watch\n```\n\nPress `F5` in VS Code to launch an Extension Host for local testing.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosamaabusitta%2Fmdstyled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosamaabusitta%2Fmdstyled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosamaabusitta%2Fmdstyled/lists"}