PATHWAYS This is some code I wrote in 2014 to generate a webpage populated by images showing dependencies between the different modules in the UCL Undergraduate Mathematics degree. It requires a program called graphviz, which can be installed from http://www.graphviz.org The code consists of two shell scripts and some auxiliary text files. You can run the scripts from a command line (make sure they have permissions to make them executable) by navigating to the folder where they are stored, making sure they are executable by you (e.g. with permissions set to 744) and running e.g. ./gen.sh -------------------------------------------------------------------------------------------- SCRIPTS: gen.sh distribute.sh stripyr.sh AUXILIARY FILES: stylesh.css analysis algebra geometry methods programming y1y2pa combprob lifesci -------------------------------------------------------------------------------------------- More details... SCRIPTS: * gen.sh - this script generates the images and the HTML code, based on the dependencies laid out in the auxiliary text files. The output of this file is the HTML document pathways.htm and the various image files (PNG format). If you want to change the HTML code (other than the external CSS style sheet) then you would need to edit it in here. It can be found between the places marked EOF, EOG and EOH. The rest of the script tells graphviz to generate the image files and clickable image maps for use in the HTML file. * distribute.sh - this script uploads all the relevant files to the web. Of course this needs to be modified according to *where* you want to put the files (currently it's putting them in the html.pub folder of my UCL webspace). Note that if you are hosting the files somewhere else you will probably need to log onto the server where you are hosting them once you have uploaded and change the permissions to 644 (chmod 644 ). * stripyr.sh - In case it's useful, I also included an auxiliary script I used at some point when the links to all syllabi changed (from .../syllabus_math1/... to .../math1/...). This used the "stream editor" program called sed, which is a little tricky to figure out the syntax for. While it would be moderately painful to figure out the sed code for your situation, it is surely more fun than changing them all by hand (or using find-and-replace). -------------------------------------------------------------------------------------------- AUXILIARY FILES: * stylesh.css - this is just a basic CSS stylesheet for the HTML page and can be changed/improved as desired. * analysis, algebra, geometry, methods, programming, y1y2pa, combprob, lifesci - these text files contain all the information about courses, links to syllabi and dependencies between courses, in a format which is recognised by graphviz. For example: 2401 [label = "2401\nMethods 3",href="http://www.ucl.ac.uk/maths/courses/undergraduates/modules/ year2/year2_syllabuses/syllabus_math2401"]; tells graphviz that it should create a node called 2401 with the label "2401 Methods 3" (the \n means start a new line) with a link to the Methods 3 syllabus. Suppose you wanted to tell graphviz that there is a dependency between 2401 and another course, say 7304, you would write 2401 -> 7304; but make sure this line comes after the lines which define 2401 and 7304. Sometimes you want dependencies which are dashed: 2401 -> 7304 [style=dashed]; Sometimes you get annoyed with the way graphviz decides to lay things out (it makes all layout decisions for you) so you put in some invisible arrows to affect the layout, e.g. 7103 -> 7112 [style=invis]; which ensures that these two nodes will be closer together. You can tell graphviz to put some nodes on the same vertical level with {rank=same;1201 1101 1401 1301}; and I usually follow this with a line like 1201 -> 1101 -> 1401 ->1301 [style = invis]; to make sure they're in the order I want them. Be careful when you change these auxiliary files: small changes can completely rejig the way graphviz decides to lay things out. You have been warned... J. Evans 2015, CC0