From Cambridge University Caving Club - CUCC wiki
Jump to: navigation, search
(This page has now moved: Fix broken link formatting)
 
(33 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Editing the expo website is an adventure. Until now, there was no guide which explains the whole thing as a functioning system. Learning it by trial and error is non-trivial.
+
==This page has now moved==
  
The website needs improvement, perhaps a complete overhaul. However, it is impossible to go about fixing it properly until we know how the whole thing works.
+
It's now part of the [http://expo.survex.com/handbook/update.htm expo handbook]. Please link/update that page henceforth.  
  
This manual is organized in a how-to sort of style. The categories, rather than referring to specific elements of the website, refer to processes that a maintainer would want to do.
+
A few remnants have been left here until they are properly merged.  
  
==How to update things on cucc.survex.com/expo==
+
-----------
  
===Getting a username and password===
+
To edit the website, you need a mercurial client. If you are using Windows, [http://tortoisehg.bitbucket.org/ TortoiseHg] is highly recommended. Lots of tools for Linux and mac exist too [http://mercurial.selenic.com/wiki/OtherTools ], both GUI and command-line:
  
Contact Mark Shinwell.
 
  
===Version control===
+
===Using Mercurial/TortoiseHg in Windows===
No changes should be made directly to any files on the server. Instead, we use a version control system to allow collaborative editing and so that any changes can be rolled back if necessary. In the past this was CVS (Concurrent Version System), and there was [http://cucc.survex.com/expo/handbook/update.htm|a guide to using that system]. Now we use SVN (Subversion).
 
  
To edit the website, you need an SVN client. If you are using windows, [http://tortoisesvn.tigris.org/|TortoiseSVN] is highly recommended. Once you've downloaded and installed it, the first step is to create what is called a checkout of the website or section of the website which you want to work on. This creates a copy on your machine which you can edit to your heart's content. The command to check out the entire expo website is
+
In Windows: install Mercurial and TortoiseHg of the relevant flavour from http://mercurial.selenic.com/downloads/ (ignoring antivirus/Windows warnings).
svn co svn+ssh://cucc.survex.com/home/cucc/svn/trunk/expoweb
 
  
In TortoiseSVN, merely right-click on a folder you want to check out to, choose "SVN checkout," and enter
+
==Automation on cucc.survex.com/expo==
svn+ssh://cucc.survex.com/home/cucc/svn/trunk/expoweb
 
 
 
After you've made your changes, check them back in using
 
svn ci
 
 
 
or right clicking on the folder and going to check in in TortoiseSVN.
 
 
 
None of your changes will take effect, however, until you've run the expoweb-update script.
 
 
 
===The expoweb-update script===
 
 
 
The script at the heart of the website update mechanism is a shell script at
 
  /cucc.survex.com/home/cucc/bin/expoweb-update
 
 
 
To run scripts on the server, you need to log in via SSH. The best way to do this in windows is to download [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY].
 
 
 
===Updating cave pages===
 
 
 
Cave description pages are automatically generated from a comma separated values (CSV) table named CAVETAB2.CSV by a perl script called make-indxal4.pl . make-indxal4.pl is called automatically.
 
 
 
The first step is to check out, edit, and check in CAVETAB2.CSV, which is at
 
/home/cucc/www/expo/noinfo/CAVETAB2.CSV
 
 
 
You need to be somewhat careful with the formatting; each cell needs to be only one line long (i.e. no newlines) or the script will get confused.
 
 
 
And then run expoweb-update as above.
 
 
 
===Updating expo year pages===
 
 
 
Each year's expo has a documentation index which is in the folder
 
 
 
/home/cucc/www/expo/years
 
 
 
, so to checkout the 2007 page, for example, you would use
 
 
 
svn co svn+ssh://cucc.survex.com/home/cucc/svn/trunk/expoweb/years/2007
 
 
 
===Adding typed logbooks===
 
 
 
To be written.
 
 
 
===Ticking off QMs===
 
 
 
To be written.
 
 
 
 
 
===Maintaining the survey status table===
 
At [http://cucc.survex.com/expo/surveys/surtabnam.html] there is a table which has a list of all the surveys and whether or not they have been drawn up, and some other info.
 
 
 
This is generated by the script /home/cucc/www/tablizebyname-csv.pl from the input file /home/cucc/www/Surveys.csv
 
  
==Automation on cucc.survex.com/expo==
+
The way things normally work, python or perl scripts turn CSV input into HTML for the website. Note that:
 +
*The CSV files are actually tab-separated, not comma-separated despite the extension.
 +
*The scripts can be very picky and editing the CSVs with microsoft excel has broken them in the past- not sure if this is still the case.
  
 
{| border="1" class="wikitable"
 
{| border="1" class="wikitable"
Line 80: Line 29:
 
|-
 
|-
 
|
 
|
/svn/trunk/surveys/tablize.pl
+
/svn/trunk/surveys/tablize-csv.pl
 
/svn/trunk/surveys/tablizebyname-csv.pl
 
/svn/trunk/surveys/tablizebyname-csv.pl
 
  || /svn/trunk/surveys/Surveys.csv ||
 
  || /svn/trunk/surveys/Surveys.csv ||
 
http://cucc.survex.com/expo/surveys/surveytable.html
 
http://cucc.survex.com/expo/surveys/surveytable.html
 
http://cucc.survex.com/expo/surveys/surtabnam.html
 
http://cucc.survex.com/expo/surveys/surtabnam.html
|| Survey status page: "wall of shame" to keep track of who still needs to draw which surveys ||
+
|| Survey status page: "wall of shame" to keep track of who still needs to draw which surveys
 
|-
 
|-
| || || || Prospecting guide ||
+
| || || || Prospecting guide
 
|-
 
|-
| ||  || || ||  
+
| || || ||
 
|}
 
|}
  
 +
 +
<!-- results of a grep for .pl and .py on the expo website
 +
 +
aaron@copper:/home/cucc/www$ find . -name "*.pl"
 +
./expo/smkridge/204/make-glossary.pl
 +
./expo/smkridge/204/tablize-qms.pl
 +
./expo/smkridge/204/qmreader.pl
 +
./expo/smkridge/234/tablize-qms.pl
 +
./expo/noinfo/make-indxal4.pl
 +
./expo/noinfo/DELETEMEPLEASE/2007/loser/fixedpts/make-fb-map.pl
 +
./expo/surveys/204survey_new/pos2lev.pl
 +
./expo/surveys/204survey_new/change.pl
 +
./expo/surveys/204survey_new/seperate.pl
 +
./expo/surveys/204survey_new/pos2levqms.pl
 +
./expo/surveys/tablize-csv.pl
 +
./expo/surveys/tablizebyname-csv.pl
 +
./expo/dataset/loser/fixedpts/make-fb-map.pl
 +
./expo/dataset/loser/loser/fixedpts/make-fb-map.pl
 +
./loser/fixedpts/make-fb-map.pl
 +
./loser/loser/fixedpts/make-fb-map.pl
 +
./surveys/204survey_new/pos2lev.pl
 +
./surveys/204survey_new/change.pl
 +
./surveys/204survey_new/seperate.pl
 +
./surveys/204survey_new/pos2levqms.pl
 +
./surveys/tablize-csv.pl
 +
./surveys/tablizebyname-csv.pl
 +
./expoprepwiki/maintenance/postgres/wp_mysql2postgres.pl
 +
./expoprepwiki/maintenance/postgres/compare_schemas.pl
 +
./expoprepwiki/maintenance/delete-idle-wiki-users.pl
 +
./expoprepwiki/maintenance/fetchInterwiki.pl
 +
find: ./expoprepwiki/upload: Permission denied
 +
aaron@copper:/home/cucc/www$ find . -name "*.py"
 +
./expo/noinfo/prospecting_guide_scripts/prospecting_guide_short.py
 +
./expo/noinfo/prospecting_guide_scripts/make-prospectingguide-new.py
 +
./expo/noinfo/make-folklist.py
 +
./expo/noinfo/create_dplong_table.py
 +
./expo/noinfo/make-areaindices.py
 +
./expo/svxtrace.py
 +
./expo/dataset/loser/fixedpts/make-ents.py
 +
./loser/fixedpts/make-ents.py
 +
 +
-->
  
 
==Website mysteries==
 
==Website mysteries==
 
The following are questions for people who know the expo website well, which stumped Aaron.
 
The following are questions for people who know the expo website well, which stumped Aaron.
 
* Why is there a /home/cucc/www/expo/surveys as well as a /home/cucc/www/surveys , and is there any difference?
 
* Why is there a /home/cucc/www/expo/surveys as well as a /home/cucc/www/surveys , and is there any difference?

Latest revision as of 21:05, 22 June 2013

This page has now moved

It's now part of the expo handbook. Please link/update that page henceforth.

A few remnants have been left here until they are properly merged.


To edit the website, you need a mercurial client. If you are using Windows, TortoiseHg is highly recommended. Lots of tools for Linux and mac exist too [1], both GUI and command-line:


Using Mercurial/TortoiseHg in Windows

In Windows: install Mercurial and TortoiseHg of the relevant flavour from http://mercurial.selenic.com/downloads/ (ignoring antivirus/Windows warnings).

Automation on cucc.survex.com/expo

The way things normally work, python or perl scripts turn CSV input into HTML for the website. Note that:

  • The CSV files are actually tab-separated, not comma-separated despite the extension.
  • The scripts can be very picky and editing the CSVs with microsoft excel has broken them in the past- not sure if this is still the case.
Overview of the automagical scripts on the expo website
Script location Input file Output file Purpose
/svn/trunk/expoweb/noinfo/make-indxal4.pl /svn/trunk/expoweb/noinfo/CAVETAB2.CSV many produces all cave description pages
/svn/trunk/expoweb/noinfo/make-folklist.py /svn/trunk/expoweb/noinfo/folk.csv http://cucc.survex.com/expo/folk/index.htm Table of all expo members

/svn/trunk/surveys/tablize-csv.pl /svn/trunk/surveys/tablizebyname-csv.pl

/svn/trunk/surveys/Surveys.csv

http://cucc.survex.com/expo/surveys/surveytable.html http://cucc.survex.com/expo/surveys/surtabnam.html

Survey status page: "wall of shame" to keep track of who still needs to draw which surveys
Prospecting guide


Website mysteries

The following are questions for people who know the expo website well, which stumped Aaron.

  • Why is there a /home/cucc/www/expo/surveys as well as a /home/cucc/www/surveys , and is there any difference?