From e57455dfa505daa3da022892ea4348409169f03f Mon Sep 17 00:00:00 2001 From: rainboylvx Date: Thu, 4 Oct 2018 21:29:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90=20mard?= =?UTF-8?q?own-it=E7=9A=84=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 0 README.md | 100 -------- base64.js | 19 -- clipbordCopy.js | 58 ----- copy_plugin.js | 17 ++ css/github-markdown.css | 245 +++++++++----------- default_config.js | 7 - fence.md | 3 + hl.js | 74 ++++++ html/.babelrc | 0 html/.gitignore | 0 html/README.md | 0 html/index.html | 357 +---------------------------- html/package.json | 1 + html/src/App.vue | 114 +++++++++- html/src/assets/logo.png | Bin html/src/main.js | 2 - html/webpack.config.js | 15 ++ index.js | 53 +++-- katex_render.js | 13 -- keyword.txt | 1 - package.json | 46 ++-- readme.md | 112 +++++++++ rmarked.js | 479 --------------------------------------- test.js | 7 + test.md | 84 +++++++ twemoji.js | 30 --- 27 files changed, 593 insertions(+), 1244 deletions(-) mode change 100644 => 100755 .gitignore delete mode 100644 README.md delete mode 100644 base64.js delete mode 100644 clipbordCopy.js create mode 100644 copy_plugin.js mode change 100644 => 100755 css/github-markdown.css delete mode 100644 default_config.js create mode 100644 fence.md create mode 100644 hl.js mode change 100644 => 100755 html/.babelrc mode change 100644 => 100755 html/.gitignore mode change 100644 => 100755 html/README.md mode change 100644 => 100755 html/index.html mode change 100644 => 100755 html/package.json mode change 100644 => 100755 html/src/App.vue mode change 100644 => 100755 html/src/assets/logo.png mode change 100644 => 100755 html/src/main.js mode change 100644 => 100755 html/webpack.config.js delete mode 100644 katex_render.js delete mode 100644 keyword.txt create mode 100755 readme.md delete mode 100644 rmarked.js create mode 100644 test.js mode change 100644 => 100755 test.md delete mode 100644 twemoji.js diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/README.md b/README.md deleted file mode 100644 index 5eaf0dc..0000000 --- a/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# rmarked - -## 功能使用 - -引入样式 - -``` -import "rmarked/css/github-markdown.css" -import "katex/dist/katex.min.css" - -//引入高亮的主题,可以改成自己喜欢的 -import "highlight.js/styles/tomorrow-night-blue.css" - -//全局使用 - -var markdown = require("rmarked") -Vue.prototype.markdown_render = markdown - -``` - -## 配置 - - -默认opttions -``` -{ - katex:true, - emoji:true, - image:false, //对image的增强 - image_base:'/' //image基础地址 -} - -``` - -### Emoji表情的使用 - -使用**TWEmoji** - -语法 - -``` -:emoji-code: -``` - -**emoji-cheatsheet** - -https://jollygoodcode.github.io/twemoji/ - -## image - -image可以使用以通过opttions开启增强的功能,默认没有开启`image:false`,使用`marked`的默认功能 - -**image_base** -开启image增加的同时,改变图片相对地址的基地址 - - -语法 -``` -![text](you_image_path=HeightxWidth"title") -``` - -例子: - -开启增强image功能,改变image_base - -``` -{ - image:true, - image_base:'http://rainboy.com/' -} -``` - -``` -原: -![1](1/2/3.jpg=100x200 "mytitle") - -渲染后: - -1 -``` - -如果原地址是绝对地址就是不会加入基地址: - -``` -![2](/1/2/3.jpg=100x200 "mytitle") -==> 2 - -![3](http://rainboy.com/1/2/3.jpg=100x200 "mytitle") -2 -``` - -height width是选的,但是两个必须同时写上 - -``` -![4](/1/2/3.jpg "mytitle") -==> 2 - -![5](/1/2/3.jpg=100x "mytitle") -==> 2 -``` diff --git a/base64.js b/base64.js deleted file mode 100644 index ec4e931..0000000 --- a/base64.js +++ /dev/null @@ -1,19 +0,0 @@ -var base_64 = require("base-64") -var utf8 = require("utf8") -var base64 = {} - -base64.encode = function(str){ - var bytes = utf8.encode(str); - return base_64.encode(bytes); -} - -base64.decode = function(encoded){ - var bytes = base_64.decode(encoded); - return utf8.decode(bytes); -} - -module.exports = base64 - -exports.init = function(){ - window.base64 = base64; -} diff --git a/clipbordCopy.js b/clipbordCopy.js deleted file mode 100644 index a526805..0000000 --- a/clipbordCopy.js +++ /dev/null @@ -1,58 +0,0 @@ -var base64 = require('./base64.js') - -function clipboardCopy (text) { - // A contains the text to copy - var span = document.createElement('span') - span.textContent = text - span.style.whiteSpace = 'pre' // Preserve consecutive spaces and newlines - - // An