Skip to content

Commit

Permalink
Remove ./m sample command and upd docs
Browse files Browse the repository at this point in the history
  • Loading branch information
UlrichB22 committed Mar 13, 2024
1 parent 5e04b22 commit 5439adc
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 66 deletions.
26 changes: 13 additions & 13 deletions docs/admin/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ Shown below are parts of the directory structure after cloning moin and running
The default uses the OS file system for storage of wiki data and indexes.
The directories and files shown are referenced in this section of documentation related to configuration::

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

After installing moin from pypi or unpacking using a package manager, the directory structure will
look like this::
Expand Down
36 changes: 12 additions & 24 deletions docs/admin/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,21 @@ storage and the index:

moin index-create

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

::

moin load-sample # deprecated
moin index-build
moin welcome
moin load-help -n help-en
moin load-help -n help-common

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

::

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

If you want to load English help for editors (replace en with your wiki's preferred language):

::

moin load-help -n help-en
moin load-help -n help-common

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

::

Usage: "./m <target>" where <target> is:

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

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

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

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

::

m sample # in Windows
./m sample # in Unix or Linux

If you want to load English help for editors (replace en with your wiki's preferred language):

::

moin load-help -n help-en
moin load-help -n help-common
moin create-instance --full

Next, run the built-in wiki server:

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

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

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

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

Expand Down
10 changes: 5 additions & 5 deletions docs/devel/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ create your development environment
* activate virtualenv::

. activate # Windows: activate
* create a wiki instance and load sample data::
* create a wiki instance and load help data and welcome pages::

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

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

Announce update on #moin, [email protected].
2 changes: 0 additions & 2 deletions docs/man/moin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ the menu::
log <target> view detailed log generated by <target>, omit to see list

new-wiki create empty wiki
sample create wiki and load sample data
restore * create wiki and restore wiki/backup.moin *option, specify file
import19 <dir> <args> import a moin1.9 wiki/data instance from <dir> with <args>
where <args> = "--markup_out moinwiki" or markdown,rst,html,...
Expand Down Expand Up @@ -102,7 +101,6 @@ If you invoke :program:`moin` without any arguments, it will show a short quick
item-put Put an item revision into the wiki
load Deserialize a file into the backend; with...
load-help Load a directory of help .data and .meta file...
load-sample Load wiki sample items
maint-reduce-revisions Remove all revisions but the last one from all...
maint-set-meta Set meta data of a new revision
maint-validate-metadata Find and optionally fix issues with item metadata
Expand Down
8 changes: 1 addition & 7 deletions quickinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
DIST = 'm-create-dist.txt'
# default files used for backup and restore
BACKUP_FILENAME = os.path.normpath('wiki/backup.moin')
SAMPLE_FILENAME = 'src/moin/contrib/sample-backup.moin'
JUST_IN_CASE_BACKUP = os.path.normpath('wiki/deleted-backup.moin')


Expand Down Expand Up @@ -108,7 +107,6 @@
log <target> view detailed log generated by <target>, omit to see list
new-wiki create empty wiki
sample create wiki and load sample data
restore * create wiki and restore wiki/backup.moin *option, specify file
backup * roll 3 prior backups and create new backup *option, specify file
Expand Down Expand Up @@ -339,11 +337,7 @@ def cmd_new_wiki(self, *args):
"""create empty wiki"""
command = 'moin index-create'
print('Creating a new empty wiki...')
make_wiki(command) # share code with loading sample data and restoring backups

def cmd_sample(self):
"""create wiki and load sample data"""
self.cmd_restore(SAMPLE_FILENAME)
make_wiki(command) # share code with restore command

def cmd_restore(self, *args):
"""create wiki and load data from wiki/backup.moin or user specified path"""
Expand Down
3 changes: 1 addition & 2 deletions src/moin/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright: 2000-2002 Juergen Hermann <[email protected]>
# Copyright: 2006,2011 MoinMoin:ThomasWaldmann
# Copyright: 2023 MoinMoin project
# Copyright: 2023-2024 MoinMoin:UlrichB
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
Expand Down Expand Up @@ -74,7 +74,6 @@ def _Help():

cli.add_command(serialization.Serialize)
cli.add_command(serialization.Deserialize)
cli.add_command(serialization.LoadSample)

cli.add_command(dump_html.Dump)

Expand Down
12 changes: 0 additions & 12 deletions src/moin/cli/maint/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"""

import sys
import os
import click

from flask import current_app as app
Expand Down Expand Up @@ -84,14 +83,3 @@ def Deserialize(file=None, new_ns=None, old_ns=None, kill_ns=None):
with open_file(file, "rb") as f:
deserialize(f, app.storage.backend, new_ns=new_ns, old_ns=old_ns, kill_ns=kill_ns)
logging.info("Load Backup finished. You need to run index-build now.")


@cli.command('load-sample', help='Load wiki sample items')
def LoadSample():
logging.info("Load sample data started")
dir_path = os.path.dirname(os.path.realpath(__file__))
filename = os.path.join(dir_path, '../../contrib/sample-backup.moin')
filename = os.path.normpath(filename)
with open_file(filename, "rb") as f:
deserialize(f, app.storage.backend)
logging.info("Load sample data finished. You need to run index-build now.")
2 changes: 1 addition & 1 deletion src/moin/config/wikiconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
This starting configuration will run moin using the built-in server to serve files
to browsers running on the local PC. The starting security settings below are secure,
allowing only read access for anonymous users to any wiki items loaded via CLI commands
(sample data or help items) and "registration_only_by_superuser = True".
(e.g. help items) and "registration_only_by_superuser = True".
Edit the "acl_functions" and "acls" variables below to adjust these restrictions.
Create superuser and supereditor names and wikigroups as required
before allowing public access with a more robust server.
Expand Down
Binary file removed src/moin/contrib/sample-backup.moin
Binary file not shown.

0 comments on commit 5439adc

Please sign in to comment.