Project Jupyter has been a boon for the Data Science, Machine Learning, and AI Community of Practitioners and Developers.
Jupyter项目对数据科学,机器学习以及从业人员和开发人员AI社区是一个福音。
Every time I start building a Report or a Model, the first tool that comes to my mind is
每当我开始构建报表或模型时,我想到的第一个工具就是
“The Legendary Jupyter Notebook”
“传奇的Jupyter笔记本”
I’ve also worked with Jupyter Lab, an easily accessible collection of Jupyter Notebooks and other files. In February 2019, Project Jupyter further launched Jupyter Books — a complete package with amazing capabilities.
我还与Jupyter Lab合作,Jupyter Lab是Jupyter Notebooks和其他文件的易于访问的集合。 在2019年2月,Jupyter项目进一步推出了Jupyter Books-一个具有惊人功能的完整软件包。
Before getting started, I would like to mention the fact that building the best Jupyter Books would require some basic HTML understanding, in fact as long as you can use basic logic and figure out a way to edit stuff inside your HTML files, you’re good to go. Let’s hit it!
在开始之前,我想提一提一个事实,即构建最佳的Jupyter图书需要一定HTML基本知识,实际上,只要您可以使用基本逻辑并找出一种方法来编辑HTML文件中的内容,好去。 打吧!
https://jupyterbook.org/intro.html https ://jupyterbook.org/intro.htmlMost importantly, you are now capable of publishing your own production quality Technical Data Science Book Online, with Code, Images and Documents.
最重要的是,您现在可以在线发布自己的生产质量的技术数据科学书籍,以及代码,图像和文档。
Since, Jupyter books are comparatively new and still in a rapid development phase, to keep your other installations and dependencies safe, it’s recommended to first set up your Virtual Environment
由于Jupyter书籍相对较新,并且仍处于快速发展阶段,为了确保其他安装和依赖项的安全,建议您首先设置虚拟环境
Virtual Environment
虚拟环境
conda create -n JBook python=3.6conda activate JBook # Deactivate once done : conda deactivateInstallation
安装
pip install jupyter-bookCreate your first Jupyter Book : Source files for the Book
创建您的第一本Jupyter书:该书的源文件
jupyter-book create MyFirstJupyterBook Create Confirmation 创建确认Build your Jupyter Book : Runs the Book over source files
建立您的Jupyter Book:在源文件上运行Book
jupyter-book build MyFirstJupyterBook/ Build Confirmation 生成确认and just like that, you’ve built a Jupyter Book. Let’s make it yours now.
就像那样,您已经建立了Jupyter Book。 现在就让它成为您的吧。
If you followed along, this is what you should get when you open the MyFirstJupyterBook/_build/html/index.html file in your browser
如果继续进行,这是在浏览器中打开MyFirstJupyterBook / _build / html / index.html文件时应获得的内容
_config.yml: To manage the Book Design Settings
_config.yml :管理书籍设计设置
_toc.yml: To define the Table of Contents
_toc.yml :定义目录
_config.yml
_config.yml
_config.yml _config.ymlCustomizable options —
可自定义的选项-
title: The Title of the Book title:书名 author: Yours Truly作者:您的真实logo: You!标志:你!Github URL Github URLWe start with copying an image from our Local desktop to the Jupyter Book Directory with the following command :
我们首先使用以下命令将图像从本地桌面复制到Jupyter Book Directory:
cp Desktop/<IMG>.<EXT> MyFirstJupyterBook/Example : cp Desktop/DP.jpg MyFirstJupyterBook/Open the file with vim editor, hit ‘i’ Insert, Edit & Save with “Esc”+ “:wq”
用vim编辑器打开文件,点击'i'插入,用“ Esc” +“:wq”编辑并保存
vim _config.yml Editing the _config.yml file 编辑_config.yml文件After editing the _config.yml file, go back to the parent folder and build the Book again to implement the changes made, TA-DA !!
编辑_config.yml文件后,返回到父文件夹并再次构建Book以实施所做的更改,TA-DA !!
Further, edit the “intro.md” file to change the Introduction Statements to your Book.
此外,编辑“ intro.md”文件以将“简介”更改为您的书。
Build a simple Jupyter Notebook using Anaconda and add a few markdown cells and Code Cells to make sure there is some content in the notebook
使用Anaconda构建一个简单的Jupyter Notebook,并添加一些markdown单元格和Code Cells以确保笔记本中有一些内容
Copy the Jupyter Notebook from your current directory to your Jupyter Book
将Jupyter Notebook从当前目录复制到Jupyter Book
cp Downloads/My_Jupyter_Notebook.ipynb ./MyFirstJupyterBookAdd this Jupyter Notebook to your Table of Contents in the _toc.yml file and edit as follows -
将此Jupyter笔记本添加到_toc.yml文件的目录中,并进行如下编辑-
Build your Jupyter Book one last time and the magic happens!
上一次建立您的Jupyter Book,魔术就发生了!
In the “Content in Jupyter Notebook” Section, you will find the first Markdown of your Notebook as a file and BINGO!
在“ Jupyter Notebook中的内容”部分中,您将找到Notebook的第一个Markdown作为文件和BINGO!
Congratulations! on building your first Jupyter Book and I hope you enjoyed the process with minimum complications. To be honest, we just scratched the surface and there’s a lot more to be achieved with this super Tool. Part — 2 Coming Soon…
恭喜你! 关于编写第一本Jupyter书的过程,希望您喜欢这个过程,并且并发症最少。 坦白地说,我们只是从头开始,使用此超级工具还有很多工作要做。 第2部分即将推出…
Have a great day! Cheers!
祝你有美好的一天! 干杯!
翻译自: https://medium.com/swlh/introduction-to-jupyter-books-part-1-754730fa8ba4