Skip to content

Commit 8402681

Browse files
authored
Merge pull request #144 from justwriteclick/ag-gh-start
Adds an article on getting started with an existing docs repo
2 parents 646bb5b + f640661 commit 8402681

31 files changed

Lines changed: 376 additions & 380 deletions

Gemfile.lock

Lines changed: 42 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,32 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (5.2.2)
5-
concurrent-ruby (~> 1.0, >= 1.0.2)
6-
i18n (>= 0.7, < 2)
7-
minitest (~> 5.1)
8-
tzinfo (~> 1.1)
9-
addressable (2.5.2)
10-
public_suffix (>= 2.0.2, < 4.0)
4+
addressable (2.7.0)
5+
public_suffix (>= 2.0.2, < 5.0)
116
colorator (1.1.0)
12-
colorize (0.8.1)
13-
concurrent-ruby (1.1.4)
7+
concurrent-ruby (1.1.5)
148
em-websocket (0.5.1)
159
eventmachine (>= 0.12.9)
1610
http_parser.rb (~> 0.6.0)
1711
ethon (0.12.0)
1812
ffi (>= 1.3.0)
1913
eventmachine (1.2.7)
20-
faraday (0.15.4)
14+
faraday (1.0.0)
2115
multipart-post (>= 1.2, < 3)
22-
ffi (1.10.0)
16+
ffi (1.12.2)
2317
forwardable-extended (2.6.0)
24-
gemoji (3.0.0)
25-
html-pipeline (2.10.0)
26-
activesupport (>= 2)
27-
nokogiri (>= 1.4)
28-
html-proofer (3.10.2)
29-
activesupport (>= 4.2, < 6.0)
18+
html-proofer (3.15.1)
3019
addressable (~> 2.3)
31-
colorize (~> 0.8)
32-
mercenary (~> 0.3.2)
33-
nokogiri (~> 1.9)
20+
mercenary (~> 0.3)
21+
nokogumbo (~> 2.0)
3422
parallel (~> 1.3)
23+
rainbow (~> 3.0)
3524
typhoeus (~> 1.3)
3625
yell (~> 2.0)
3726
http_parser.rb (0.6.0)
3827
i18n (0.9.5)
3928
concurrent-ruby (~> 1.0)
40-
jekyll (3.8.5)
29+
jekyll (3.8.6)
4130
addressable (~> 2.4)
4231
colorator (~> 1.0)
4332
em-websocket (~> 0.5)
@@ -50,72 +39,62 @@ GEM
5039
pathutil (~> 0.9)
5140
rouge (>= 1.7, < 4)
5241
safe_yaml (~> 1.0)
53-
jekyll-data (1.0.0)
54-
jekyll (~> 3.3)
55-
jekyll-feed (0.9.3)
56-
jekyll (~> 3.3)
42+
jekyll-feed (0.13.0)
43+
jekyll (>= 3.7, < 5.0)
5744
jekyll-gist (1.5.0)
5845
octokit (~> 4.2)
5946
jekyll-paginate (1.1.0)
6047
jekyll-sass-converter (1.5.2)
6148
sass (~> 3.4)
62-
jekyll-seo-tag (2.5.0)
63-
jekyll (~> 3.3)
64-
jekyll-sitemap (1.2.0)
65-
jekyll (~> 3.3)
66-
jekyll-theme-so-simple (3.1.2)
67-
jekyll (~> 3.6)
68-
jekyll-data (~> 1.0)
69-
jekyll-feed (~> 0.9.2)
49+
jekyll-seo-tag (2.6.1)
50+
jekyll (>= 3.3, < 5.0)
51+
jekyll-sitemap (1.4.0)
52+
jekyll (>= 3.7, < 5.0)
53+
jekyll-theme-so-simple (3.2.0)
54+
jekyll (>= 3.6, < 5.0)
55+
jekyll-feed (~> 0.1)
7056
jekyll-gist (~> 1.4)
7157
jekyll-paginate (~> 1.1)
7258
jekyll-seo-tag (~> 2.4)
73-
jekyll-sitemap (~> 1.1)
74-
jemoji (~> 0.8)
75-
jekyll-watch (2.1.2)
59+
jekyll-sitemap (~> 1.3)
60+
jekyll-watch (2.2.1)
7661
listen (~> 3.0)
77-
jemoji (0.10.2)
78-
gemoji (~> 3.0)
79-
html-pipeline (~> 2.2)
80-
jekyll (~> 3.0)
8162
kramdown (1.17.0)
82-
liquid (4.0.1)
83-
listen (3.1.5)
84-
rb-fsevent (~> 0.9, >= 0.9.4)
85-
rb-inotify (~> 0.9, >= 0.9.7)
86-
ruby_dep (~> 1.2)
63+
liquid (4.0.3)
64+
listen (3.2.1)
65+
rb-fsevent (~> 0.10, >= 0.10.3)
66+
rb-inotify (~> 0.9, >= 0.9.10)
8767
mercenary (0.3.6)
8868
mini_portile2 (2.4.0)
89-
minitest (5.11.3)
90-
multipart-post (2.0.0)
91-
nokogiri (1.10.4)
69+
multipart-post (2.1.1)
70+
nokogiri (1.10.7)
9271
mini_portile2 (~> 2.4.0)
93-
octokit (4.13.0)
72+
nokogumbo (2.0.2)
73+
nokogiri (~> 1.8, >= 1.8.4)
74+
octokit (4.16.0)
75+
faraday (>= 0.9)
9476
sawyer (~> 0.8.0, >= 0.5.3)
95-
parallel (1.17.0)
77+
parallel (1.19.1)
9678
pathutil (0.16.2)
9779
forwardable-extended (~> 2.6)
98-
public_suffix (3.0.3)
80+
public_suffix (4.0.3)
81+
rainbow (3.0.0)
9982
rb-fsevent (0.10.3)
100-
rb-inotify (0.10.0)
83+
rb-inotify (0.10.1)
10184
ffi (~> 1.0)
102-
rouge (3.3.0)
103-
ruby_dep (1.5.0)
85+
rouge (3.15.0)
10486
safe_yaml (1.0.5)
105-
sass (3.7.3)
87+
sass (3.7.4)
10688
sass-listen (~> 4.0.0)
10789
sass-listen (4.0.0)
10890
rb-fsevent (~> 0.9, >= 0.9.4)
10991
rb-inotify (~> 0.9, >= 0.9.7)
110-
sawyer (0.8.1)
111-
addressable (>= 2.3.5, < 2.6)
112-
faraday (~> 0.8, < 1.0)
113-
thread_safe (0.3.6)
92+
sawyer (0.8.2)
93+
addressable (>= 2.3.5)
94+
faraday (> 0.8, < 2.0)
11495
typhoeus (1.3.1)
11596
ethon (>= 0.9.0)
116-
tzinfo (1.2.5)
117-
thread_safe (~> 0.1)
118-
yell (2.1.0)
97+
yell (2.2.1)
11998

