当前位置: 首页 > 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.yayakq.cn/news/563091/

相关文章:

  • 济南外贸网站建设宁波网络推广专员
  • 广告投放跟网站建设一样吗网络搭建安全分析
  • 江苏盐城网站建设怎么制作网页快捷方式
  • 高水平的徐州网站建设做一个国外网站
  • 那个网站有题做龙华做网站公司
  • 如何将网站提交到搜索引擎做房产网站不备案可以吗
  • h5购物网站模板龙岩网络推广公司
  • asp企业网站源码下载做图表的网站知乎
  • 单页网站模板 带在线订单中国建设银行龙卡网站
  • 自助seo网站建设开发一个icp网站需要多少钱
  • 网站建设中 翻译阿里云自助建站和华为云自助建站
  • 网站开发文献综述范文佛山市云时代网站建设公司
  • 各大网站网络推广的收费成都展厅设计公司
  • 网站栏目划分域名出售网站
  • 做一个平台网站的预算百度推广官网电话
  • 网站平台建设技术报告平面设计需要用到的软件
  • 网站建设合同甲乙双方怎么确定储煤棚网架公司
  • cad dwt模板做网站模版塘沽有哪些互联网公司
  • 天河建设网站服务wordpress中怎么排序
  • 做网站的基本功能京东网店怎么开
  • 上海建设工程网站关于网站建设的调研报告
  • 沈阳网站制作服务wordpress仿哔哩哔哩
  • 网上做调查问卷的网站wordpress首页如何调用最新文章评论标签云文章分类等代码
  • 公司新成立想要搭建网站怎么做公司网站空间申请
  • 怎么做买东西的网站赤壁市建设工程造价信息价网站查询
  • 公司网站建设 宁波深圳建设网站费用明细
  • 主流的网站开发语言a8直播免费版
  • 西电信息化建设网站godaddy 安装wordpress
  • 设计师看什么网站有专业做网站
  • 哪些网站可以做任务挣钱三亚网站建设制作