On this page:
Build Websites Using Any Racket-Powered Language
7.4

Build Websites Using Any Racket-Powered Language

Sage Gerard

 (require polyglot) package: polyglot

polyglot evaluates Racket modules within Markdown, or tagged X-expressions to build production-ready websites. Websites built with polyglot get cache-busting, Webpack-like dependency handling, and an S3 upload tool for free.

The polyglot module includes bindings from polyglot/paths, polyglot/txexpr, polyglot/projects, polyglot/base, polyglot/imperative, and polyglot/functional.

    1 Setup and Usage

      1.1 Pick A Workflow

      1.2 Live Builds

      1.3 Tailoring your Workflow

      1.4 Publish to S3

        1.4.1 Assumptions

        1.4.2 Process

    2 The Base Workflow

      2.1 Where Things Are

      2.2 Mixed-mode Racket

        2.2.1 Relationship to the File-system

        2.2.2 Relationship to Markdown

        2.2.3 Application Elements

        2.2.4 Library Elements

        2.2.5 Accessing Shared Content

      2.3 Dependency Discovery and Processing

        2.3.1 Markdown Handling (".md")

        2.3.2 Racket Module Handling (".rkt")

        2.3.3 CSS Handling (".css")

        2.3.4 Literal Path Handling (".literal")

        2.3.5 Default File Handling

      2.4 Hooking Before and After Builds

      2.5 Base Workflow API Reference

      2.6 Addendum: Avoid Leaving XML in HTML5

    3 The Imperative Workflow

      3.1 Imperative App and Library Elements

        3.1.1 Setting a Page Layout

        3.1.2 Generating Imperative App Elements

      3.2 Page Macros and Preproessing

        3.2.1 Replace elements using data-macro

        3.2.2 Pre-processing

      3.3 Imperative Workflow API Reference

    4 The Functional Workflow

      4.1 Variable-Pass Model

      4.2 Functional App Elements

      4.3 In-Place Replacements

        4.3.1 Example: Embed Working Code Examples

        4.3.2 Example: Iterative App Element

        4.3.3 Example: Incorporating Output from Side-Effects

      4.4 Reducing Boilerplate

        4.4.1 Example: Bundling Assets

      4.5 Functional Workflow API

    5 Tagged X-Expression Tools

      5.1 Analysis

      5.2 Replacing Elements

        5.2.1 Passive Replacement

        5.2.2 Aggressive Replacement

      5.3 Content Generation

    6 Managing Projects Programatically

    7 License and contributions