Skip to content

Commit

Permalink
implement solr search, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelloPerathoner committed Sep 8, 2024
1 parent 104f156 commit 44f17b9
Show file tree
Hide file tree
Showing 433 changed files with 102,976 additions and 32,592 deletions.
120 changes: 0 additions & 120 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ tools/reports
tools/phpcs/OldSniffs
vendor
.venv
.vscode
95 changes: 72 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ deploy_schemas:

deploy_server:
cd $(SERVER) && $(MAKE) deploy
$(RSYNC) Makefile* Variables.mak $(HOST_SERVER)/../
$(RSYNC) Makefile* Variables.mak $(HOST_PRJ_DIR)/
$(RSYNC) solr $(HOST_PRJ_DIR)/

import_xml: import_mss import_capits

Expand All @@ -54,40 +55,85 @@ import_backups:
import_backup_mysql:
bzcat $(SERVERFS)/backups/mysql/capitularia-mysql-$(shell date +%F).sql.bz2 | $(MYSQL_LOCAL)

.PHONY: docs mysql-remote mysql-local
.PHONY: docs psql-local psql-remote mysql-remote mysql-local

doc_src/phpdoc/structure.xml: $(wildcard plugins/*/*.php $(THEMES)/*.php $(THEMES)/widgets/*.php)
mkdir -p doc_src/phpdoc
$(PHPDOC) --template=xml -d "plugins,themes" -t ./doc_src/phpdoc --ignore="*/node_modules/*"
################ docs

doc_src/jsdoc/structure.json: $(shell find . -not -path "*node_modules*" -a -path "*/src/js/*.js")
mkdir -p doc_src/jsdoc/
$(JSDOC) -X $^ > $@
.PHONY: docs clean_docs phpdoc jsdoc xsltdoc

doc_src/xslt_dep/structure.ttl: xslt/*.xsl python/xslt_dep.py
cd $(XSLT) && ../python/xslt_dep.py -e "r *.xsl; save ../$@"
DOCS_DIR = $(CAPITULARIA_PRJ)/docs
DOCS_SRC_DIR = $(DOCS_DIR)/src
DOCS_BUILD_DIR = $(DOCS_DIR)/build
export SPHINXBUILD=$(PYTHON) -m sphinx -c $(DOCS_DIR)
export SRCDIR=$(DOCS_SRC_DIR)
export BUILDDIR=$(DOCS_BUILD_DIR)

make_dependencies: doc_src/xslt_dep/structure.ttl
python/xslt_dep.py -e "l $<; make" > xslt/dependencies.inc
phpdoc: $(DOCS_BUILD_DIR)/phpdoc/structure.xml

docs: doc_src/phpdoc/structure.xml doc_src/jsdoc/structure.json doc_src/xslt_dep/structure.ttl
cd doc_src && $(MAKE) -e html
jsdoc: $(DOCS_BUILD_DIR)/jsdoc/structure.json

doccs: doc_src/phpdoc/structure.xml doc_src/jsdoc/structure.json doc_src/xslt_dep/structure.ttl
$(RM) -r docs/*
cd doc_src && $(MAKE) -e html
xsltdoc: $(DOCS_BUILD_DIR)/xsltdoc/structure.ttl

jsdoc: doc_src/jsdoc/structure.json
$(DOCS_BUILD_DIR)/phpdoc/structure.xml: $(wildcard plugins/*/*.php $(THEMES)/*.php $(THEMES)/widgets/*.php)
mkdir -p $(DOCS_BUILD_DIR)/phpdoc
$(PHPDOC) --template=xml -d "plugins,themes" -t $(DOCS_BUILD_DIR)/phpdoc --ignore="*/node_modules/*"

doxygen:
doxygen
mkdir -p doc_src/webprojekt/doxygen/
doxyphp2sphinx -v --xml-dir doxygen_build/xml/ --out-dir doc_src/webprojekt/doxygen/ cceh::capitularia
$(DOCS_BUILD_DIR)/jsdoc/structure.json: $(shell find . -not -path "*node_modules*" -a -path "*/src/js/*")
mkdir -p $(DOCS_BUILD_DIR)/jsdoc/
$(JSDOC) -c $(DOCS_DIR)/jsdoc.conf.js -X $^ > $@

$(DOCS_BUILD_DIR)/xsltdoc/structure.ttl: xslt/*.xsl python/xslt_dep.py
mkdir -p $(DOCS_BUILD_DIR)/xsltdoc/
cd $(XSLT) && PYTHONPATH=../python $(PYTHON) -m xslt_dep -e "r *.xsl; save $@"

make_dependencies: xsltdoc
$(PYTHON) -m python.xslt_dep -e "l $<; make" > xslt/dependencies.inc

docs: phpdoc jsdoc xsltdoc
cd $(DOCS_DIR) && $(MAKE) -e html
-cp $(DOCS_DIR)/_config.yml $(DOCS_BUILD_DIR)/
-cp -r $(DOCS_SRC_DIR)/_images $(DOCS_BUILD_DIR)/

doccs: clean_docs docs

clean_docs:
$(RM) -r $(DOCS_BUILD_DIR)/*

################ Solr

solr-init:
-$(SOLR) delete -c capitularia
$(SOLR) create -c capitularia -d $(ROOT)/solr/configsets/capitularia

solr-start:
$(SOLR) start

solr-stop:
$(SOLR) stop

solr-restart:
$(SOLR) restart

solr-import:
cd $(XSLT) && $(MAKE) solr-import

solr-logs:
less $(SOLR_INST)/server/logs/solr.log

solr-prereq:
cp $(SOLR_PRJ)/lib/build/libs/lib.jar $(SOLR_INST)/lib/capitularia.jar

# needs VPN
psql-remote:
$(PSQL) $(PGREMOTE)

# needs VPN
mysql-remote:
$(MYSQL_REMOTE)

psql-local:
$(PSQL) $(PGLOCAL)

mysql-local:
$(MYSQL_LOCAL)

Expand Down Expand Up @@ -153,7 +199,10 @@ phpcs:
-vendor/bin/phpcs --standard=tools/phpcs --report=emacs -s --extensions=php --ignore=node_modules themes plugins

mypy:
-mypy server/
-mypy server/ python/

black:
-black server/ python/


TARGETS = csslint jslint phplint mo po pot
Expand Down
6 changes: 3 additions & 3 deletions Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ define LOCALE_TEMPLATE

.PRECIOUS: $(LANG_SRC)/$(1).po

po: $(LANG_SRC)/$(1).po
po: pot $(LANG_SRC)/$(1).po

$(LANG_SRC)/$(1).po: $(LANG_SRC)/capitularia.pot
if test -e $$@; \
Expand All @@ -66,8 +66,8 @@ $(LANG_DEST)/$(TEXT_DOMAIN)-$(1).mo: $(LANG_SRC)/$(1).po
mkdir -p $$(dir $$@)
msgfmt -o $$@ $$?

$(LANG_DEST)/$(TEXT_DOMAIN)-$(1)-$(HANDLE).json: $(LANG_SRC)/$(1).po
$(PO2JSON) $$? $$@ -f jed --pretty
$(LANG_DEST)/$(TEXT_DOMAIN)-$(1)-$(HANDLE).json: $(LANG_SRC)/$(1).po $(PO2JSON)
$$(PYTHON) $$(PO2JSON) --domain $$(TEXT_DOMAIN) --lang $(1) $$< $$@

endef

Expand Down
12 changes: 6 additions & 6 deletions Variables.mak
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
PRJ_DIR := prj/capitularia/capitularia

ROOT := $(UNI_DIR)/$(PRJ_DIR)
ROOT := $(CAPITULARIA_PRJ)
HOST_ROOT := $(CAPITULARIA_SSHUSER)@capitularia.uni-koeln.de

SERVERFS := $(HOST_ROOT):/var/www/capitularia.uni-koeln.de
Expand All @@ -20,13 +18,15 @@ XSLT := $(ROOT)/xslt
GIS := $(ROOT)/gis

HOST_CLIENT := $(WPCONTENT)/dist
HOST_PRJ_DIR := $(HOST_ROOT):~/$(PRJ_DIR)
HOST_PRJ_DIR := $(HOST_ROOT):~/prj/capitularia/capitularia
HOST_SERVER := $(HOST_PRJ_DIR)/server
HOST_XSLT := $(HOST_PRJ_DIR)/xslt

NODE_MODULES := $(ROOT)/node_modules
NODE := $(NODE_MODULES)/.bin
PYTHON := $(ROOT)/.venv/bin/python3
SOLR_INST := $(HOME)/solr/solr
SOLR := $(SOLR_INST)/bin/solr

NAT_EARTH := https://naciscdn.org/naturalearth

Expand All @@ -50,15 +50,15 @@ STYLELINTFLAGS = -f unix
RSYNC := rsync -v -crlptz --exclude='*~' --exclude='.*'
RSYNCPY := $(RSYNC) --exclude "**/__pycache__" --exclude "*.pyc" --exclude "*.log"
WP_CLI := $(LOCALFS)/wp
PO2JSON := $(NODE)/po2json
PO2JSON := $(ROOT)/python/po2json.py
EASYGETTEXT := $(NODE)/gettext-extract --attribute v-translate
XGETTEXT := xgettext --default-domain=capitularia --from-code=utf-8 \
--copyright-holder="CCeH Cologne" --package-name=Capitularia --package-version=2.0 \
[email protected] \
-k'__' -k'_e' -k'_n:1,2' -k'_x:1,2c' -k'_ex:1,2c'

PHPDOC := vendor/phpdoc
JSDOC := $(NODE)/jsdoc -c jsdoc.conf.js
JSDOC := $(NODE)/jsdoc

MYSQL_REMOTE := mysql --defaults-file=~/.my.cnf.capitularia
MYSQL_LOCAL := mysql --defaults-file=~/.my.cnf.capitularia-local
Expand Down
Loading

0 comments on commit 44f17b9

Please sign in to comment.