This project is the Drupal implementation of the MathHub system available at MathHub.info. It is based on the planetary system.
This README contains the developer-level documentation (installation, configuration, contributing). For the user-level documentation see the MathHub help system.
Other than the usual Drupal/Planetary dependencies a MathHub installation requires:
MathHub and its dependencies can be installed anywhere on the filesystem. However, this documentation assumes a standard layout which is documented below. If your layout is different, adjust the setup accordingly
/var/www/planetary/
/var/data/localmh/
(see below how to set this)/etc/apache2/
/var/data/mailer
<Directory /var/www/planetary/>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
<VirtualHost *:80>
ServerName MathHub
DocumentRoot /var/www/planetary/
</VirtualHost>
lmh update
and git pull/push
), make sure the folder is not
publicly accessible. (There are other ways to do this).
<Directory /var/www/.ssh/>
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
.lmhpath
file in that users home containing the path (e.g. /var/data/localmh
).lmhpath
file must be set (also) for the www-data user www-data
user must have read/write permissions on the lmh repositories folder (/var/data/localmh/MathHub
). This can be achieved by changing owner or group and adjusting permissions accordingly./var/data/localmh
). The kind of repository should be git for automatic pull/push from repositories (slower), and local otherwise (recommended).stex-module
stex
planetary
archive id
and a text format
(defined at the previous step).
Key and value are separated by one space, each pair by a newline. e.g.
smglom/mv stex
MMT/urtheories mmt
MMT/examples mmt
text format
and content type
. MathHub modules defined their own content types,
e.g. OAFF Base defines oaff_doc
for generic OAFF documents, MMT defines mmtdoc
for more specific MMT documents. External modules may define more specialized
content types. The syntax is as above (spaces/newlines as separators). e.g.
stex oaff_doc
mmt mmtdoc
text format
and extension
. This is used for crawling the archives on the filesystem to automatically creates corresponding nodes in MathHub. The syntax is as above (spaces/newlines as separators). e.g.
stex tex
mmt mmt
Administering MathHub (after installation and configuration) mostly involves keeping this up to date and getting an overview of its state. Currently MathHub Admins have access to the following functionalities (via links in the Navigation menu) :
mh/contribute
entries (e.g. mh/broken-docs
or mh/common-errors
). Useful to get an overview for the state of the served archives. Crawls a maximum of 30 nodes at a time, should be re-run until finished if needed (or restarted from the beginning e.g. if the filter implementation changed).lmh update
, basically pulls the latest version of all installed archives.omdoc
files from .tex
files by running LaTeXML. MySQL's default encoding is a partial UTF-8 that uses only 3 bytes max instead of 4 which means it's not adequate for some math characters. To solve that one needs to:
create database mathhub DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
mh.cnf
file in /etc/mysql/conf.d/
containing :
[mysqld]
innodb_file_per_table=1
innodb_file_format=BARRACUDA
innodb_large_prefix=1
and then restart the mysql server.
sites/default/settings.php
file to add
'collation' => 'utf8mb4_unicode_ci',
'charset' => 'utf8mb4',
to the $databases
settings array.
includes/database/mysql/
to interface with mysql properly. You need to switch utf8
to utf8mb4
wherever it appears as well as add SET NAMES utfmb4
at the connection start and make sure every table has the correct charset and collation. Additionally, you need to add ROW_FORMAT=DYNAMIC
(or COMPRESSED
) in the sql for table creation. Check the patch files in patches/
. Some of these files might be overwritten by drupal update, so make sure to keep them up to date. Using drush drush pm-update
is typically safest and easiest.
Currently need to take care of scripts/run-mathhub-scripts.sh
, misc/typeahead.bundle.min.js
and .gitignore
being removed/overridden.