logo
努力加载中 ……

外部引入

原创Starzkg11/27/2021, 10:38:42 AM
  • markdown
5992 分钟

除了在 Markdown 内部使用新语法来增强内容外,你也可以使用 <iframe><img> 从外部引入链接来增强你的 Markdown 内容。

shields.io

你可以使用 shields.ioopen in new window 生成大量的动态勋章,比如项目的 Stars,NPM 版本号,下载量等。

输入:

![Version](https://img.shields.io/npm/v/@starzkg/vuepress-theme-star.svg?style=flat-square&logo=npm)
![Downloads](https://img.shields.io/npm/dm/@starzkg/vuepress-theme-star.svg?style=flat-square&logo=npm)
![Size](https://img.shields.io/bundlephobia/min/@starzkg/vuepress-theme-star?style=flat-square&logo=npm)
![Dependencies](https://img.shields.io/librariesio/release/npm/@starzkg/vuepress-theme-star?style=flat-square)

输出:

VersionDownloadsSize

当然你可以单纯利用它生成静态的徽章。你可以通过修改参数来定制文字、样式、颜色与大小。

输入:

![Theme: @starzkg/vuepress-theme-star](https://img.shields.io/badge/主题-vuepress--theme--hope-green.svg?style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAwIiBoZWlnaHQ9IjEyMDAiIGNsYXNzPSJpY29uIiB2aWV3Qm94PSIwIDAgMzI4MC45NDQgMjgwMCI+CiAgPHBhdGggZD0iTTE2NDUuMzMyIDYwMS4wMDRoMzc1LjY3NUwxMDgxLjgyIDIyMzguNDc4IDE0Mi42MzYgNjAxLjAwNGg3MTguNDc3bDIyMC43MDggMzc5LjcwNCAyMTYuMDEzLTM3OS43MDR6IiBmaWxsPSIjNDFiODgzIiAvPgogIDxwYXRoIGQ9Ik0xNDIuNjM2IDYwMS4wMDRsOTM5LjE4NSAxNjM3LjQ3NCA5MzkuMTg2LTE2MzcuNDc0aC0zNzUuNjc1bC01NjMuNTEgOTgyLjQ4NC01NjguMjA4LTk4Mi40ODR6IiBmaWxsPSIjNDFiODgzIiAvPgogIDxwYXRoIGQ9Ik01MTMuMTg4IDYwM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MzNTQ5NWUiIC8+CiAgPHBhdGggZD0iTTE1MjQuMjA3IDE0NjQuOTAzbDYwOC4yODUgNi44NzcgMTczLjc0Ni0zMjAuOTA5aC02MTkuMDcyeiIgZmlsbD0iIzQxYjg4MyIgLz4KPC9zdmc+)
![Author: Mr.Hope](https://img.shields.io/badge/作者:Mr.Hope-关注-blue.svg?style=social)

输出:

Theme: @starzkg/vuepress-theme-starAuthor: Mr.Hope

INFO

详细的参数与使用请见 首页open in new window

Markmap

Markmap 是一个将 Markdown 转换为思维导图的工具。它相对于主题内置的 flowchart 支持更多的格式与内容。

  1. 使用 Markmapopen in new window 生成思维导图 HTML 文件
  2. 将 HTML 文件放在 .vuepress/public/
  3. 通过 <iframe> 插入到 Markdown

输入:

<iframe
  :src="$withBase('/markmap/demo-zh.html')"
  width="100%"
  height="400"
  frameborder="0"
  scrolling="No"
  leftmargin="0"
  topmargin="0"
/>

输出:

CodePen

CodePenopen in new window 可以很方便的创建代码演示并嵌入。

<iframe
  height="265"
  style="width: 100%;"
  scrolling="no"
  title="Solar System animation - Pure CSS"
  src="https://codepen.io/kowlor/embed/ZYYQoy?height=265&theme-id=light&default-tab=css,result"
  frameborder="no"
  loading="lazy"
  allowtransparency="true"
  allowfullscreen="true"
>
  See the Pen
  <a href="https://codepen.io/kowlor/pen/ZYYQoy"
    >Solar System animation - Pure CSS</a
  >
  by Malik Dellidj (<a href="https://codepen.io/kowlor">@kowlor</a>) on
  <a href="https://codepen.io">CodePen</a>.
</iframe>