GitBook的使用备忘
GitBook环境搭建
npm install -g gitbook-cli
# 新建目录,如helloworld
cd helloworld
# 执行此语句,需等待一段时间
gitbook init
# 启动服务
gitbook serve
遇到问题
TypeError: cb.apply is not a function
问题描述
在执行gitbook init时,出现此问题
解决办法:
- 修改相应的文件,可参考:https://www.jianshu.com/p/6221330b36ba
- 调整nodejs的版本,本人将nodejs调整到10.23.0,可以安装成功
nodejs版本的切换
本人使用的windows系统,切换nodejs版本用到了一个nvm的工具,它可以很方便的安装及切换nodejs的版本。
可参考文档:使用nvm安装不同版本的NodeJS
GitBook应用备忘
如何隐藏底部链接Published with GitBook
参考文档
https://www.jianshu.com/p/23353e771082
操作步骤
1、新建文件
_layouts\website\summary.html
2、编辑文件
{% macro articles(_articles) %}
{% for article in _articles %}
<li class="chapter {% if article.path == file.path and not article.anchor %}active{% endif %}" data-level="{{ article.level }}" {% if article.path %}data-path="{{ article.path|resolveFile }}"{% endif %}>
{% if article.path and getPageByPath(article.path) %}
<a href="{{ article.path|resolveFile }}{{ article.anchor }}">
{% elif article.url %}
<a target="_blank" href="{{ article.url }}">
{% else %}
<span>
{% endif %}
{% if article.level != "0" and config.pluginsConfig['theme-default'].showLevel %}
<b>{{ article.level }}.</b>
{% endif %}
{{ article.title }}
{% if article.path or article.url %}
</a>
{% else %}
</span>
{% endif %}
{% if article.articles.length > 0 %}
<ul class="articles">
{{ articles(article.articles, file, config) }}
</ul>
{% endif %}
</li>
{% endfor %}
{% endmacro %}
<ul class="summary">
{% set _divider = false %}
{% if config.links.sidebar %}
{% for linkTitle, link in config.links.sidebar %}
{% set _divider = true %}
<li>
<a href="{{ link }}" target="_blank" class="custom-link">{{ linkTitle }}</a>
</li>
{% endfor %}
{% endif %}
{% if _divider %}
<li class="divider"></li>
{% endif %}
{% for part in summary.parts %}
{% if part.title %}
<li class="header">{{ part.title }}</li>
{% elif not loop.first %}
<li class="divider"></li>
{% endif %}
{{ articles(part.articles, file, config) }}
{% endfor %}
</ul>
GitBook的使用备忘的更多相关文章
- GIS部分理论知识备忘随笔
文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1.高斯克吕格投影带换算 某坐标的经度为112度,其投影的6度带和3度带 ...
- python序列,字典备忘
初识python备忘: 序列:列表,字符串,元组len(d),d[id],del d[id],data in d函数:cmp(x,y),len(seq),list(seq)根据字符串创建列表,max( ...
- Vi命令备忘
备忘 Ctrl+u:向文件首翻半屏: Ctrl+d:向文件尾翻半屏: Ctrl+f:向文件尾翻一屏: Ctrl+b:向文件首翻一屏: Esc:从编辑模式切换到命令模式: ZZ:命令模式下保存当前文件所 ...
- ExtJs4常用配置方法备忘
viewport布局常用属性 new Ext.Viewport({ layout: "border", renderTo: Ext.getBody(), defaults: { b ...
- [备忘] Automatically reset Windows Update components
这两天遇到Windows 10的更新问题,官方有一个小工具,可以用来修复Windows Update的问题,备忘如下 https://support.microsoft.com/en-us/kb/97 ...
- ECMAScript 5(ES5)中bind方法简介备忘
一直以来对和this有关的东西模糊不清,譬如call.apply等等.这次看到一个和bind有关的笔试题,故记此文以备忘. bind和call以及apply一样,都是可以改变上下文的this指向的.不 ...
- MFC通过txt查找文件并进行复制-备忘
MFC基于对话框的Demo txt中每行一个23位的卡号. 文件夹中包含以卡号命名的图像文件.(fpt或者bmp文件) 要求遍历文件夹,找到txt中卡号所对应的图像文件,并复制出来. VC6.0写的. ...
- php 相关模块备忘
在安装php的时候,不管是编译安装: ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc -- ...
- 『备忘』HttpWebRequest 在 POST 提交时, 标头(Headers)丢失原因
近来研究 HttpWebRequest —— 辅助类完成时,POST JSON数据 总会 丢失标头(Headers). HttpWebRequest POST JSON数据,分如下几步: > 将 ...
- Javascript备忘模式
使用备忘模式,利用了函数的自定义属性,先看一个例子 var test = function (){} test.myAttr = "attr"; 这样,就给test加上了一个自定义 ...
随机推荐
- 【3】java之string类
String 是一个字符串类型的类,使用双引号定义的内容都是字符串,但是 String 本身是一个类,使用上会有一些特殊. 一. String类对象的两种实例化方式 1.1 直接赋值 public c ...
- cannot import name 'detail_route' from 'rest_framework.decorators'的解决办法
原因 es7不能使用3.1.1版本的django-haystack 解决办法 如果你是在弄elasticsearch,那么这个适合你,否则应该用不了. 终端执行django-haystack的更新 p ...
- 在windows服务中托管asp.net.core
参考:https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/windows-service?view=aspnetcore-3.1& ...
- Aspose.Cells 拒绝访问、数据库 64 bit mode with the 32 bit Oracle、视图加载格式不正确。
第一次遇到发布程序后,引发的这么多奇葩问题.记录一下. 配置:windows server 2018 R2 企业版 sp1 这是一台闲置4年机子,拿到机子里面已经安装过oracle客户端,我直接卸载装 ...
- ubuntu下安装lua和tolua++
先安装lua,然后安装toluapp 1.官网下载lua5.3或者5.2的版本 2.readline开发包安装 apt-get install libreadline-dev 3.解压源码包来编译安装 ...
- A调用B方法,@Transactional事务问题
总结:方法A调用方法B:1.如果只有A加@Transactional注解:则AB在同一事务中,任意异常都回滚:2.如果只有B加@Transactional注解:AB方法为同一类,事务失效任意异常都不回 ...
- D. Triangle Coloring
https://codeforces.com/contest/1795/problem/D #include <iostream> #include <cstring> #in ...
- JSP过滤器、Session监听器、Servlet控制器的关系和执行顺序
1.首先配置好过滤器和监听器,访问index.jsp页面(在index.jsp中设置session的Attribute属性.session的失效时间,查看的顺序是什么?); 1.运行Tomact的结果 ...
- 前端js校验小数点
let result = (value.toString()).indexOf("."); if (result != -1 && value.toString() ...
- Spyder无法使用搜狗输入中文的解决办法
Ubuntu 18.04 LTS系统下,spyder4编辑器无法使用搜狗输入中文.系统输入法为fcitx+搜狗拼音,chrome浏览器无此问题.网上答案: Spyder (以及其他PyQt程序) 无法 ...