• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

MakefileH A D15-Nov-20191.9 KiB4516

README.mdH A D15-Nov-20194.4 KiB236168

moinmoincliH A D15-Nov-20197.3 KiB327228

moinmoincli.1H A D15-Nov-20195.9 KiB231226

moinmoincli.conf.sampleH A D15-Nov-2019644 2923

README.md

1# NAME
2
3**moinmoincli** - edit existing MoinMoin wiki pages from a command line
4
5# SYNOPSIS
6
7**moinmoincli**
8\[**-hquv**]
9\[**-f** *textfile*]
10\[**-n** *username*]
11\[**-t** *target*]
12\[*selector*]
13
14# DESCRIPTION
15
16**moinmoincli**
17is an interactive utility to edit existing MoinMoin wiki pages from
18a command line.
19**moinmoincli**
20was only tested with the
21FreeBSD
22Wiki
23which is using the MoinMoin engine.
24The
25FreeBSD
26Wiki address is also hard-coded into
27**moinmoincli**
28as the default web service the utility works with.
29
30**moinmoincli**
31cannot create new wiki pages.
32
33When
34**moinmoincli**
35is run in order to update a wiki page, a diff is presented to the
36user to confirm the changes.
37It is done by providing a comment describing the changes.
38Next, a summary and the action menu is displayed.
39The summary includes the username, the target, the comment, and the
40text file name.
41Actions that could be entered at the action menu prompt are
42described in the
43*ACTION MENU*
44subsection.
45Once the user confirms requested changes to be processed, the password prompt
46is presented to the user.
47
48## Command-line options
49
50The options are as follows:
51
52**-f** *textfile*, **--file** *textfile*
53
54> Point to the
55> Ar textfile
56> that is going to be sent to the server.
57
58**-h**, **--help**
59
60> Show help.
61
62**-n** *username*, **--name** *username*
63
64> Set the username to log in as.
65
66**-q**, **--quick**
67
68> Activate the quick mode, which disables the action menu.
69> As a result the changes will be uploaded once a comment is entered
70> by the user.
71
72**-t** *target*, **--target** *target*
73
74> Provide the name of the wiki page to be updated, e.g.:
75> "`/WiFi/80211ac`".
76> A hyperlink is acceptable as well, e.g.:
77> "`https://wiki.freebsd.org/WiFi/80211ac`".
78
79**-u**, **--update**
80
81> Download the contents of the
82> *target*
83> wiki page and put them into the
84
85**-v**, **--version**
86
87> Show version.
88
89*selector*
90
91> Run
92> **moinmoincli**
93> as preconfigured for a given
94> *selector*.
95
96> Selectors are used if the
97> **select\_target**()
98> function is defined in the
99> configuration file (defaults are listed in the
100> *FILES*
101> section).
102> A single
103> *selector*
104> is associated with a
105> *target*
106> and a
107> *textfile*.
108> As a result it is possible to use selectors to replace
109> "`moinmoincli -f ./80211ac.moin -t /WiFi/80211ac`"
110> with
111> "`moinmoincli ac`"
112> using an
113> **ac**
114> selector.
115
116## Action menu
117
118The following actions could be entered at the action menu prompt one
119action at a time:
120
121**y**, **k**
122
123> Confirm changes.
124> The action menu will be closed and the changes uploaded to the server.
125
126**n**, **a**
127
128> Abort.
129> Close
130> **moinmoincli**
131> immediately.
132
133**t**
134
135> Mark changes as trivial so that subscribers to the modified wiki
136> page are not notified.
137
138**c**
139
140> Change the comment.
141
142**d**
143
144> Show the diff.
145
146**s**
147
148> Print the summary.
149
150# FILES
151
152*~/.moinmoincli.conf*
153
154> The
155> **moinmoincli**
156> configuration file.
157
158*/tmp/moinmoincli-workdir*
159
160> The location of temporary files.
161
162# EXAMPLES
163
164## Example 1: Downloading Wiki Pages
165
166Download the code of
167*https://wiki.freebsd.org/Community/Dogs*
168and save it under
169*./dogs.moinmoin*:
170
171	$ moinmoincli --file ./dogs.moinmoin --target /Community/Dogs --update
172
173## Example 2: Uploading Wiki Pages
174
175Write
176*./sandbox.txt*
177to
178*https://wiki.freebsd.org/WikiSandBox*
179as
180*CharlieRoot*:
181
182	$ moinmoincli -n CharlieRoot -f ./sandbox.txt -t /WikiSandBox
183
184## Example 3: Suggested Workflow
185
1861.	Configure
187	*~/.moinmoincli.conf*
188	so that it is not necessary to specify the username, the text file name and the
189	target website every time.
190	Use selectors for that.
191
1922.	Grab the latest version of the wiki page with a selector:
193
194		$ moinmoincli -u selectorYouHaveConfigured
195
1963.	Edit the text file.
197
1984.	Push the changes over to the wiki server with:
199
200		$ moinmoincli selectorYouHaveConfigured
201
202## Configuration File
203
204	# The username to use when logging in.
205	name='CharlieRoot'
206
207	# The password for the account.
208	password='secret'
209
210	# The default target.
211	# It is used unless a selector or the -t flag is used.
212	target='/WikiSandBox'
213
214	# The default textfile.
215	textfile='/tmp/wiki.moin'
216
217	# The select_target function, which defines the logic behind
218	# selectors.
219	select_target() {
220	    case "$1" in
221	        [wW]*)
222	            target='/WiFi'
223	            textfile="$HOME/wifi.moin"
224	            ;;
225	        *)
226	            printf '%s\n' "invalid selector '$1'" >&2
227	            ;;
228	    esac
229	}
230
231# AUTHORS
232
233**moinmoincli**
234and its manual page was written by
235Mateusz Piotrowski <[0mp@FreeBSD.org](mailto:0mp@FreeBSD.org)>.
236