Skip to content

Commit 0519ea1

Browse files
authored
Merge pull request #1647 from UlrichB22/rm_sample_cmd
Remove "./m sample" and "moin load-sample" commands and upd docs
2 parents 5e04b22 + 5439adc commit 0519ea1

File tree

9 files changed

+33
-66
lines changed

9 files changed

+33
-66
lines changed

docs/admin/configure.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,21 @@ Shown below are parts of the directory structure after cloning moin and running
5858
The default uses the OS file system for storage of wiki data and indexes.
5959
The directories and files shown are referenced in this section of documentation related to configuration::
6060

61-
moin/ # clone root, default name
62-
contrib/ # scripts and docs of interest to developers
63-
docs/ # moin documentation in restructured text (.rst) format
61+
moin/ # clone root, default name
62+
contrib/ # scripts and docs of interest to developers
63+
docs/ # moin documentation in restructured text (.rst) format
6464
_build/
65-
html/ # local copy of moin documentation, created by running "./m docs" command
66-
requirements.d/ # package requirements used by quickinstall.py
67-
scripts/ # misc. scripts of interest to developers
65+
html/ # local copy of moin documentation, created by running "./m docs" command
66+
requirements.d/ # package requirements used by quickinstall.py
67+
scripts/ # misc. scripts of interest to developers
6868
src/
69-
moin/ # large directory containing moin application code
70-
wiki/ # the wiki instance; created by running "./m sample" or "./m new-wiki" commands
71-
data/ # wiki data and metadata
72-
index/ # wiki indexes
73-
wiki_local/ # a convenient location to store custom CSS, Javascript, templates, logos, etc.
74-
wikiconfig.py # main configuration file, modify this to add or change features
75-
intermap.txt # interwiki map: copied by quickinstall.py, updated by "./m interwiki"
69+
moin/ # large directory containing moin application code
70+
wiki/ # the wiki instance; created by running "./m new-wiki" or "moin create-instance" commands
71+
data/ # wiki data and metadata
72+
index/ # wiki indexes
73+
wiki_local/ # a convenient location to store custom CSS, Javascript, templates, logos, etc.
74+
wikiconfig.py # main configuration file, modify this to add or change features
75+
intermap.txt # interwiki map: copied by quickinstall.py, updated by "./m interwiki"
7676

7777
After installing moin from pypi or unpacking using a package manager, the directory structure will
7878
look like this::

docs/admin/install.rst

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,21 @@ storage and the index:
7575

7676
moin index-create
7777

78-
If you don't want to start with an empty wiki, but rather play with some
79-
sample content we provide, load it into your wiki and rebuild the indexes:
78+
If you don't want to start with an empty wiki, you can load the welcome
79+
page 'Home' and the English help for editors:
8080

8181
::
8282

83-
moin load-sample # deprecated
84-
moin index-build
83+
moin welcome
84+
moin load-help -n help-en
85+
moin load-help -n help-common
8586

8687
Or, if you have a moin 1.9.x wiki, convert it to moin 2:
8788

8889
::
8990

9091
moin import19 -d <path to 1.9 wiki/data>
9192

