Skip to content

Commit 7f23879

Browse files
committed
manual: Improve "Getting Started"
Also fix some references in "Interactively Creating and Storing a Token".
1 parent 27e7b17 commit 7f23879

File tree

2 files changed

+127
-20
lines changed

2 files changed

+127
-20
lines changed

ghub.org

+58-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#+TEXINFO_DIR_CATEGORY: Emacs
88
#+TEXINFO_DIR_TITLE: Ghub: (ghub).
99
#+TEXINFO_DIR_DESC: Minuscule client library for the Github API.
10-
#+SUBTITLE: for version 2.0.0 (v2.0.0-4-g21c9e94+1)
10+
#+SUBTITLE: for version 2.0.0 (v2.0.0-7-g27e7b17+1)
1111
#+BIND: ox-texinfo+-before-export-hook ox-texinfo+-update-version-strings
1212

1313
#+TEXINFO_DEFFN: t
@@ -31,7 +31,7 @@ because then all packages that talk to the Github API could be
3131
configured the same way.
3232

3333
#+TEXINFO: @noindent
34-
This manual is for Ghub version 2.0.0 (v2.0.0-4-g21c9e94+1).
34+
This manual is for Ghub version 2.0.0 (v2.0.0-7-g27e7b17+1).
3535

3636
#+BEGIN_QUOTE
3737
Copyright (C) 2017-2018 Jonas Bernoulli <[email protected]>
@@ -99,9 +99,56 @@ to begin with.
9999

100100
* Getting Started
101101

102-
If you would like to use a package that uses this library, then just
103-
do so. If the necessary information isn't available when it attempts
104-
to make a request, then you will be asked to provide it.
102+
Each package that uses Ghub uses its own token. Despite that, changes
103+
are good that after successfully configuring one package you can just
104+
start using another package pretty much instantly.
105+
106+
If the necessary token is not available when a package makes an API
107+
request, then a setup wizard pops up, and after answering a few
108+
questions you are good to go. Even the request that caused the wizard
109+
to be summoned should succeed and for most users this should be true
110+
even when configuring the very first token.
111+
112+
However, in some situations some manual configuration is necessary
113+
*before* using the wizard, or the wizard cannot be used at all:
114+
115+
- If you don't want to use the wizard then you don't have to and can
116+
create tokens manually as describe in [[*Manually Creating and Storing
117+
a Token]].
118+
119+
- If you want to access Gitlab.com or another Gitlab instance, then
120+
you have to create the token manually as describe in [[*Manually
121+
Creating and Storing a Token]].
122+
123+
- If you want to access a Github Enterprise instance, then you have
124+
to tell Ghub about that before the wizard makes its appearance by
125+
setting the Git variable ~github.host~. You also have to tell Ghub
126+
your username for that instance using the variable ~github.HOST.user~
127+
even if it is the same as on Github.com.
128+
129+
- If the variable ~github.user~ (or ~github.HOST.user~ for an Enterprise
130+
instance) is unset when the wizard is first summoned, then you are
131+
asked to provide your username. That value is then stored *globally*
132+
to avoid having to ask you that question once per repository. If
133+
you have multiple accounts on Github.com (or an Enterprise
134+
instance), then you have to explicitly tell Ghub about that. This
135+
can be done by setting the repository-local values of the
136+
appropriate variable *before* the wizard is invoked.
137+
138+
- You might forget to do the above, which is why it is important to
139+
carefully read the output of the wizard. If it turns out that you
140+
forgot to set a variable, then you must abort, set the variable, and
141+
repeat the request to trigger the wizard again.
142+
143+
- The setup wizard should work even if you have enabled two-factor
144+
authentication. However it your Github Enterprise instance enforces
145+
Single Sign-On as an additional security measure, then you are out
146+
of luck and have to create the token manually as describe in
147+
[[*Manually Creating and Storing a Token]].
148+
149+
The variables mentioned above — and others — are documented in
150+
[[*Configuration Variables]] and the setup wizard is documented in
151+
[[*Interactively Creating and Storing a Token]].
105152

106153
** Setting the Username
107154

@@ -185,13 +232,14 @@ of the doubts that you might have:
185232

186233
- ~Host~ usually is "api.github.com" and that is usually what you want.
187234
If you are trying to access a Github Enterprise instance, then it
188-
should be something else and you have to set the value manually as
189-
described in the next section.
235+
should be something else and you have to set the value manually
236+
before the setup wizard is summoned, as described in the parent
237+
section.
190238

191239
- ~User~ should be your Github.com (or Github Enterprise instance)
192-
username. If it is something else, then you made a mistake at the
193-
first prompt or during the step described in the previous section
194-
and have to refer to that in order to fix this issue.
240+
username. If it is something else and it doesn't look like a simple
241+
typo, then you should read the parent section again. In either case
242+
you have to abort.
195243

