Next / Previous / Contents / Shipman's homepage

Abstract

Describes a system for translating XML-based bird field notes to HTML.

This publication is available in Web form and also as a PDF document. Please forward any comments to john@nmt.edu.

Table of Contents

1. Introduction
2. Operation
2.1. Further work
3. Overview of the internals
4. The generated XHTML
4.1. XHTML for the index page
4.2. XHTML for the month page
4.3. XHTML for one day-notes
4.4. XHTML for the day-summary block
4.5. XHTML for locality definitions
4.6. XHTML for day-annotation elements
4.7. XHTML rendering of narrative elements
4.8. XHTML for the form element
4.9. XHTML for bird form names
4.10. XHTML rendering of form data
4.11. XHTML rendering of sighting notes
4.12. XHTML rendering of photo links
4.13. XHTML rendering of floc elements
5. The style sheet
5.1. General style
5.2. Inline markup rules
5.3. table.seasons
5.4. Seasonal column markup rules: th.winter, etc.
5.5. CSS rules for rows of the index table
5.6. th.row-label: The row label
5.7. div.loc-child: Indented child block
5.8. div.day-summary: Daily summary block
5.9. div.loc-def: Location definition
5.10. div.loc-narrative: Locality narrative
5.11. div.para: Ordinary paragraphs
5.12. div.form: General form-related data
5.13. div.floc: Multiple sightings
6. Design notes
6.1. Discarded approaches
7. Overall program flow
8. Prologue
9. Imported modules
10. Manifest constants
10.1. MONTH_NAME_MAP: Translate month numbers to month names
10.2. MONTH_SEASON_MAP: Define the season for each month
10.3. YEAR_PAT: Pattern for year numbers
10.4. YYYY_MM_XML_PAT: Month file name pattern
10.5. HTML_EXT: File extension for XHTML pages
10.6. INDEX_PAGE_NAME: Name of the index page
10.7. INDEX_PAGE_TITLE
10.8. HOME_PAGE_URL: Home page URL
10.9. CONVENTIONS_URL
10.10. SEASONS_CLASS: Class attribute for the table of seasons
10.11. YEAR_GROUP_FREQUENCY
10.12. YEAR_GROUP_CLASS: CSS class for years ending a year group
10.13. YEAR_ROW_CLASS
10.14. ROW_LABEL_CLASS
10.15. NBSP: Non-breaking space character
10.16. PHI: Greek letter ϕ
10.17. CSS_URL: Our stylesheet
10.18. ZDP_LOGO
10.19. ZDP_URL
10.20. LOC_CHILD_CLASS
10.21. NOTABLE_CLASS
10.22. DAY_SUMMARY_CLASS
10.23. LOC_DEF_CLASS
10.24. LOC_NARRATIVE_CLASS
10.25. LOC_LABEL_CLASS
10.26. PARA_CLASS
10.27. FORM_CLASS
10.28. NOTABLE_FORM_CLASS
10.29. BIRD_NAME_CLASS
10.30. FLOC_CLASS
10.31. GENUS_CLASS
11. main(): The main program
12. findYears: Locate year directories
13. buildIndex(): Build the index page
14. pageFrame: Set up navigation for the index page
15. indexBoilerplate: Fixed content for the index page
16. indexTable(): Build the table of monthly links
17. indexTableFrame(): Set up the table structure
18. buildRow(): Build one row of the index table
19. buildMonthCell(): Build one monthly cell in the index table
20. class Args(): Command line argument processor
21. class YearCollection: The top-level data structure
21.1. YearCollection.__init__(): Constructor
21.2. YearCollection.addYear(): Add a year
21.3. YearCollection.__getitem__(): Return self[yyyy]
21.4. YearCollection.genYearsRev(): Generate years in reverse chronological order
21.5. YearCollection.neighbors(): Find previous and next month
21.6. YearCollection.__findPrev(): Find predecessor month
21.7. YearCollection.findNext(): Find successor month
22. class YearRow: Container for one year's records
22.1. YearRow.__init__(): Constructor
22.2. YearRow.__len__(): Number of contained months
22.3. YearRow.__getitem__(): Retrieve one month
22.4. YearRow.firstMonth(): Return the first month
22.5. YearRow.lastMonth(): Return the last month
22.6. YearRow.predecessor(): Find the previous month
22.7. YearRow.successor(): Find the following month
22.8. YearRow.readAllMonths(): Process input files for one year
22.9. YearRow.readOneMonth(): Read one monthly file
22.10. YearRow.writeMonthPages(): Generate monthly pages
23. class MonthCell: One table cell
23.1. MonthCell.__init__(): Constructor
23.2. MonthCell.fileName(): Path to the month's page
23.3. MonthCell.writePage(): Render as XHTML
23.4. MonthCell.__pageFrame(): Set up a basic page
23.5. MonthCell.__renderPage(): Add the notes content
23.6. MonthCell.__pageTOC(): Generate page table of contents
23.7. MonthCell.__dayTOC(): Month table of contents entry for one day
23.8. MonthCell.__notablesBlock(): Display any notable records
23.9. MonthCell.__span(): Add a span inline
23.10. MonthCell.__dayBlock(): Render one daily note set
23.11. MonthCell.__dayTitle(): Render the title for one daily block
23.12. MonthCell.__daySummary(): Render the daily summary block
23.13. MonthCell.__locDef(): Display a locality definition
23.14. MonthCell.__dayAnnotation(): Render day-annotation content
23.15. MonthCell.__annoBlock(): Annotation block with a label
23.16. MonthCell.__narrative(): Render a Narrative instance
23.17. MonthCell.__paragraph(): Render one paragraph
23.18. MonthCell.__paraContent(): Content of one paragraph
23.19. MonthCell.__birdForm(): Render one BirdForm
23.20. MonthCell.__singleSighting(): Single-sighting case
23.21. MonthCell.__multiSighting(): Multiple-sighting case
23.22. MonthCell.__locGroup(): Render a locality group
23.23. MonthCell.__sightNotes(): Render a sighting notes group
23.24. MonthCell.__photo(): Generate a photo reference or link
23.25. MonthCell.__floc(): Generate one of multiple sightings
23.26. MonthCell.__ageSexGroup(): Render age-sex-group content
23.27. MonthCell.monthName(): Translate a month key to a month name (static method)
24. Epilogue
25. Defects discovered
25.1. Syntax errors
25.2. Logic errors
25.3. Run-time type matching errors