深度阅读

How to create a timeline in Markdown?

作者
作者
2023年08月22日
更新时间
10.88 分钟
阅读时间
0
阅读量

Markdown itself does not have support for creating timelines. However, there are extensions and tools available that can help you create timelines in Markdown. One option is to use a JavaScript library like TimelineJS or Vis.js, and embed the timeline in your Markdown document using an HTML <iframe> tag. Here’s an example:

<iframe src="https://cdn.knightlab.com/libs/timeline3/latest/embed/index.html?source=1V3qWm9X7e-5mmsi5P5ibBPh2_QyjlR4uqrL01yVxJ3E&font=Default&lang=en&initial_zoom=2&height=650" width="100%" height="650" frameborder="0"></iframe>

This code will embed a timeline created with TimelineJS into your Markdown document. You will need to modify the src attribute to point to your own timeline data. Alternatively, you can use a Markdown extension like mermaid or markdown-timelines to add timeline functionality directly to your Markdown documents.

Keep in mind that not all Markdown rendering engines support HTML tags or extensions, so you may need to test your document in different environments to make sure that the timeline displays correctly.

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。