12099
PLATFORMS
121100
ruby
@@ -125,4 +104,4 @@ DEPENDENCIES
125104
jekyll-theme-so-simple
126105

127106
BUNDLED WITH
128-
2.0.1
107+
1.16.3

_layouts/learn.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ <h1>{{ page.title }}</h1>
2020
<img src="{{ page.image.thumbnail }}" alt="{{ page.image.caption }}">
2121
</div>
2222
{{ content }}
23+
24+
{% include sign-up.html %}
25+
2326
</div>
2427
</div>
2528
{% include footer.html %}

_learn/00-github-for-docs-files.md

Lines changed: 268 additions & 0 deletions
Large diffs are not rendered by default.

_learn/01-sphinx-python-rtd.md

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,36 @@ image:
66
caption: "Python and Sphinx"
77
---
88

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.
1010

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/).
1212

13-
#### Installing Python 2.7.x on Mac
13+
## Prerequisites
1414

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/.
1617

17-
```
18-
brew install python@2
19-
```
18+
## Installing Python 3.x
2019

21-
#### Installing Python 3.x
20+
You want the latest version of Python 3 available.
2221

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).
2623

2724
```
2825
brew install python
2926
```
3027
31-
#### Verifying Python 2 and Python 3
28+
### Verifying the Python installation
3229
3330
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-
```
4331
1. Verify that Python 3 is correctly installed.
4432
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-
5533
```
5634
python -V
5735
```
58-
Expected output for August 2018:
36+
Expected output for February 2020:
5937
```
60-
Python 2.7.15
38+
Python 3.7.6
6139
```
6240
6341
## Set Up Virtual Environment
@@ -68,10 +46,10 @@ Most people use Virtual Environments because it's a recommended practice when wo
6846
6947
**Python 3**
7048
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.
7250
7351
```
74-
python3.7 -m venv py3-sphinx
52+
python -m venv py3-sphinx
7553
```
7654
7755
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
8866
1. Now verify that `python` is now linked to Python 3.
8967
9068
```
91-
(py3-sphinx) $ python3.7 -V
69+
(py3-sphinx) $ python -V
9270
```
9371
9472
```
95-
(py3-sphinx) $ Python 3.7.2
73+
(py3-sphinx) $ Python 3.7.6
9674
```
9775
9876
## Install Sphinx in the Virtual Environment

_learn/02-jekyll-ruby-gh-pages.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ image:
99

1010
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.
1111

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+
1218
## Set up Ruby and Jekyll on Windows with Docker
1319

1420
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.

_learn/03-hugo-go-netlify.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ To build Hugo sites locally, install Homebrew and Hugo. You do not need to insta
1111

1212
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.
1313

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+
1420
## Set up Hugo on Windows with Git Bash and Docker
1521

1622
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.

_learn/04-add-content-workflow.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ image:
99

1010
This section goes through the workflow for adding content, editing pages, and generally working on a docs site in a GitHub repo.
1111

12+
## Prerequisites
13+
14+
* A GitHub, GitLab, or other Git online account.
15+
* A Git repository already created online in one of those services (GitHub, GitLab, or other) and already cloned locally.
16+
17+
These steps are shown from within a directory that contains the Git repository files.
18+
1219
## Add content to the site
1320

1421
Once you have created files required by your static site generator, you can start writing. Begin with the index, or home page.

_learn/11-print-pdf-epub-output.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: "Evaluating print, PDF, or epub output"
3+
layout: learn
4+
image:
5+
path: /images/learn/print-pdf-epub.png
6+
thumbnail: /images/learn/print-pdf-epub400x225.png
7+
---
8+
9+
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

Comments
 (0)