Improve page layout and CSS stylesheets
Created by: lahwaacz
The website needs to improve the layout of its pages and provide some CSS stylesheets. I can't do it myself, so here is a quickstart guide for the contributors. One day it will appear in the README, when it exists...
- Install the dependencies: python-django, python-requests, pyalpm, mandoc (if you want to install it side-by-side with the man-db and groff packages, I use this modified PKGBUILD).
- Fork this repository, clone the fork and change into its directory.
- Copy
mysite/local_settings.py.example
tomysite/local_settings.py
and editDEBUG = True
and theSECRET_KEY
variable. - Configure a connection to a PostgreSQL server in the Django database settings in the
mysite/local_settings.py
file. - Initialize the Django database by running
./manage.py makemigrations
and./manage.py migrate
. - Start the development web server with
./manage.py runserver
. The site should be available at http://localhost:8000, saying that there are 0 man pages and 0 packages (because they were not imported yet). The server will automatically reload when you make changes to the webapp code or templates. - Run the
update.py
script to import some man pages. However, note that the full import requires to download about 7.5 GB of packages from a mirror of the Arch repos and then the extraction takes about 20-30 minutes. (The volume of all man pages is less than 300 MB though.) If you won't need all man pages for the development, you can run e.g.update.py --only-repos core
to import only man pages from the core repository (the smallest one, download size is about 160 MB) or evenupdate.py --only-packages coreutils man-pages
.
That's it! Your testing website should now be (almost) fully functional, depending on how many packages you imported. Navigate to the URL of some man page and verify that it's HTML version is actually served.
Before you start working on the design, note that:
- the CSS stylesheets are
archweb_manpages/static/archweb_manpages/*.css
- the templates for the HTML pages are stored in
archweb_manpages/templates/
. See The Django template language for details.
Of course if something doesn't work or you need more help, just let me know!