summaryrefslogtreecommitdiff
path: root/src/generate_html.rs
Commit message (Collapse)AuthorAge
* Add 'faded' class to parenthesised text in table cellsBen Bridle2026-11-10
| | | | | | If the entire span of text in a table cell is wrapped in parentheses, that text is now marked with the 'faded' class in the generated HTML to allow the CSS to make it display less prominently.
* Add support for other URL schemesBen Bridle2026-11-10
| | | | | | | | If an external URL has a scheme that isn't either http, https, or mailto, the link label will contain the scheme in order to make it clear to viewers that the link is different to usual. This was added to support 'gemini://' links.
* Preserve URL fragment on HTML redirectBen Bridle2026-11-10
| | | | | | | | | | | The generated HTML redirect pages will now preserve any URL fragment when redirecting to the new page, so that the URL '/page#heading' can now redirect to '/real-page#heading'. Previously, the URL fragment would just be dropped. The URL fragment will additionally be run through a transformation function to match the URL style generated by Toaster. The meta redirect approach still works if JavaScript is not available.
* Fix default HTML templateBen Bridle2026-11-10
| | | | The default HTML template was missing the opening <html> tag.
* Break list lines on ': ' instead of just ':'Ben Bridle2026-03-04
| | | | | This prevents strings like '7:00am' from breaking a list line, the colon must be followed by a space.
* Omit outer heading link if heading title contains a linkBen Bridle2026-03-02
| | | | | | <a> tags can't be nested in HTML, so we omit the outer link on the heading (that links to itself) if the title itself contains a link. This avoids generating a nested <a> tag.
* Sanitize heading names in table of contentsBen Bridle2026-03-02
| | | | | Heading names in the table of contents are now sanitised and fancified, so that quotes and em-dashes and the likes are shown properly.
* Remove dead codeBen Bridle2026-03-02
|
* Fix variable nameBen Bridle2026-03-02
| | | | | Variable containing the name of the current page was incorrectly called site_name.
* Fix special yes/no/-- syntax for tablesBen Bridle2026-02-24
| | | | | These values weren't being matched correctly because whitespace wasn't trimmed beforehand.
* Big rewriteBen Bridle2026-02-22
| | | | | | | | | | | A quick list of everything that's changed: - links to a duplicate heading beneath the same level 1 heading now work - rss feed generation using a .feed file - customisation of the html template using the html.template key - option to use symlinks instead of copying static files - fixed incorrect resolution of internal links - simplified different name forms with the Name type - allow linking to a redirect
* Move string utilities to separate moduleBen Bridle2026-02-06
| | | | This makes things tidier.
* Add commentsBen Bridle2026-02-06
| | | | More housekeeping to make the codebase more understandable.
* Auto-insert line breaks for environment-free math fragmentsBen Bridle2026-01-31
| | | | | | | This was an important functionality for a lot of my math notes, so I've brought it back, but only if the math syntax fragment doesn't contain a '\begin', which denotes the sort of advanced environment where automatic line breaks are not welcome.
* Improve smart-quote direction around punctuationBen Bridle2026-01-30
| | | | | An apostrophe or quotation mark should point right (start a quote) if it is preceded either by whitespace or a punctuation character.
* Don't auto-insert line breaks for math syntax fragmentsBen Bridle2026-01-30
| | | | | Some KaTeX contexts (matrix, array) don't work correctly if every line is manually broken, so we now leave this up to the user.
* Support markdown line elements in page titlesBen Bridle2026-01-30
| | | | | | Page titles are now treated as markdown and rendered as HTML. The URL for a page will be the plain-text version of the title, with markdown syntax stripped out.
* Allow using regular images in galleriesBen Bridle2025-12-12
| | | | | | | Galleries previously required images to be placed in /images/large/.. and /images/thumb/.., but this was a chore if there was only a single average-quality version of the image to display. The path /images/.. is now used as a fallback if these more specialised paths do not exist.
* Allow pages to contain duplicate headings under different h1 headingsBen Bridle2025-12-12
| | | | | This kind of works, but the whole system will have to be rewritten from the ground up so that every heading knows its own canonical name.
* Wrap each <video> element in a <figure>Ben Bridle2025-10-17
| | | | This is needed to be able to center a video in the page.
* Add an override-title syntax for overriding the page title shownBen Bridle2025-10-17
|
* Add a html.redirect.head key to insert text into HTML redirectsBen Bridle2025-10-17
| | | | | This is needed so that I can include the analytics script in all of my redirect pages.
* Remove document parameter from functionsBen Bridle2025-10-10
| | | | | The markdown document is already passed as a field on the page argument, so passing it in as a separate argument was redundant.
* Wrap each heading with an <a> tag that links to that headingBen Bridle2025-09-04
| | | | | | This is so that a heading can be clicked to get a permalink to that heading, which is useful when sending someone a link to a particular section of a document.
* Wrap each h1-delimited block of a generated page in <article> tagsBen Bridle2025-09-04
| | | | | This is to make it possible when printing the document to start each h1 heading element at the top of a new page using CSS.
* Add table of contents sidebar to generated HTMLBen Bridle2025-09-04
| | | | | This is in addition to the existing table of contents at the top of each page.
* Add embed-html-head and override-html-head fragment typesBen Bridle2025-07-29
| | | | | | These will both add content to the <head> HTML element on that page, with the override variant also preventing the default head declared in the toaster.conf file from being used on that page.
* Qualify page names in log messagesBen Bridle2025-06-09
| | | | | The name of each page is now prefixed with the name of the parent in log messages, to disambiguate between pages that share the same name.
* Implement syntax highlighting for syntax fragmentsBen Bridle2025-05-21
| | | | | | | A new key 'highlighters' has been added to the toaster.conf file. The value should be a line defining the languages to use that syntax for, like [py/python]. The lines following are the template definitions, as per the highlighter library.
* Sanitize quotes in file pathsBen Bridle2025-05-21
|
* Refine dash replacement rulesBen Bridle2025-05-21
| | | | | A dash that isn't mid-word will be replaced with an em dash if in the middle of a line, or with an en dash if at the start of a line.
* Change criteria for generating a table of contentsBen Bridle2025-05-21
| | | | | | Count level 3 headings when deciding whether there are enough headings on a page to justify generating a table of contents. Previously, only level 1 and 2 headings were being counted.
* Fix IDs generated for styled headingsBen Bridle2025-03-21
| | | | | | | Headings that contained line elements other than Normal were being stringified with the line_to_html function, which was causing the generated ID for such a heading to contain HTML tags. This was fixed by instead stringifying using the basic to_string() method of Line.
* Support labelled internal linksBen Bridle2025-03-14
| | | | | | The latest version of the markdown library supports labelled internal links, which allows an internal link to point to a page but to display with a different name.
* Fix issue when formatting syntax fragmentsBen Bridle2025-03-14
| | | | | Syntax fragments with unhandled languages were not being correctly converted to HTML.
* URL-encode special characters in unsanitized pathsBen Bridle2025-02-11
| | | | | | | | | | | Unlike for internal links, external links are never sanitized. When an external link contained an apostrophe or a double-quote character, it would prematurely terminate the href property of the containing <a> tag and break the link. Paths in internal and external links are now passed through a new url_encode function, which replaces quote characters with the percent-encoded equivalent.
* Tidy codeBen Bridle2025-02-08
|
* Implement poem syntax fragmentBen Bridle2025-02-08
|
* Implement 'gallery-nav' fragment typeBen Bridle2025-02-01
| | | | | | | This type is for showing a list of pages as clickable image previews. Each line in the fragment is an internal page link, followed by a '::' separator, followed by the name of an image file. Image files must be stored inside the '/images/thumb/' directory of the generated website.
* Separate link parsing code from line_to_html functionBen Bridle2025-02-01
| | | | This is so that links can be parsed in other contexts in the future.
* Support vertical borders in tablesBen Bridle2025-02-01
| | | | | | | | The latest version of the markdown library includes support for a new vertical-border syntax in tables. When a table has a double-thickness pipe border between two columns in the markdown, each <th> and <td> cell in the column on the left side of the border is given the class 'border'.
* Support embedding video files in pagesBen Bridle2025-02-01
|
* Don't add class attribute to HTML list items if class is emptyBen Bridle2025-02-01
|
* Avoid subtracting with underflowBen Bridle2025-01-22
| | | | | | For pages at the root of the website, the length of the parents vec is zero. To avoid an underflow when subtracting from the length, we can just call `.last()` instead of `.get(len-1)`.
* Remove 'appendix' from the links of appendix headingsBen Bridle2025-01-22
| | | | | | If a heading is prefixed with 'Appendix #:', the link to that heading will not include that prefix. This is to make it possible to rearrange appendices in a document without breaking existing links.
* Only transform quotes and dashes inside presentational textBen Bridle2025-01-21
| | | | | Keep quotes and dashes unmodified in monospace line elements, math blocks, math elements, and fragment blocks.
* Expand list of recognised checkbox formatsBen Bridle2025-01-19
| | | | | Checkboxes on list lines no longer have to be inside a monospace line element.
* Check that embedded file paths are validBen Bridle2025-01-19
|
* Update supported markdown syntaxBen Bridle2025-01-19
| | | | | Added math blocks, and changed link syntax, embedded file syntax, and bold line element syntax.
* Fix mailto: linksBen Bridle2025-01-18
| | | | | These were previously being detected only if they begin with ://, which is incorrect and generates incorrect links.