92-
If you want to load English help for editors (replace en with your wiki's preferred language):
93-
94-
::
95-
96-
moin load-help -n help-en
97-
moin load-help -n help-common
9893

9994
Run your wiki instance
10095
======================
@@ -183,6 +178,7 @@ Activate the virtual environment::
183178
Typing "./m" (or "m" on Windows) will display a menu similar to:
184179

185180
::
181+
186182
Usage: "./m <target>" where <target> is:
187183

188184
quickinstall update virtual environment with required packages
@@ -192,7 +188,6 @@ Typing "./m" (or "m" on Windows) will display a menu similar to:
192188
log <target> view detailed log generated by <target>, omit to see list
193189

194190
new-wiki create empty wiki
195-
sample create wiki and load sample data
196191
restore * create wiki and restore wiki/backup.moin *option, specify file
197192

198193
backup * roll 3 prior backups and create new backup *option, specify file
@@ -211,19 +206,12 @@ Typing "./m" (or "m" on Windows) will display a menu similar to:
211206
Please refer to 'moin help' to learn more about the CLI for wiki administrators.
212207

213208
While most of the above menu choices may be executed now, new users should
214-
do the following to create a wiki instance and load it with sample data.:
209+
do the following to create a wiki instance and load it with the English help
210+
for editors and some welcome pages (Home):
215211

216212
::
217213

218-
m sample # in Windows
219-
./m sample # in Unix or Linux
220-
221-
If you want to load English help for editors (replace en with your wiki's preferred language):
222-
223-
::
224-
225-
moin load-help -n help-en
226-
moin load-help -n help-common
214+
moin create-instance --full
227215

228216
Next, run the built-in wiki server:
229217

@@ -233,9 +221,9 @@ Next, run the built-in wiki server:
233221

234222
As the server starts, a few log messages will be output to the
235223
terminal window. Point your browser to http://127.0.0.1:5000, the
236-
sample Home page will appear and more log messages will be output
224+
welcome page will appear and more log messages will be output
237225
to the terminal window. Do a quick test by accessing some of the
238-
demo items and do a modify and save. If all goes well, your installation
226+
help items and do a modify and save. If all goes well, your installation
239227
is complete. The built-in wiki server may be stopped by typing ctrl-C
240228
in the terminal window.
241229

@@ -260,7 +248,7 @@ help by reporting bugs), then some logical menu choices are::
260248

261249
./m extras # install packages required for docs and moin development
262250
./m docs # create docs, see User tab, Documentation (local)
263-
./m del-wiki # get rid of the sample data
251+
./m del-wiki # remove the wiki data from previous tests
264252
./m new-wiki # create empty wiki or
265253
./m backup # backup wiki data as needed or as scheduled
266254

docs/devel/development.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ create your development environment
6464
* activate virtualenv::
6565

6666
. activate # Windows: activate
67-
* create a wiki instance and load sample data::
67+
* create a wiki instance and load help data and welcome pages::
6868

69-
./m sample # Windows: m sample
69+
moin create-instance --full
7070
* start the built-in server::
7171

7272
moin run
@@ -566,14 +566,14 @@ Create a new venv, install moin, create instance, start server, create item, mod
566566
source bin/activate # scripts\activate
567567
pip install --upgrade pip # next command fails with pip 9.0.1 and maybe later versions
568568
pip install --pre --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple moin
569+
moin --help # prove it works
569570
moin create-instance --path <path/to/new/wikiconfig/dir> # path optional, defaults to CWD
570571
cd <path/to/new/wikiconfig/dir> # skip if using default CWD
571572
moin index-create
572-
moin --help # prove it works
573573
moin run # empty wiki
574-
moin load-sample # data but no index
575-
moin index-build # data with index
574+
moin welcome # load welcome pages (e.g. Home)
576575
moin load-help -n help-en # load English help
577576
moin load-help -n help-common # load help images
577+
moin run # wiki with English help and welcome pages
578578

579579
Announce update on #moin, [email protected].

docs/man/moin.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ the menu::
3333
log <target> view detailed log generated by <target>, omit to see list
3434

3535
new-wiki create empty wiki
36-
sample create wiki and load sample data
3736
restore * create wiki and restore wiki/backup.moin *option, specify file
3837
import19 <dir> <args> import a moin1.9 wiki/data instance from <dir> with <args>
3938
where <args> = "--markup_out moinwiki" or markdown,rst,html,...
@@ -102,7 +101,6 @@ If you invoke :program:`moin` without any arguments, it will show a short quick
102101
item-put Put an item revision into the wiki
103102
load Deserialize a file into the backend; with...
104103
load-help Load a directory of help .data and .meta file...
105-
load-sample Load wiki sample items
106104
maint-reduce-revisions Remove all revisions but the last one from all...
107105
maint-set-meta Set meta data of a new revision
108106
maint-validate-metadata Find and optionally fix issues with item metadata

quickinstall.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
DIST = 'm-create-dist.txt'
6868
# default files used for backup and restore
6969
BACKUP_FILENAME = os.path.normpath('wiki/backup.moin')
70-
SAMPLE_FILENAME = 'src/moin/contrib/sample-backup.moin'
7170
JUST_IN_CASE_BACKUP = os.path.normpath('wiki/deleted-backup.moin')
7271

7372

@@ -108,7 +107,6 @@
108107
log <target> view detailed log generated by <target>, omit to see list
109108
110109
new-wiki create empty wiki
111-
sample create wiki and load sample data
112110
restore * create wiki and restore wiki/backup.moin *option, specify file
113111
114112
backup * roll 3 prior backups and create new backup *option, specify file
@@ -339,11 +337,7 @@ def cmd_new_wiki(self, *args):
339337
"""create empty wiki"""
340338
command = 'moin index-create'
341339
print('Creating a new empty wiki...')
342-
make_wiki(command) # share code with loading sample data and restoring backups
343-
344-
def cmd_sample(self):
345-
"""create wiki and load sample data"""
346-
self.cmd_restore(SAMPLE_FILENAME)
340+
make_wiki(command) # share code with restore command
347341

348342
def cmd_restore(self, *args):
349343
"""create wiki and load data from wiki/backup.moin or user specified path"""

src/moin/cli/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright: 2000-2002 Juergen Hermann <[email protected]>
22
# Copyright: 2006,2011 MoinMoin:ThomasWaldmann
3-
# Copyright: 2023 MoinMoin project
3+
# Copyright: 2023-2024 MoinMoin:UlrichB
44
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
55

66
"""
@@ -74,7 +74,6 @@ def _Help():
7474

7575
cli.add_command(serialization.Serialize)
7676
cli.add_command(serialization.Deserialize)
77-
cli.add_command(serialization.LoadSample)
7877

7978
cli.add_command(dump_html.Dump)
8079

src/moin/cli/maint/serialization.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"""
88

99
import sys
10-
import os
1110
import click
1211

1312
from flask import current_app as app
@@ -84,14 +83,3 @@ def Deserialize(file=None, new_ns=None, old_ns=None, kill_ns=None):
8483
with open_file(file, "rb") as f:
8584
deserialize(f, app.storage.backend, new_ns=new_ns, old_ns=old_ns, kill_ns=kill_ns)
8685
logging.info("Load Backup finished. You need to run index-build now.")
87-
88-
89-
@cli.command('load-sample', help='Load wiki sample items')
90-
def LoadSample():
91-
logging.info("Load sample data started")
92-
dir_path = os.path.dirname(os.path.realpath(__file__))
93-
filename = os.path.join(dir_path, '../../contrib/sample-backup.moin')
94-
filename = os.path.normpath(filename)
95-
with open_file(filename, "rb") as f:
96-
deserialize(f, app.storage.backend)
97-
logging.info("Load sample data finished. You need to run index-build now.")

src/moin/config/wikiconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
This starting configuration will run moin using the built-in server to serve files
1010
to browsers running on the local PC. The starting security settings below are secure,
1111
allowing only read access for anonymous users to any wiki items loaded via CLI commands
12-
(sample data or help items) and "registration_only_by_superuser = True".
12+
(e.g. help items) and "registration_only_by_superuser = True".
1313
Edit the "acl_functions" and "acls" variables below to adjust these restrictions.
1414
Create superuser and supereditor names and wikigroups as required
1515
before allowing public access with a more robust server.
-650 KB
Binary file not shown.

0 commit comments

Comments
 (0)