GitBook环境搭建

npm install -g gitbook-cli

# 新建目录,如helloworld
cd helloworld
# 执行此语句,需等待一段时间
gitbook init # 启动服务
gitbook serve

遇到问题

TypeError: cb.apply is not a function

问题描述

在执行gitbook init时,出现此问题

解决办法:

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的使用备忘的更多相关文章

  1. GIS部分理论知识备忘随笔

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1.高斯克吕格投影带换算 某坐标的经度为112度,其投影的6度带和3度带 ...

  2. python序列,字典备忘

    初识python备忘: 序列:列表,字符串,元组len(d),d[id],del d[id],data in d函数:cmp(x,y),len(seq),list(seq)根据字符串创建列表,max( ...

  3. Vi命令备忘

    备忘 Ctrl+u:向文件首翻半屏: Ctrl+d:向文件尾翻半屏: Ctrl+f:向文件尾翻一屏: Ctrl+b:向文件首翻一屏: Esc:从编辑模式切换到命令模式: ZZ:命令模式下保存当前文件所 ...

  4. ExtJs4常用配置方法备忘

    viewport布局常用属性 new Ext.Viewport({ layout: "border", renderTo: Ext.getBody(), defaults: { b ...

  5. [备忘] Automatically reset Windows Update components

    这两天遇到Windows 10的更新问题,官方有一个小工具,可以用来修复Windows Update的问题,备忘如下 https://support.microsoft.com/en-us/kb/97 ...

  6. ECMAScript 5(ES5)中bind方法简介备忘

    一直以来对和this有关的东西模糊不清,譬如call.apply等等.这次看到一个和bind有关的笔试题,故记此文以备忘. bind和call以及apply一样,都是可以改变上下文的this指向的.不 ...

  7. MFC通过txt查找文件并进行复制-备忘

    MFC基于对话框的Demo txt中每行一个23位的卡号. 文件夹中包含以卡号命名的图像文件.(fpt或者bmp文件) 要求遍历文件夹,找到txt中卡号所对应的图像文件,并复制出来. VC6.0写的. ...

  8. php 相关模块备忘

    在安装php的时候,不管是编译安装: ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc -- ...

  9. 『备忘』HttpWebRequest 在 POST 提交时, 标头(Headers)丢失原因

    近来研究 HttpWebRequest —— 辅助类完成时,POST JSON数据 总会 丢失标头(Headers). HttpWebRequest POST JSON数据,分如下几步: > 将 ...

  10. Javascript备忘模式

    使用备忘模式,利用了函数的自定义属性,先看一个例子 var test = function (){} test.myAttr = "attr"; 这样,就给test加上了一个自定义 ...

随机推荐

  1. ABAP 委外采购收货调用过账bapi

    相关的表: ekko:采购凭证抬头表 用于判断是否委外 ekpo:采购凭证行项目表 用于判断是否委外以及委外采购的数量 resb:获取委外采购单中bom的相应预留 mseg:获取已经委外原材料出库给供 ...

  2. c# Winform 缓动动画

    一.定义缓动动画类public class AnimationHelper { Timer animationTimer = new Timer(); double velocity = 0.0; P ...

  3. Java-封装结果集示例

    1 @Data 2 public class ResultData implements Serializable { 3 4 /** 5 * 状态码 6 */ 7 private String co ...

  4. 推荐一个json直接导出Excel的网站

    https://wejson.cn/json2excel/

  5. Spring 常见注解及其作用

    1.@ConfigurationProperties    可以非常方便的把资源文件中的内容绑定到对象上       绑定单一属性值,绑定整个对象属性   2.@Value("${app.n ...

  6. 25js String(字符串)对象

    <!DOCTYPE html> <html lang="en">   <head>     <meta charset="UTF ...

  7. 如何用python将txt中的package批量安装

    第一步:cd 到目标路径 第二步:新建一个requirement.txt文档,将所有要下载的包一一罗列出来(需要指定版本的话,可以用==表明) 第三步:输入命令  pip install -r req ...

  8. 2023-03-03 js map 双重嵌套

    恩..其实也没啥要记录的,记住关键一点就是必须要有return,不管是几重,比如: arr.map((item, index) => {     return (         item.ar ...

  9. 用swift开发framework时采用OC混编的解决方案

    随着swift ABI的稳定,越来越多的开发者开始使用swift语言开发项目,但是由于大部分工具库也还是使用OC写的,因此我们不得不需要在项目中采用swift与oc混编. 在开发app项目时,swif ...

  10. 第十三天笔记Cookie

    第十三天笔记Cookie 计算机重要的四个内容 数据结构 数据存储的结构及逻辑的体现,以及相关数据结构之间的操作(算法) 操作系统 windows(dos命令).linux(指令操作) 计网 网络通信 ...