diff --git a/docs/admin/configure.rst b/docs/admin/configure.rst index 65308805b..06eb473f4 100644 --- a/docs/admin/configure.rst +++ b/docs/admin/configure.rst @@ -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:: diff --git a/docs/admin/install.rst b/docs/admin/install.rst index 34acfaa4e..b674aeab2 100644 --- a/docs/admin/install.rst +++ b/docs/admin/install.rst @@ -75,13 +75,14 @@ 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: @@ -89,12 +90,6 @@ Or, if you have a moin 1.9.x wiki, convert it to moin 2: moin import19 -d -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 ====================== @@ -183,6 +178,7 @@ Activate the virtual environment:: Typing "./m" (or "m" on Windows) will display a menu similar to: :: + Usage: "./m " where is: quickinstall update virtual environment with required packages @@ -192,7 +188,6 @@ Typing "./m" (or "m" on Windows) will display a menu similar to: log view detailed log generated by , 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 @@ -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: @@ -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. @@ -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 diff --git a/docs/devel/development.rst b/docs/devel/development.rst index e8f9a2c41..4f1e10627 100644 --- a/docs/devel/development.rst +++ b/docs/devel/development.rst @@ -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 @@ -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 optional, defaults to CWD cd # 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, moin-devel@python.org. diff --git a/docs/man/moin.rst b/docs/man/moin.rst index a2fbdcca4..2ba703364 100644 --- a/docs/man/moin.rst +++ b/docs/man/moin.rst @@ -33,7 +33,6 @@ the menu:: log view detailed log generated by , 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 import a moin1.9 wiki/data instance from with where = "--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 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 diff --git a/quickinstall.py b/quickinstall.py index 290052513..9d553007b 100755 --- a/quickinstall.py +++ b/quickinstall.py @@ -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') @@ -108,7 +107,6 @@ log view detailed log generated by , 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 @@ -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""" diff --git a/src/moin/cli/__init__.py b/src/moin/cli/__init__.py index 2483d536e..34dcf555e 100644 --- a/src/moin/cli/__init__.py +++ b/src/moin/cli/__init__.py @@ -1,6 +1,6 @@ # Copyright: 2000-2002 Juergen Hermann # 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. """ @@ -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) diff --git a/src/moin/cli/maint/serialization.py b/src/moin/cli/maint/serialization.py index 6a5fc77bb..1f024ba92 100644 --- a/src/moin/cli/maint/serialization.py +++ b/src/moin/cli/maint/serialization.py @@ -7,7 +7,6 @@ """ import sys -import os import click from flask import current_app as app @@ -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.") diff --git a/src/moin/config/wikiconfig.py b/src/moin/config/wikiconfig.py index 751605338..21bbc1b91 100644 --- a/src/moin/config/wikiconfig.py +++ b/src/moin/config/wikiconfig.py @@ -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. diff --git a/src/moin/contrib/sample-backup.moin b/src/moin/contrib/sample-backup.moin deleted file mode 100644 index d1cf0443c..000000000 Binary files a/src/moin/contrib/sample-backup.moin and /dev/null differ