196244
- ~Package~ should be the name of the package you are using to access
197245
the Github API.

ghub.texi

+69-10
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ General Public License for more details.
3030
@finalout
3131
@titlepage
3232
@title Ghub User and Developer Manual
33-
@subtitle for version 2.0.0 (v2.0.0-4-g21c9e94+1)
33+
@subtitle for version 2.0.0 (v2.0.0-7-g27e7b17+1)
3434
@author Jonas Bernoulli
3535
@page
3636
@vskip 0pt plus 1filll
@@ -61,7 +61,7 @@ because then all packages that talk to the Github API could be
6161
configured the same way.
6262

6363
@noindent
64-
This manual is for Ghub version 2.0.0 (v2.0.0-4-g21c9e94+1).
64+
This manual is for Ghub version 2.0.0 (v2.0.0-7-g27e7b17+1).
6565

6666
@quotation
6767
Copyright (C) 2017-2018 Jonas Bernoulli <jonas@@bernoul.li>
@@ -159,9 +159,67 @@ to begin with.
159159
@node Getting Started
160160
@chapter Getting Started
161161

162-
If you would like to use a package that uses this library, then just
163-
do so. If the necessary information isn't available when it attempts
164-
to make a request, then you will be asked to provide it.
162+
Each package that uses Ghub uses its own token. Despite that, changes
163+
are good that after successfully configuring one package you can just
164+
start using another package pretty much instantly.
165+
166+
If the necessary token is not available when a package makes an API
167+
request, then a setup wizard pops up, and after answering a few
168+
questions you are good to go. Even the request that caused the wizard
169+
to be summoned should succeed and for most users this should be true
170+
even when configuring the very first token.
171+
172+
However, in some situations some manual configuration is necessary
173+
@strong{before} using the wizard, or the wizard cannot be used at all:
174+
175+
@itemize
176+
@item
177+
If you don't want to use the wizard then you don't have to and can
178+
create tokens manually as describe in @ref{Manually Creating and Storing a Token}.
179+
180+
181+
@item
182+
If you want to access Gitlab.com or another Gitlab instance, then
183+
you have to create the token manually as describe in @ref{Manually Creating and Storing a Token}.
184+
185+
186+
@item
187+
If you want to access a Github Enterprise instance, then you have
188+
to tell Ghub about that before the wizard makes its appearance by
189+
setting the Git variable @code{github.host}. You also have to tell Ghub
190+
your username for that instance using the variable @code{github.HOST.user}
191+
even if it is the same as on Github.com.
192+
193+
194+
@item
195+
If the variable @code{github.user} (or @code{github.HOST.user} for an Enterprise
196+
instance) is unset when the wizard is first summoned, then you are
197+
asked to provide your username. That value is then stored @strong{globally}
198+
to avoid having to ask you that question once per repository. If
199+
you have multiple accounts on Github.com (or an Enterprise
200+
instance), then you have to explicitly tell Ghub about that. This
201+
can be done by setting the repository-local values of the
202+
appropriate variable @strong{before} the wizard is invoked.
203+
204+
205+
@item
206+
You might forget to do the above, which is why it is important to
207+
carefully read the output of the wizard. If it turns out that you
208+
forgot to set a variable, then you must abort, set the variable, and
209+
repeat the request to trigger the wizard again.
210+
211+
212+
@item
213+
The setup wizard should work even if you have enabled two-factor
214+
authentication. However it your Github Enterprise instance enforces
215+
Single Sign-On as an additional security measure, then you are out
216+
of luck and have to create the token manually as describe in
217+
@ref{Manually Creating and Storing a Token}.
218+
@end itemize
219+
220+
The variables mentioned above — and others — are documented in
221+
@ref{Configuration Variables} and the setup wizard is documented in
222+
@ref{Interactively Creating and Storing a Token}.
165223

166224
@menu
167225
* Setting the Username::
@@ -256,15 +314,16 @@ of the doubts that you might have:
256314
@item
257315
@code{Host} usually is "api.github.com" and that is usually what you want.
258316
If you are trying to access a Github Enterprise instance, then it
259-
should be something else and you have to set the value manually as
260-
described in the next section.
317+
should be something else and you have to set the value manually
318+
before the setup wizard is summoned, as described in the parent
319+
section.
261320

262321

263322
@item
264323
@code{User} should be your Github.com (or Github Enterprise instance)
265-
username. If it is something else, then you made a mistake at the
266-
first prompt or during the step described in the previous section
267-
and have to refer to that in order to fix this issue.
324+
username. If it is something else and it doesn't look like a simple
325+
typo, then you should read the parent section again. In either case
326+
you have to abort.
268327

269328

270329
@item

0 commit comments

Comments
 (0)