Skip to content

Commit 775de01

Browse files
committed
README: use console markup consistently
As early as 5d721a7 (readme is markdown, 2012-03-08), the `README` was written in Markdown, but its Unix shell command snippets were not marked up as such (most likely because way back when, syntax highlighting in `<pre>` blocks had not yet been dreamt up). However, we are approaching the end of the first quarter of the 21st century and it is time to go with the times. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 021a647 commit 775de01

File tree

1 file changed

+58
-26
lines changed

1 file changed

+58
-26
lines changed

README.md

Lines changed: 58 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -55,97 +55,129 @@ To render the site locally, you'll need [Hugo](https://gohugo.io/)'s **extended*
5555

5656
You can verify the Hugo version like this:
5757

58-
$ hugo version
59-
hugo v0.128.0+extended linux/amd64 BuildDate=unknown
58+
```console
59+
$ hugo version
60+
hugo v0.128.0+extended linux/amd64 BuildDate=unknown
61+
```
6062

6163
You can serve the site locally via:
6264

63-
$ node script/serve-public.js
65+
```console
66+
$ node script/serve-public.js
67+
```
6468

6569
The site should be running on http://127.0.0.1:5000.
6670

6771
If you want to serve the site via Hugo's built-in mechanism, you will need to turn off ["ugly URLs"](https://gohugo.io/content-management/urls/#appearance), by running this command, which will serve the site via http://127.0.0.1:1313:
6872

69-
$ HUGO_UGLYURLS=false hugo serve -w
73+
```console
74+
$ HUGO_UGLYURLS=false hugo serve -w
75+
```
7076

7177
Side note: What _are_ "ugly URLs"? Hugo, by default, generates "pretty" URLs like https://git-scm.com/about/ (note the trailing slash) instead of what it calls "ugly" URLs like https://git-scm.com/about.html. However, since GitHub Pages auto-resolves "even prettier" URLs like https://git-scm.com/about by appending `.html` first, we _want_ the "ugly" URLs to be used here. The `serve-public.js` script emulates GitHub Pages' behavior, while `hugo serve` does not.
7278

7379
Pro-Tip: Do this in a sparse checkout that excludes large parts of `content/`, to speed up the rendering time.
7480

7581
To test the site locally _with_ the search enabled, run this instead:
7682

77-
$ hugo
78-
$ npx -y pagefind --site public
79-
$ node script/serve-public.js
83+
```console
84+
$ hugo
85+
$ npx -y pagefind --site public
86+
$ node script/serve-public.js
87+
```
8088

8189
You can also use Pagefind's built-in server (which will be running on http://127.0.0.1:1414), but again, you have to turn off "ugly URLs":
8290

83-
$ HUGO_UGLYURLS=false hugo
84-
$ npx -y pagefind --site public --serve
91+
```console
92+
$ HUGO_UGLYURLS=false hugo
93+
$ npx -y pagefind --site public --serve
94+
```
8595

8696
Note that running Pagefind will make the process about 7 times slower, and the site will not be re-rendered and live-reloaded in the browser when you change files in `content/` (unlike with `hugo serve -w`).
8797

8898
## Update manual pages
8999

90100
First, install the Ruby prerequisites:
91101

92-
$ bundler install
102+
```console
103+
$ bundler install
104+
```
93105

94106
Then, you can build the manual pages using a local Git source clone like this:
95107

96-
$ ruby ./script/update-docs.rb /path/to/git/.git en
108+
```console
109+
$ ruby ./script/update-docs.rb /path/to/git/.git en
110+
```
97111

98112
This will populate the manual pages for all Git versions. You can also populate them only for a specific Git version (faster):
99113

100-
$ version=v2.23.0
101-
$ REBUILD_DOC=$version ruby ./script/update-docs.rb /path/to/git/.git en
114+
```console
115+
$ version=v2.23.0
116+
$ REBUILD_DOC=$version ruby ./script/update-docs.rb /path/to/git/.git en
117+
```
102118

103119
Or you can populate the man pages from GitHub (much slower) like this:
104120

105-
$ export GITHUB_API_TOKEN=github_personal_auth_token
106-
$ REBUILD_DOC=$version ruby ./script/update-docs.rb remote en # specific version
121+
```console
122+
$ export GITHUB_API_TOKEN=github_personal_auth_token
123+
$ REBUILD_DOC=$version ruby ./script/update-docs.rb remote en # specific version
124+
```
107125

108126
Similarly, you can also populate the localized man pages. From a local clone of https://github.com/jnavila/git-html-l10n :
109127

110-
$ ruby ./script/update-docs.rb /path/to/git-html-l10n/.git l10n # all versions
111-
$ REBUILD_DOC=$version ruby ./script/update-docs.rb /path/to/git-html-l10n/.git l10n # specific version
128+
```console
129+
$ ruby ./script/update-docs.rb /path/to/git-html-l10n/.git l10n # all versions
130+
$ REBUILD_DOC=$version ruby ./script/update-docs.rb /path/to/git-html-l10n/.git l10n # specific version
131+
```
112132

113133
Or you can do it from GitHub (much slower) like this:
114134

115-
$ export GITHUB_API_TOKEN=github_personal_auth_token
116-
$ REBUILD_DOC=$version ruby ./script/update-docs.rb remote l10n # specific version
135+
```console
136+
$ export GITHUB_API_TOKEN=github_personal_auth_token
137+
$ REBUILD_DOC=$version ruby ./script/update-docs.rb remote l10n # specific version
138+
```
117139

118140
## Update the `Downloads` pages
119141

120142
Now you need to get the latest downloads for the downloads pages:
121143

122-
$ ruby ./script/update-download-data.rb
144+
```console
145+
$ ruby ./script/update-download-data.rb
146+
```
123147

124148
## Update the ProGit book
125149

126150
First, you will have to get the necessary prerequisites:
127151

128-
$ bundler install
152+
```console
153+
$ bundler install
154+
```
129155

130156
Now you'll probably want some book data.
131157

132158
You'll have to get the book content from a repository on your computer by specifying the path:
133159

134-
$ git clone https://github.com/progit/progit2-fr ../progit2-fr
135-
$ ruby ./script/update-book2.rb fr ../progit2-fr
160+
```console
161+
$ git clone https://github.com/progit/progit2-fr ../progit2-fr
162+
$ ruby ./script/update-book2.rb fr ../progit2-fr
163+
```
136164

137165
That will generate the book content from the Asciidoc files and write the files to the local tree, ready to be committed and served via Hugo.
138166

139167
Alternatively, you need to have access to the [Pro Git project on GitHub](https://github.com/progit/progit2) through the API.
140168

141-
$ export GITHUB_API_TOKEN=github_personal_auth_token
142-
$ ruby ./script/update-book2.rb en
169+
```console
170+
$ export GITHUB_API_TOKEN=github_personal_auth_token
171+
$ ruby ./script/update-book2.rb en
172+
```
143173

144174
If you have 2FA enabled, you'll need to create a [Personal Access Token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/).
145175

146176
If you want to build the book for all available languages, just omit the language code parameter:
147177

148-
$ ruby ./script/update-book2.rb
178+
```console
179+
$ ruby ./script/update-book2.rb
180+
```
149181

150182
## Contributing
151183

0 commit comments

Comments
 (0)