You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _learn/01-sphinx-python-rtd.md
+15-37Lines changed: 15 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,58 +6,36 @@ image:
6
6
caption: "Python and Sphinx"
7
7
---
8
8
9
-
Sphinx works with either major versions of Python active today, Python 2 and Python 3. Python 3 is the current and recommended version. Sphinx is a documentation tool that creates HTML, CSS, and JavaScript files from [ReStructured](http://docutils.sourceforge.net/rst.html) text files.
9
+
Sphinx works with either major versions of Python active today, Python 2 and Python 3. Python 3 is the current and recommended version, and Python 2 is an unsupported Python version. Sphinx is a documentation tool that creates HTML, CSS, and JavaScript files from [ReStructured](http://docutils.sourceforge.net/rst.html) text files.
10
10
11
-
In case you need both versions, this tutorial walks through both on a Mac. Refer to the [Downloads on the Python site](https://www.python.org/downloads/windows/) for Windows.
11
+
In case you need both versions, refer to the [Downloads on the Python site](https://www.python.org/downloads/).
12
12
13
-
#### Installing Python 2.7.x on Mac
13
+
##Prerequisites
14
14
15
-
1. Open a terminal and use `brew` to install Python 2.7.x.
15
+
* MacOS or a Linux-based environment in which to install Python.
16
+
* Homebrew installed on MacOS. Get installation instructions from https://brew.sh/.
16
17
17
-
```
18
-
brew install python@2
19
-
```
18
+
## Installing Python 3.x
20
19
21
-
#### Installing Python 3.x
20
+
You want the latest version of Python 3 available.
22
21
23
-
You also want the latest version of Python 3 available.
24
-
25
-
1. Open a terminal and use brew to install the latest Python 3.x (currently 3.7).
22
+
1. Open a terminal and use `brew` to install the latest Python 3.x (currently 3.7).
26
23
27
24
```
28
25
brew install python
29
26
```
30
27
31
-
#### Verifying Python 2 and Python 3
28
+
### Verifying the Python installation
32
29
33
30
1. Open a terminal.
34
-
1. Verify that Python 2 is correctly installed.
35
-
36
-
```
37
-
python2.7 -V
38
-
```
39
-
Expected output for August 2018:
40
-
```
41
-
Python 2.7.15
42
-
```
43
31
1. Verify that Python 3 is correctly installed.
44
32
45
-
```
46
-
python3.7 -V
47
-
```
48
-
Expected output for August 2018:
49
-
```
50
-
Python 3.7.0
51
-
```
52
-
53
-
1. Check the version set as the default version, the version of Python that is executed when you simply enter `python`. The default version of Python remains a Python 2.7 version.
54
-
55
33
```
56
34
python -V
57
35
```
58
-
Expected output for August 2018:
36
+
Expected output for February 2020:
59
37
```
60
-
Python 2.7.15
38
+
Python 3.7.6
61
39
```
62
40
63
41
## Set Up Virtual Environment
@@ -68,10 +46,10 @@ Most people use Virtual Environments because it's a recommended practice when wo
68
46
69
47
**Python 3**
70
48
71
-
1. First create a Python 3 virtual environment using the `venv` module included with Python 3. Notice the example uses `python3.7` to be clear which version of Python you want.
49
+
1. First create a Python 3 virtual environment using the `venv` module included with Python 3.
72
50
73
51
```
74
-
python3.7 -m venv py3-sphinx
52
+
python -m venv py3-sphinx
75
53
```
76
54
77
55
1. Now "activate" the environment. Look for the name of the virtual environment enclosed in parenthesis after activation.
@@ -88,11 +66,11 @@ Most people use Virtual Environments because it's a recommended practice when wo
88
66
1. Now verify that `python` is now linked to Python 3.
Copy file name to clipboardExpand all lines: _learn/02-jekyll-ruby-gh-pages.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,12 @@ image:
9
9
10
10
Jekyll is a Static Site Generator that typically accepts [Markdown](https://commonmark.org/help/) for authoring. [Jekyll](https://jekyllrb.com/) has its own documentation site and a [Quickstart](https://jekyllrb.com/docs/). To prepare your environment to build Jekyll sites locally, follow the instructions for either Windows or MacOS.
11
11
12
+
## Prerequisites
13
+
* Windows, MacOS, or a Linux-based environment.
14
+
* On MacOS, you will install [Homebrew](https://brew.sh).
15
+
* On Windows, you must install Docker.
16
+
* On Windows, you must install [Git for Windows](https://gitforwindows.org/) which includes Git Bash.
17
+
12
18
## Set up Ruby and Jekyll on Windows with Docker
13
19
14
20
On Windows, first install [Docker](https://docs.docker.com/docker-for-windows/) and [Git Bash](https://gitforwindows.org/), so that you are able to use Linux-based Docker images and commands. Then follow these steps to set up Jekyll and Ruby.
Copy file name to clipboardExpand all lines: _learn/03-hugo-go-netlify.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,12 @@ To build Hugo sites locally, install Homebrew and Hugo. You do not need to insta
11
11
12
12
Since Hugo is built on Go, you can use the binary for your operating system. No need to maintain a development environment. Upgrades are easy too, get a new binary and install it and you're upgraded.
13
13
14
+
## Prerequisites
15
+
* Windows, MacOS, or a Linux-based environment.
16
+
* On MacOS, you will install [Homebrew](https://brew.sh).
17
+
* On Windows, you must install Docker.
18
+
* On Windows, you must install [Git for Windows](https://gitforwindows.org/) which includes Git Bash.
19
+
14
20
## Set up Hugo on Windows with Git Bash and Docker
15
21
16
22
You can also set up Docker and then use this [Docker image](https://hub.docker.com/r/jguyomard/hugo-builder/), and set up alias commands for `hugo` running in Docker, but using the same `hugo` commands in Git Bash on Windows.
How difficult or straightforward is it to create a print or PDF format? You may want to investigate and test solutions beyond this article, as requirements and print tolerances can vary widely.
10
+
11
+
### Jekyll options
12
+
13
+
In the Jekyll Documentation Theme site, Tom Johnson suggests buying a license for Prince XML ($500) in order to create print-ready PDF files with the [Jekyll Documentation Theme](https://idratherbewriting.com/documentation-theme-jekyll/). The PDF layout and styles are set using CSS. Considering that the only gem solution, [jekyll-pdf](https://github.com/abeMedia/jekyll-pdf), makes PDF files of single pages rather than a collection, the third-party solution is probably the way to go. You could look into the [Open-Publisher](https://github.com/chrisanthropic/Open-Publisher) project, which is using Jekyll to create outputs that can be used as Pandoc inputs. [Pandoc](http://pandoc.org/) is a super handy conversion tool that can convert many formats to other formats, and has templating capabilities that can help.
14
+
15
+
### Sphinx options
16
+
17
+
When you use Read the Docs builds for deployment, you automatically get versioned documentation based on releases, as well as PDF output for the entire site. The PDF formatting is based on [LaTex](https://www.latex-project.org/), an open source typesetting system. It has page numbering, linking, and footnotes.
18
+
19
+
You also notice you get an Epub output when you use [Read the Docs](https://readthedocs.org/). Sphinx does have advantages over other static site generators for book-like output options since the Read the Docs theme is so thorough.
20
+
21
+
### Hugo options
22
+
23
+
Hugo supports many [custom output formats through templates](https://gohugo.io/templates/output-formats/), but as of right now no one has written a series of templates for PDF, based on the discussions in various Issues, such as [#1360 Generate concatenated document for Kindle/PDF generation](https://github.com/gohugoio/hugo/issues/1360) and [#3530 Add alternative rendering format for LaTeX](https://github.com/gohugoio/hugo/issues/3530). You could also use Prince XML as a solution here, similar to Jekyll.
24
+
25
+
## Other options?
26
+
27
+
For the _Docs Like Code_ book, I have written an article about how I created print-ready PDF and Amazon-supported ebook files such as the MOBI format. Read more in [Practical Advice On Publishing A Technical Book using GitHub and GitBook](https://www.docslikecode.com/articles/practical-advice/). GitBook has since changed their overall pricing and support plan, but is certainly worth investigating.
0 commit comments