{"size": 1649, "ext": "scrbl", "max_stars_repo_path": "polyglot-doc/polyglot/scribblings/reference/built-in-workflows.scrbl", "max_stars_repo_name": "pmatos/polyglot", "max_stars_repo_stars_event_min_datetime": "2019-08-25T10:41:17.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-03T19:33:04.000Z", "max_issues_repo_path": "polyglot-doc/polyglot/scribblings/reference/built-in-workflows.scrbl", "max_issues_repo_name": "pmatos/polyglot", "max_issues_repo_issues_event_min_datetime": "2019-08-25T10:44:27.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-03T12:22:16.000Z", "max_forks_repo_path": "polyglot-doc/polyglot/scribblings/reference/built-in-workflows.scrbl", "max_forks_repo_name": "pmatos/polyglot", "max_forks_repo_forks_event_min_datetime": "2019-12-19T06:18:49.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-13T03:20:07.000Z"}
{"max_stars_count": 89, "max_issues_count": 29, "max_forks_count": 5, "avg_line_length": 45.8055555556, "max_line_length": 73, "alphanum_fraction": 0.7919951486}
#lang scribble/manual
@require[@for-label[racket polyglot unlike-assets]]

@title{Built-In Workflows}

To save time for new users, Polyglot ships with three built-in
workflows: @racket[polyglot/base%], @racket[polyglot/imperative%], and
@racket[polyglot/functional%]. Each may be extended, overridden, or
ignored entirely.

@racket[polyglot/imperative%] and @racket[polyglot/functional%] both
operate under the assumption that they must produce HTML5 documents
from Markdown files. In addition, each Markdown file may contain
@deftech{application elements} and @deftech{library elements}.
Application elements are of form @litchar{<script
type="application/racket">...</script>}, and library elements are of form
@litchar{<script type="text/racket">...</script>}. The text content of
these elements are copied to Racket modules contained in
@racket[(polyglot-temp-directory)]. The name of each Racket module is
equal to @litchar{ID.rkt}, where @litchar{ID} is the value of the
@litchar{id} attribute of the @litchar{<script>} element. If the
@litchar{id} attribute is not present or empty, a temporary name will
be used instead.

The Racket modules created on disk from application elements are
loaded using @racket[dynamic-require] in the order they are
encountered in Markdown. The intended behavior and responsibility
of application element's Racket module depends on the workflow
executing it. Library elements, on the other hand, are saved to disk
as-is and used according to the whims of the Racket modules produced
from application elements.

@include-section{base.scrbl}
@include-section{imperative.scrbl}
@include-section{functional.scrbl}
