Summary
| Mentor(s): | Prof. Megan Hickman Fulp Dr. Mike Murphy |
|---|---|
| Project Type: | Software development; computer science |
| Technologies: | Python, CSS, Git |
| Undergraduate Credit: | CSCI 399 |
| Graduate Credit: | Not available |
| Locality: | Main campus and/or remote |
Purpose
Complex websites often have numerous layout and formatting rules in the form of Cascading Style Sheets (CSS). While simple CSS formatting is easy to do entirely by hand, difficulties arise when different parts of sites need subtle changes in appearance. With plain CSS, a site designer copies, pastes, and then modifies an existing CSS rule to create a new one with some slight modifications.
In order to automate this mundane task for larger sites, CSS extension languages like Sass have been created. Unfortunately, these languages introduce dependencies on other tools, some of which are written in fairly uncommon programming languages. Installing and configuring these extra tools adds complexity for a site author. It would be helpful if TealSite could include similar support natively, so that no additional tools are needed.
Scope of Work
TealSite already uses HTML and CSS Selectors Level 3 to implement its template system. CSS selectors are processed by a hand-coded recursive descent parser that calls set filtering methods in order to match HTML tags within the document. This project will extend TealSite to manage a site author's CSS stylesheets in addition to handling the HTML.
The first step in processing general CSS stylesheets is to implement a stylesheet parser that follows the CSS stylesheet context-free grammar. For ease of maintenance, a recursive-descent parser is a strong option, although implementing one is a fairly hard-core computer science project. Once the parser is implemented, individual parts of styles can be obtained from the input style language, allowing styles to be extended and merged to create output style sheets.