Hacker News 中文摘要

RSS订阅

显示 HN:MDV —— 一个用于文档、仪表盘和数据幻灯片的 Markdown 超集 -- Show HN: MDV – a Markdown superset for docs, dashboards, and slides with data

文章摘要

MDV是一个Markdown扩展工具,支持在文档、仪表盘和幻灯片中嵌入数据和可视化内容,提供HTML和PDF导出功能,支持实时预览和VS Code扩展。

文章总结

GitHub项目:MDV —— 支持数据可视化的Markdown超集

项目概述

MDV是Markdown的扩展版本,专为创建包含嵌入式数据和可视化的文档、仪表板和幻灯片而设计。它保留了标准Markdown的简洁性,同时增加了以下功能: - YAML前置元数据:用于定义标题、主题和数据集引用 - 代码块扩展:支持直接插入图表(如chart type=bar)和统计卡片 - 容器语法:通过:::实现区域样式和分栏布局 - 自动目录:通过::: toc生成

核心特性

  1. 可视化支持:内置条形图、折线图、饼图等SVG图表,无需JavaScript运行时
  2. 多格式输出:可导出为自包含HTML或PDF
  3. 开发工具
    • VS Code扩展提供实时预览
    • CLI工具支持渲染和自动刷新预览
  4. 数据集成:支持内联CSV/JSON数据或引用外部文件

快速开始

```shell git clone https://github.com/drasimwagan/mdv cd mdv npm install npm run build

渲染示例文件

node packages/mdv-cli/dist/index.js render examples/09-full-report.mdv ```

文档资源

项目提供详细指南,包括: - 语法参考 - 图表配置选项 - 主题样式定制 - CLI和VS Code扩展使用说明

当前状态

v1预发布版本,基于Node 20+运行。采用MIT许可证开源。

技术栈

  • 语言:TypeScript(93.3%)、JavaScript(6.7%)
  • 核心功能:基于markdown-it解析器扩展,内置SVG渲染引擎

项目通过严格的CommonMark兼容性设计,避免引入复杂语法(如选择器或表达式),保持Markdown的易用性优势。

(注:已过滤GitHub页面导航菜单、用户交互按钮等非核心内容,保留技术说明和功能性描述)

评论总结

主要观点总结:

1. 支持Markdown扩展的简洁性

  • 认为Markdown的简洁语法是其优势,扩展时应保持简单性,避免复杂化。
    • "Markdown is a beautiful demonstration that document structure syntax can/should be simple." (kevinkoning)
    • "Markdown is too simple, and Figma is too visual. This feels like a great middle ground." (woodydesign)

2. 扩展Markdown的不同方案

  • 提出了多种扩展Markdown的方案,如表格语法、YAML front-matter、fenced blocks等。
    • "Here’s my personal take on extending table syntax for charts." (kevinkoning)
    • "All of these are supported in pandoc markdown: YAML front-matter, fenced blocks for data/visuals." (remywang)

3. 与其他工具的比较

  • 提到了一些类似工具,如Emacs Org-Mode、Quarto、Marp等。
    • "But at what point does Markdown just become Emacs Org-Mode?" (phyzix5761)
    • "I’m using quarto for this sort of thing." (ifh-hn)
    • "For going from Markdown to slides I’ve often used Marp." (pixelmonkey)

4. 实际应用与需求

  • 讨论了Markdown在实际工作流中的应用,如设计、BI解决方案等。
    • "I work on a dashboarding / BI solution that is also built around markdown and clickhouse." (amcaskill)
    • "I’m a product designer, and I could totally see this fitting into my workflow." (woodydesign)

5. 技术实现与工具支持

  • 提到了具体的技术实现和工具支持,如djot、Stripe的Markdoc等。
    • "I’ve been enjoying djot.net as a superset of Markdown." (nzoschke)
    • "We moved to stripe’s Markdoc variant for the component syntax last year." (amcaskill)

6. 反馈与建议

  • 用户提出了一些反馈和建议,如增加渲染示例、提示功能等。
    • "I was expecting to find a link to a github pages site where I can see the rendered examples." (sieste)
    • "Looks wonderful, is there a skill or prompt that can teach agents how to use this format?" (gkfasdfasdf)

7. 相关项目分享

  • 一些用户分享了他们自己的类似项目。
    • "My Show HN for a similar cli + web based solution (https://sdocs.dev) is on the /show page now." (FailMore)
    • "Even I built an API tool on markdown - https://voiden.md." (dhruv3006)