当前位置: 首页 > news >正文

上杭县建设局网站住房保障关键词搜索引擎又称为

上杭县建设局网站住房保障,关键词搜索引擎又称为,东莞招聘网人才网,安徽先锋网站两学一做目录 步骤一:添加插件 步骤二:添加pdf地址 步骤三:成果展示 docsify是一个在github上很好用的文档转换网页的工具,但是大部分情况我们都是使用的markdown文件。最近想把pdf文档也能支持在这上面展示,研究后总结一下…

目录

步骤一:添加插件

步骤二:添加pdf地址

步骤三:成果展示


docsify是一个在github上很好用的文档转换网页的工具,但是大部分情况我们都是使用的markdown文件。最近想把pdf文档也能支持在这上面展示,研究后总结一下,方便有共同想法的小伙伴使用。

步骤一:添加插件

首先我们借助的是下面的仓库:

Docsify PDF嵌入式插件

To use, simply put these 2 lines below where you import the docsify.min.js file.

<!-- PDFObject.js is a required dependency of this plugin -->
<script src="//cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js"></script> 
<!-- This is the source code of the pdf embed plugin -->
<script src="path-to-file/docsify-pdf-embed.js"></script>
<!-- or use this if you are not hosting the file yourself -->
<script src="//unpkg.com/docsify-pdf-embed-plugin/src/docsify-pdf-embed.js"></script>

然后在使用markdown文档中 引入pdf的在线地址

### Here are some of your previous markdown contents
blah blah blah```pdfpath-to-the-pdf-file
```

如果不能展示 或者有其他问题的话 根据文档介绍可以使用替换上面code后面的function为下面的renderer_func的function

window.$docsify = {name: 'some name',repo: 'some git repository',homepage: 'some_homepage.md',notFoundPage: 'some_404_page.md',markdown: {//If you have defined the follow section, //then you need to follow the steps in the next section.//(only the code section matters in this plugin)/* SECTION STARTcode: function(code, lang){some custom functions herereturn some_custom_results;}SECTION END */}
}//替换上面code后面的function为下面的functionvar renderer_func = function(code, lang, base=null) { var pdf_renderer = function(code, lang, verify) {function unique_id_generator(){function rand_gen(){return Math.floor((Math.random()+1) * 65536).toString(16).substring(1);}return rand_gen() + rand_gen() + '-' + rand_gen() + '-' + rand_gen() + '-' + rand_gen() + '-' + rand_gen() + rand_gen() + rand_gen();}if(lang && !lang.localeCompare('pdf', 'en', {sensitivity: 'base'})){if(verify){return true;}else{var divId = "markdown_code_pdf_container_" + unique_id_generator().toString();var container_list = new Array();if(localStorage.getItem('pdf_container_list')){container_list = JSON.parse(localStorage.getItem('pdf_container_list'));	}container_list.push({"pdf_location": code, "div_id": divId});localStorage.setItem('pdf_container_list', JSON.stringify(container_list));return ('<div style="margin-top:'+ PDF_MARGIN_TOP +'; margin-bottom:'+ PDF_MARGIN_BOTTOM +';" id="'+ divId +'">'+ '<a href="'+ code + '"> Link </a> to ' + code +'</div>');} }return false;}if(pdf_renderer(code, lang, true)){return pdf_renderer(code, lang, false);}/* SECTION START: Put other custom code rendering functions herei.e. If the language of the code block is LaTex, put the code below to replace original code block with the text: 'Using LaTex is much better than handwriting!' inside a div container.if (lang == "latex") {return ('<div class="container">Using LaTex is much better than handwriting!</div>');}SECTION END */return (base ? base : this.origin.code.apply(this, arguments));
}

步骤二:添加pdf地址

对于我们pdf的地址 我们可以直接上传的github仓库里面,当然也可以使用自己的oss地址啥的。下面介绍一下git上pdf的地址填写。

 上面可以拷贝出pdf的地址,但是需要我们替换一下。

假设 GitHub 文件的原 URL 是:

https://github.com/helloworld/Java/blob/master/docs/Algorithms, 4th Edition.pdf

将其更改为:

https://raw.githubusercontent.com/helloworld/Java/master/docs/Algorithms, 4th Edition.pdf

即,将 github.com 替换为 raw.githubusercontent.com,并去除 /blob

原因:

raw.githubusercontent.com 返回存储在 GitHub 中的文件的 raw content(原始内容),因此可以将它们简单地下载到计算机上。可以在网页上右键查看源文件的方式验证文件 URL 是否包含 raw.githubusercontent.com

ps:注意

如果提交修改了某个pdf,对应的地址也会变,需要改成新的。

步骤三:成果展示

http://www.tj-hxxt.cn/news/44388.html

相关文章:

  • 备案资料网站查询网站模板平台资源
  • 网站备案注销原因搜索引擎推广的基本方法
  • 单位网站建设目的推广网络营销案例
  • 网站做的好看的优化分析
  • 北京网站开发多少钱大地seo视频
  • 吉首公司网站找谁做在百度如何发布作品
  • wordpress添加网易云音乐播放器只要做好关键词优化
  • wordpress 排版插件天津seo标准
  • 婚嫁行业网站模板百度关键词优化系统
  • asp_asp.net_php哪种做网站最好?黄页推广
  • 潍坊网站建设公司排名产品营销策略有哪些
  • 佛山网站制作好处长沙seo推广优化
  • 海珠免费网站建设北京营销推广网站建设
  • 建设银行网站用户名是什么seo在线优化工具
  • 网站建设与运营总结外贸营销网站制作公司
  • 做网站百科b站视频推广网站动漫
  • 济南国迅网站建设公司怎么样指数基金是什么意思
  • 国外企业合作的网站百度点击工具
  • 商城网站建站石家庄最新新闻事件
  • 软件开发和网站开发难度舆情通
  • 如何做网站搜索引擎优化郑州网络营销与网站推广
  • 乐辰科技网站建设百度手机助手下载
  • 电商网站建设与管理网络营销软件下载
  • 那里网站建设好关键词查找的方法有以下几种
  • 湘潭网站建设 磐石网络荣誉seo百家论坛
  • 佛山顺德网站建设公司优秀软文范例800字
  • 资讯类网站模板淘宝宝贝关键词排名查询工具
  • 怎么在网站做视频接口新闻热搜榜 今日热点
  • 网站改域名如何做百度优化搜狗排名优化工具
  • 千万别在百度上搜别人的名字苏州百度 seo