GitBook

webstorm 中 git 基本操作

倖福魔咒の 提交于 2020-02-28 13:04:46
一、 基本设置 在安装完 Git 之后,需要运行以下两句命令 git config [--global] user.name "John Doe" git config [--global] user.email johndoe@example.com 如果不想每次 pull|push 操作都输入用户名、密码则添加以下设置 git config [--global] credential.helper store 二、 本地库(仓库)[init|clone] 新建仓库: 创建一个目录,在目录中执行 git init 克隆仓库: git clone <remote|local> [pathname] remote: 远程库地址 local: 本地库地址 pathname: 检出路径(默认为当前目录) 三、 文件[add|commit] 文件状态: Untracked: 未跟踪 Unmodified: 未修改 Modified: 已修改 Staged: 已暂存 将未跟踪(Untracked)或已修改文件(Modified)放入暂存区(Staged): git add <.|pathname>... .: 所有文件 pathanme: 文件路径 将暂存区(Staged)的文件保存(未修改状态:Unmodified) git commit <-m message> -m message:

如何用 gitbook 结合 markdown 写一本开源书籍

拥有回忆 提交于 2020-02-27 02:56:16
直接进入正题。 1. 安装 gitbook 并写书 首先,安装。 $ npm install -g gitbook-cli 如果你没有 nodejs 环境,你就去官网下载安装一下,安装完就有 npm 命令了。 新建一个目录放书的内容,比如叫 webpack ,这个目录里是放书的内容。 $ mkdir webpack $ cd webpack 然后初始化生成文件。 $ gitbook init 生成了下面两个文件。 . ├── README.md └── SUMMARY.md 其中 README.md 是放书的说明, SUMMARY.md 是放书的目录。 看了我的内容,你应该就会明白如何写的。 README.md # webpack 3 零基础入门教程 最详细,最简单的零基础 webpack 3 入门教程,人人都能学会。 原文发布于我的个人博客:https://www.rails365.net 源码位于:https://github.com/yinsigan/webpack-tutorial 电子版: [PDF](https://www.gitbook.com/download/pdf/book/yinsigan/webpack-3) [Mobi](https://www.gitbook.com/download/mobi/book/yinsigan/webpack-3) [ePbu

修复Git分离头?

喜欢而已 提交于 2020-01-08 09:46:24
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我在存储库中进行了一些工作,发现文件有本地更改。 我不再想要它们了,所以我删除了文件,以为我可以签出新副本。 我想做相当于 svn up . 使用 git pull 似乎没有用。 一些随机搜索将我带到一个有人建议这样做的站点 git checkout HEAD^ src/ ( src 是包含已删除文件的目录)。 现在我发现我有一个超脱的头。 我不知道那是什么。 我该如何撤消? #1楼 当您在 git 签出特定的提交时,您最终会处于 分离的头部 状态……也就是说,您的工作副本不再反映命名引用(例如“ master”)的状态。 这对于检查存储库的过去状态很有用,但是对于您实际上想要还原的更改却不是您想要的。 如果您对特定文件进行了更改,而只想放弃它们,则可以使用 checkout 命令,如下所示: git checkout myfile 这将丢弃所有未提交的更改,并将文件还原到当前分支头中的任何状态。 如果要放弃已提交的更改,则可能要使用 reset 命令。 例如,这会将存储库重置为上一次提交的状态,并丢弃所有后续更改: git reset --hard HEAD^ 但是,如果您要与其他人共享存储库,则 git reset 可能会造成破坏(因为它会删除存储库历史记录的一部分)。 如果您已经与其他人共享了更改

R Bookdown - Customize width of TOC/Sidebar

坚强是说给别人听的谎言 提交于 2020-01-01 15:36:46
问题 Although I can change the width and position of different elements in the body of an r bookdown doc by modifying the page wrapper in the .css, is there a way to change the width of the sidebar by modifying the styles sheet? I'm not looking to change the font or color of the words in the TOC, just the width. Something like: width: 50px; margin-right: 0; I don't need a wide sidebar, but I do need more width in the body. I already widened the inner body as much as possible, so all that is left

How to import a markdown file from github into local gitbook

