Added Manual page and fixed documentation

This commit is contained in:
Darkshredder 2021-03-23 08:10:53 +05:30
parent 09b2510219
commit 51e2654cd2
10 changed files with 1096 additions and 9 deletions

View File

@ -6,7 +6,7 @@ runs:
steps: steps:
- name: Install prerequisites - name: Install prerequisites
run: | run: |
sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev libicu-dev python3-psycopg2 python3-pyosmium python3-dotenv python3-psutil python3-jinja2 python3-icu sudo apt-get install -y -qq libboost-system-dev libboost-filesystem-dev libexpat1-dev zlib1g-dev libbz2-dev libpq-dev libproj-dev libicu-dev python3-psycopg2 python3-pyosmium python3-dotenv python3-psutil python3-jinja2 python3-icu python3-argparse-manpage
shell: bash shell: bash
- name: Download dependencies - name: Download dependencies

View File

@ -36,6 +36,7 @@ set(BUILD_API on CACHE BOOL "Build everything for the API server")
set(BUILD_MODULE on CACHE BOOL "Build PostgreSQL module") set(BUILD_MODULE on CACHE BOOL "Build PostgreSQL module")
set(BUILD_TESTS on CACHE BOOL "Build test suite") set(BUILD_TESTS on CACHE BOOL "Build test suite")
set(BUILD_DOCS on CACHE BOOL "Build documentation") set(BUILD_DOCS on CACHE BOOL "Build documentation")
set(BUILD_MANPAGE on CACHE BOOL "Build Manual Page")
set(BUILD_OSM2PGSQL on CACHE BOOL "Build osm2pgsql (expert only)") set(BUILD_OSM2PGSQL on CACHE BOOL "Build osm2pgsql (expert only)")
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@ -208,6 +209,14 @@ if (BUILD_DOCS)
add_subdirectory(docs) add_subdirectory(docs)
endif() endif()
#-----------------------------------------------------------------------------
# Manual page
#-----------------------------------------------------------------------------
if (BUILD_MANPAGE)
add_subdirectory(manual)
endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Installation # Installation
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------

15
manual/CMakeLists.txt Normal file
View File

@ -0,0 +1,15 @@
# Creates and installs manual page
execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/nominatim.1 ${CMAKE_CURRENT_BINARY_DIR}/nominatim.1
)
configure_file(${PROJECT_SOURCE_DIR}/manual/create-manpage.tmpl create_manpage.py)
find_program(ARGPARSEMANPAGE argparse-manpage)
ADD_CUSTOM_TARGET(manpage
COMMAND ${ARGPARSEMANPAGE} --pyfile ${CMAKE_CURRENT_BINARY_DIR}/create_manpage.py --function get_parser > nominatim.1
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/nominatim.1 DESTINATION share/man/man1 )

View File

@ -0,0 +1,12 @@
#!/usr/bin/env python3
import sys
import os
sys.path.append('@PROJECT_SOURCE_DIR@')
from nominatim.cli import get_set_parser
def get_parser():
parser = get_set_parser(phpcgi_path='@PHPCGI_BIN@')
return parser.parser

1040
manual/nominatim.1 Normal file

File diff suppressed because it is too large Load Diff

View File

@ -242,11 +242,10 @@ class AdminServe:
def run(args): def run(args):
run_php_server(args.server, args.project_dir / 'website') run_php_server(args.server, args.project_dir / 'website')
def get_set_parser(**kwargs):
def nominatim(**kwargs):
"""\ """\
Command-line tools for importing, updating, administrating and Initializes the parser and adds various subcommands for
querying the Nominatim database. nominatim cli.
""" """
parser = CommandlineParser('nominatim', nominatim.__doc__) parser = CommandlineParser('nominatim', nominatim.__doc__)
@ -276,4 +275,14 @@ def nominatim(**kwargs):
parser.add_subcommand('transition', clicmd.AdminTransition) parser.add_subcommand('transition', clicmd.AdminTransition)
return parser
def nominatim(**kwargs):
"""\
Command-line tools for importing, updating, administrating and
querying the Nominatim database.
"""
parser = get_set_parser(**kwargs)
return parser.run(**kwargs) return parser.run(**kwargs)

View File

@ -42,7 +42,7 @@
python3-pip python3-setuptools python3-devel \ python3-pip python3-setuptools python3-devel \
expat-devel zlib-devel libicu-dev expat-devel zlib-devel libicu-dev
pip3 install --user psycopg2 python-dotenv psutil Jinja2 PyICU pip3 install --user psycopg2 python-dotenv psutil Jinja2 PyICU argparse-manpage
# #

View File

@ -35,7 +35,7 @@
python3-pip python3-setuptools python3-devel \ python3-pip python3-setuptools python3-devel \
expat-devel zlib-devel libicu-dev expat-devel zlib-devel libicu-dev
pip3 install --user psycopg2 python-dotenv psutil Jinja2 PyICU pip3 install --user psycopg2 python-dotenv psutil Jinja2 PyICU argparse-manpage
# #

View File

@ -30,7 +30,8 @@ export DEBIAN_FRONTEND=noninteractive #DOCS:
postgresql-server-dev-10 postgresql-10-postgis-2.4 \ postgresql-server-dev-10 postgresql-10-postgis-2.4 \
postgresql-contrib-10 postgresql-10-postgis-scripts \ postgresql-contrib-10 postgresql-10-postgis-scripts \
php php-pgsql php-intl libicu-dev python3-pip \ php php-pgsql php-intl libicu-dev python3-pip \
python3-psycopg2 python3-psutil python3-jinja2 python3-icu git python3-psycopg2 python3-psutil python3-jinja2 python3-icu git \
python3-argparse-manpage
# The python-dotenv package that comes with Ubuntu 18.04 is too old, so # The python-dotenv package that comes with Ubuntu 18.04 is too old, so
# install the latest version from pip: # install the latest version from pip:

View File

@ -33,7 +33,8 @@ export DEBIAN_FRONTEND=noninteractive #DOCS:
postgresql-server-dev-12 postgresql-12-postgis-3 \ postgresql-server-dev-12 postgresql-12-postgis-3 \
postgresql-contrib-12 postgresql-12-postgis-3-scripts \ postgresql-contrib-12 postgresql-12-postgis-3-scripts \
php php-pgsql php-intl libicu-dev python3-dotenv \ php php-pgsql php-intl libicu-dev python3-dotenv \
python3-psycopg2 python3-psutil python3-jinja2 python3-icu git python3-psycopg2 python3-psutil python3-jinja2 python3-icu git \
python3-argparse-manpage
# #
# System Configuration # System Configuration