strapdown.js HTML 內嵌 Markdown 的靜態解決方案

strapdown.js使得基於 Markdown 編寫網頁極其便利:html

只需在 html 文件中引用strapdown.js,而後在<xmp>標籤內書寫 Markdown 內容便可。瀏覽器加載時會自動將 Markdown 渲染爲 HTML。再方便不過。segmentfault

示例

<!DOCTYPE html>
<html>
<title>Hello Strapdown</title>

<xmp theme="united" style="display:none;">
# Markdown text goes in here

## Chapter 1

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. 

## Chapter 2

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
</xmp>

<script src="http://strapdownjs.com/v/0.2/strapdown.js"></script>
</html>

特性

  • 搜索引擎友好
  • 跨瀏覽器支持
  • 支持解析 Github-flavored Markdown
  • 可定製主題

請輸入圖片描述

項目主頁

http://strapdownjs.com瀏覽器


編撰 SegmentFaultide

相關文章
相關標籤/搜索