孤人 提交于 2019-12-25 09:16:57
问题 I try to import an .md file from a repo on github into my local gitbook. I want to do something like this in my SUMMARY.md file: # Summary * [Introduction](README.md) * [button-color](https://github.com/blah/button-color/blob/master/README.md) In this case it becomes only a link. How can I import the file? I googled it but can't find any answer. Is this even possible? Help would be greatly appreciated. 回答1: I found out how to do it. I created a BUTTON-COLOR.md file. In the file I needed this

How to change the code padding effect of gitbook?

你。 提交于 2019-12-24 13:33:59
问题 This is the markdown code effect of stackoverflow: Code from stackoverflow Nearly no extra space at the beginning And this is the markdown code effect of gitbook: The extra blanks at the beginning is confusing for me. So I decided to change it by myself. I did: cd /usr/local/lib/node_modules/gitbook/theme/stylesheets/base vim markdown.less In which there is a code block which looks like: code { padding: 0; padding-top: 0.2em; padding-bottom: 0.2em; margin: 0; font-size: 85%; background-color:

一、Vue 世界初探

荒凉一梦 提交于 2019-12-17 15:56:38
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 前言 我们后端用SpringBoot 框架已经搭建的差不多了之前,既然我们最初的梦想是做先后端分离的架手架,终于也开始学习一下前端的框架了。自己也算是前端小白,所以将自己学习vue 的过程记录系列博客。希望对学习vue 的小伙伴有帮助,用时文章中有不对的,希望大家及时提出一起探讨。 至于为什么要使用vue ,虽然是一个前端小白,但是还是知道当前主流的三大框架,Angular、React以及Vue .优劣我就不说了,我就说说我为什么选择vue 吧。其实还是因为毕竟是后端开发,对前端的东西不要求深入理解,做到能用能复制就好了。所以基本上是本着最小学习成本来的。所以相对Angular 和React来说,vue 算是上手最快的,所以也就入坑了。自己话了一周的时间预研,勉强算自己入门了吧,所以才开始写博客记录下来,这样也算是对自己学习的内容的整理,也可以记录下来方便大家。 学习地址 想要了解vue 是什么, 怎么学习?我也是参考网上的资料学习的。 vue.js 的官网: https://cn.vuejs.org/v2/guide/ 菜鸟教程: https://www.runoob.com/vue2/vue-tutorial.html gitBook: http://vue_book.siwei.me/preface

Create gitbook from github wiki pages

☆樱花仙子☆ 提交于 2019-12-12 08:58:51
问题 I've a lot of documentation in github wiki. I would like organize it and create a book out of it. When ever I update the wiki, the book should be updated. Is this possible ? 回答1: Welcome to Gitbook. This service might help you. https://www.gitbook.com/blog/features/import-github This service as far I read doesnt support github wiki directly. However because github stores wiki as a seperate repository with reponame.wiki.git, you should be able to import this github repo into gitbook. 来源: https

How to modify the font size in GitBook?

杀马特。学长 韩版系。学妹 提交于 2019-12-12 08:14:52
问题 As the title says, there's a preference called "Edit Configuration" in the GitBook Editor, it says that you should use json to build a book.json . How can I write this file to modify the font size? Having searched it on the web, I hardly found any useful articles. 回答1: That depends on how you're planning to publish. From the "How to use it" section: Here are the options that can be stored in this file: { // ... // Global configuration for plugins "pluginsConfig": { "fontSettings": { // ...

gitbook 入门教程之自定义不一样的多语言首页插件

一曲冷凌霜 提交于 2019-12-11 17:39:06
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> > 自定义多语言主页 中文 | English 🏠 主页 Github : https://snowdreams1006.github.io/gitbook-plugin-multilingual-index/ GitLab : https://snowdreams1006.gitlab.io/gitbook-plugin-multilingual-index/ Gitee : https://snowdreams1006.gitee.io/gitbook-plugin-multilingual-index/ 屏幕截图 用法 步骤#1 - 更新 book.json 文件 在您的gitbook的 book.json 文件中,将 multilingual-index 添加到 plugins 列表中。 在 pluginsConfig ,将 enableSuper 设置为 false 可禁用默认主页,并添加 index 值以自定义多语言主页。仅支持相对路径。 这是最简单的示例: { "plugins": ["multilingual-index"], "pluginsConfig": { "multilingual-index": { "enableSuper": false, "index":"index.html"