1 API

The following is the list of modules provided by this library. The stylesheet and the script that present this chapter in a browser are written beside it, as dokgen.css and dokgen.js; the manual says how a build points at them.


1.1 (ggg colors)

1.1.1 Overview

  • color-error — Return a human-readable problem with VALUE, or #f when it is a valid color.
  • color-names — The names accepted in glyph files, sorted alphabetically.
  • colors-by-theme — Every palette grouped by theme, ready to display: a list of
  • resolve-color — Resolve VALUE (a theme color name or a hex/CSS color string) to a string.
  • theme-color-names — The qualified names of every color in THEME, in the palette’s order.
  • theme-names — The supported theme names, in the order ggg lists them.
  • named-colors — A variable.
  • theme-palettes — A variable.

1.1.2 Procedures

Procedure: color-error value KEY: #:context

Return a human-readable problem with VALUE, or #f when it is a valid color. CONTEXT (for example "glyph ’foo’, section 1") is prepended to the message.

Procedure: color-names

The names accepted in glyph files, sorted alphabetically.

Procedure: colors-by-theme

Every palette grouped by theme, ready to display: a list of (theme-name (color-name . hex) ...) pairs, with both names as strings.

Procedure: resolve-color value KEY: #:context

Resolve VALUE (a theme color name or a hex/CSS color string) to a string. Exits with a helpful error message when VALUE is not a valid color.

Procedure: theme-color-names theme

The qualified names of every color in THEME, in the palette’s order.

Procedure: theme-names

The supported theme names, in the order ggg lists them.

1.1.3 Variables

Variable: named-colors
((catppuccin-mocha-rosewater . "#f5e0dc") (catppuccin-mocha-flamingo . "#f2cdcd") (catppuccin-mocha-pink . "#f5c2e7") (catppuccin-mocha-mauve . "#cba6f7") (catppuccin-mocha-red . "#f38ba8") (catppuccin-mocha-maroon . "#eba0ac") (catppuccin-mocha-peach . "#fab387") (catppuccin-mocha-yellow . "#f9e2af") (catppuccin-mocha-green . "#a6e3a1") (catppuccin-mocha-teal . "#94e2d5") (catppuccin-mocha-sky . "#89dceb") (catppuccin-mocha-sapphire . "#74c7ec") (catppuccin-mocha-blue . "#89b4fa") (catppuccin-mocha-lavender . "#b4befe") (catppuccin-mocha-text . "#cdd6f4") (catppuccin-mocha-subtext1 . "#bac2de") (catppuccin-mocha-subtext0 . "#a6adc8") (catppuccin-mocha-overlay2 . "#9399b2") (catppuccin-mocha-overlay1 . "#7f849c") (catppuccin-mocha-overlay0 . "#6c7086") (catppuccin-mocha-surface2 . "#585b70") (catppuccin-mocha-surface1 . "#45475a") (catppuccin-mocha-surface0 . "#313244") (catppuccin-mocha-base . "#1e1e2e") (catppuccin-mocha-mantle . "#181825") (catppuccin-mocha-crust . "#11111b") (catppuccin-macchiato-rosewater . "#f4dbd6") (catppuccin-macchiato-flamingo . "#f0c6c6") (catppuccin-macchiato-pink . "#f5bde6") (catppuccin-macchiato-mauve . "#c6a0f6") (catppuccin-macchiato-red . "#ed8796") (catppuccin-macchiato-maroon . "#ee99a0") (catppuccin-macchiato-peach . "#f5a97f") (catppuccin-macchiato-yellow . "#eed49f") (catppuccin-macchiato-green . "#a6da95") (catppuccin-macchiato-teal . "#8bd5ca") (catppuccin-macchiato-sky . "#91d7e3") (catppuccin-macchiato-sapphire . "#7dc4e4") (catppuccin-macchiato-blue . "#8aadf4") (catppuccin-macchiato-lavender . "#b7bdf8") (catppuccin-macchiato-text . "#cad3f5") (catppuccin-macchiato-subtext1 . "#b8c0e0") (catppuccin-macchiato-subtext0 . "#a5adcb") (catppuccin-macchiato-overlay2 . "#939ab7") (catppuccin-macchiato-overlay1 . "#8087a2") (catppuccin-macchiato-overlay0 . "#6e738d") (catppuccin-macchiato-surface2 . "#5b6078") (catppuccin-macchiato-surface1 . "#494d64") (catppuccin-macchiato-surface0 . "#363a4f") (catppuccin-macchiato-base . "#24273a") (catppuccin-macchiato-mantle . "#1e2030") (catppuccin-macchiato-crust . "#181926") (catppuccin-frappe-rosewater . "#f2d5cf") (catppuccin-frappe-flamingo . "#eebebe") (catppuccin-frappe-pink . "#f4b8e4") (catppuccin-frappe-mauve . "#ca9ee6") (catppuccin-frappe-red . "#e78284") (catppuccin-frappe-maroon . "#ea999c") (catppuccin-frappe-peach . "#ef9f76") (catppuccin-frappe-yellow . "#e5c890") (catppuccin-frappe-green . "#a6d189") (catppuccin-frappe-teal . "#81c8be") (catppuccin-frappe-sky . "#99d1db") (catppuccin-frappe-sapphire . "#85c1dc") (catppuccin-frappe-blue . "#8caaee") (catppuccin-frappe-lavender . "#babbf1") (catppuccin-frappe-text . "#c6d0f5") (catppuccin-frappe-subtext1 . "#b5bfe2") (catppuccin-frappe-subtext0 . "#a5adce") (catppuccin-frappe-overlay2 . "#949cbb") (catppuccin-frappe-overlay1 . "#838ba7") (catppuccin-frappe-overlay0 . "#737994") (catppuccin-frappe-surface2 . "#626880") (catppuccin-frappe-surface1 . "#51576d") (catppuccin-frappe-surface0 . "#414559") (catppuccin-frappe-base . "#303446") (catppuccin-frappe-mantle . "#292c3c") (catppuccin-frappe-crust . "#232634") (catppuccin-latte-rosewater . "#dc8a78") (catppuccin-latte-flamingo . "#dd7878") (catppuccin-latte-pink . "#ea76cb") (catppuccin-latte-mauve . "#8839ef") (catppuccin-latte-red . "#d20f39") (catppuccin-latte-maroon . "#e64553") (catppuccin-latte-peach . "#fe640b") (catppuccin-latte-yellow . "#df8e1d") (catppuccin-latte-green . "#40a02b") (catppuccin-latte-teal . "#179299") (catppuccin-latte-sky . "#04a5e5") (catppuccin-latte-sapphire . "#209fb5") (catppuccin-latte-blue . "#1e66f5") (catppuccin-latte-lavender . "#7287fd") (catppuccin-latte-text . "#4c4f69") (catppuccin-latte-subtext1 . "#5c5f77") (catppuccin-latte-subtext0 . "#6c6f85") (catppuccin-latte-overlay2 . "#7c7f93") (catppuccin-latte-overlay1 . "#8c8fa1") (catppuccin-latte-overlay0 . "#9ca0b0") (catppuccin-latte-surface2 . "#acb0be") (catppuccin-latte-surface1 . "#bcc0cc") (catppuccin-latte-surface0 . "#ccd0da") (catppuccin-latte-base . "#eff1f5") (catppuccin-latte-mantle . "#e6e9ef") (catppuccin-latte-crust . "#dce0e8") (doom-one-bg . "#282c34") (doom-one-bg-alt . "#21242b") (doom-one-base0 . "#1b1f24") (doom-one-base1 . "#21242b") (doom-one-base2 . "#282c34") (doom-one-base3 . "#2d3138") (doom-one-base4 . "#353a42") (doom-one-base5 . "#3c4149") (doom-one-base6 . "#484d55") (doom-one-base7 . "#525860") (doom-one-base8 . "#5b6268") (doom-one-fg . "#bbc2cf") (doom-one-fg-alt . "#5b6268") (doom-one-grey . "#3f444a") (doom-one-red . "#ff6c6b") (doom-one-orange . "#da8548") (doom-one-green . "#98be65") (doom-one-teal . "#1abc9c") (doom-one-yellow . "#ecbe7b") (doom-one-blue . "#51afef") (doom-one-dark-blue . "#2257a0") (doom-one-magenta . "#c678dd") (doom-one-violet . "#a9a1e1") (doom-one-cyan . "#46d9ff") (doom-one-dark-cyan . "#5699af") (doom-one-light-bg . "#fafafa") (doom-one-light-bg-alt . "#efefef") (doom-one-light-base0 . "#f0f0f0") (doom-one-light-base1 . "#e7e7e7") (doom-one-light-base2 . "#dfdfdf") (doom-one-light-base3 . "#c6c7c7") (doom-one-light-base4 . "#b9b9b9") (doom-one-light-base5 . "#b2b2b2") (doom-one-light-base6 . "#939395") (doom-one-light-base7 . "#696969") (doom-one-light-base8 . "#383a42") (doom-one-light-fg . "#383a42") (doom-one-light-fg-alt . "#a0a1a7") (doom-one-light-grey . "#b9b9b9") (doom-one-light-red . "#e45649") (doom-one-light-orange . "#da8548") (doom-one-light-green . "#50a14f") (doom-one-light-teal . "#1abc9c") (doom-one-light-yellow . "#c18401") (doom-one-light-blue . "#4078f2") (doom-one-light-dark-blue . "#2257a0") (doom-one-light-magenta . "#a626a4") (doom-one-light-violet . "#a9a1e1") (doom-one-light-cyan . "#0184bc") (doom-one-light-dark-cyan . "#5699af") (dracula-background . "#282a36") (dracula-current-line . "#44475a") (dracula-foreground . "#f8f8f2") (dracula-comment . "#6272a4") (dracula-cyan . "#8be9fd") (dracula-green . "#50fa7b") (dracula-orange . "#ffb86c") (dracula-pink . "#ff79c6") (dracula-purple . "#bd93f9") (dracula-red . "#ff5555") (dracula-yellow . "#f1fa8c") (dracula-alucard-background . "#fffbeb") (dracula-alucard-current-line . "#cfcfde") (dracula-alucard-foreground . "#1f1f1f") (dracula-alucard-comment . "#6c664b") (dracula-alucard-cyan . "#036a96") (dracula-alucard-green . "#14710a") (dracula-alucard-orange . "#a34d14") (dracula-alucard-pink . "#a3144d") (dracula-alucard-purple . "#644ac9") (dracula-alucard-red . "#cb3a2a") (dracula-alucard-yellow . "#846e15") (solarized-dark-base03 . "#002b36") (solarized-dark-base02 . "#073642") (solarized-dark-base01 . "#586e75") (solarized-dark-base00 . "#657b83") (solarized-dark-base0 . "#839496") (solarized-dark-base1 . "#93a1a1") (solarized-dark-base2 . "#eee8d5") (solarized-dark-base3 . "#fdf6e3") (solarized-dark-yellow . "#b58900") (solarized-dark-orange . "#cb4b16") (solarized-dark-red . "#dc322f") (solarized-dark-magenta . "#d33682") (solarized-dark-violet . "#6c71c4") (solarized-dark-blue . "#268bd2") (solarized-dark-cyan . "#2aa198") (solarized-dark-green . "#859900") (solarized-light-base03 . "#002b36") (solarized-light-base02 . "#073642") (solarized-light-base01 . "#586e75") (solarized-light-base00 . "#657b83") (solarized-light-base0 . "#839496") (solarized-light-base1 . "#93a1a1") (solarized-light-base2 . "#eee8d5") (solarized-light-base3 . "#fdf6e3") (solarized-light-yellow . "#b58900") (solarized-light-orange . "#cb4b16") (solarized-light-red . "#dc322f") (solarized-light-magenta . "#d33682") (solarized-light-violet . "#6c71c4") (solarized-light-blue . "#268bd2") (solarized-light-cyan . "#2aa198") (solarized-light-green . "#859900") (modus-operandi-bg-main . "#ffffff") (modus-operandi-bg-dim . "#f0f0f0") (modus-operandi-bg-active . "#c4c4c4") (modus-operandi-bg-inactive . "#e0e0e0") (modus-operandi-fg-main . "#000000") (modus-operandi-fg-dim . "#595959") (modus-operandi-fg-active . "#000000") (modus-operandi-fg-alt . "#a6a6a6") (modus-operandi-red . "#a60000") (modus-operandi-green . "#006800") (modus-operandi-yellow . "#6f5500") (modus-operandi-blue . "#0031a9") (modus-operandi-magenta . "#721045") (modus-operandi-cyan . "#00538b") (modus-vivendi-bg-main . "#000000") (modus-vivendi-bg-dim . "#1e1e1e") (modus-vivendi-bg-active . "#535353") (modus-vivendi-bg-inactive . "#303030") (modus-vivendi-fg-main . "#ffffff") (modus-vivendi-fg-dim . "#989898") (modus-vivendi-fg-active . "#ffffff") (modus-vivendi-fg-alt . "#c6c6c6") (modus-vivendi-red . "#ff5f59") (modus-vivendi-green . "#44bc44") (modus-vivendi-yellow . "#d0bc00") (modus-vivendi-blue . "#2fafff") (modus-vivendi-magenta . "#feacd0") (modus-vivendi-cyan . "#00d3d0"))
Variable: theme-palettes
((catppuccin-mocha (rosewater . "#f5e0dc") (flamingo . "#f2cdcd") (pink . "#f5c2e7") (mauve . "#cba6f7") (red . "#f38ba8") (maroon . "#eba0ac") (peach . "#fab387") (yellow . "#f9e2af") (green . "#a6e3a1") (teal . "#94e2d5") (sky . "#89dceb") (sapphire . "#74c7ec") (blue . "#89b4fa") (lavender . "#b4befe") (text . "#cdd6f4") (subtext1 . "#bac2de") (subtext0 . "#a6adc8") (overlay2 . "#9399b2") (overlay1 . "#7f849c") (overlay0 . "#6c7086") (surface2 . "#585b70") (surface1 . "#45475a") (surface0 . "#313244") (base . "#1e1e2e") (mantle . "#181825") (crust . "#11111b")) (catppuccin-macchiato (rosewater . "#f4dbd6") (flamingo . "#f0c6c6") (pink . "#f5bde6") (mauve . "#c6a0f6") (red . "#ed8796") (maroon . "#ee99a0") (peach . "#f5a97f") (yellow . "#eed49f") (green . "#a6da95") (teal . "#8bd5ca") (sky . "#91d7e3") (sapphire . "#7dc4e4") (blue . "#8aadf4") (lavender . "#b7bdf8") (text . "#cad3f5") (subtext1 . "#b8c0e0") (subtext0 . "#a5adcb") (overlay2 . "#939ab7") (overlay1 . "#8087a2") (overlay0 . "#6e738d") (surface2 . "#5b6078") (surface1 . "#494d64") (surface0 . "#363a4f") (base . "#24273a") (mantle . "#1e2030") (crust . "#181926")) (catppuccin-frappe (rosewater . "#f2d5cf") (flamingo . "#eebebe") (pink . "#f4b8e4") (mauve . "#ca9ee6") (red . "#e78284") (maroon . "#ea999c") (peach . "#ef9f76") (yellow . "#e5c890") (green . "#a6d189") (teal . "#81c8be") (sky . "#99d1db") (sapphire . "#85c1dc") (blue . "#8caaee") (lavender . "#babbf1") (text . "#c6d0f5") (subtext1 . "#b5bfe2") (subtext0 . "#a5adce") (overlay2 . "#949cbb") (overlay1 . "#838ba7") (overlay0 . "#737994") (surface2 . "#626880") (surface1 . "#51576d") (surface0 . "#414559") (base . "#303446") (mantle . "#292c3c") (crust . "#232634")) (catppuccin-latte (rosewater . "#dc8a78") (flamingo . "#dd7878") (pink . "#ea76cb") (mauve . "#8839ef") (red . "#d20f39") (maroon . "#e64553") (peach . "#fe640b") (yellow . "#df8e1d") (green . "#40a02b") (teal . "#179299") (sky . "#04a5e5") (sapphire . "#209fb5") (blue . "#1e66f5") (lavender . "#7287fd") (text . "#4c4f69") (subtext1 . "#5c5f77") (subtext0 . "#6c6f85") (overlay2 . "#7c7f93") (overlay1 . "#8c8fa1") (overlay0 . "#9ca0b0") (surface2 . "#acb0be") (surface1 . "#bcc0cc") (surface0 . "#ccd0da") (base . "#eff1f5") (mantle . "#e6e9ef") (crust . "#dce0e8")) (doom-one (bg . "#282c34") (bg-alt . "#21242b") (base0 . "#1b1f24") (base1 . "#21242b") (base2 . "#282c34") (base3 . "#2d3138") (base4 . "#353a42") (base5 . "#3c4149") (base6 . "#484d55") (base7 . "#525860") (base8 . "#5b6268") (fg . "#bbc2cf") (fg-alt . "#5b6268") (grey . "#3f444a") (red . "#ff6c6b") (orange . "#da8548") (green . "#98be65") (teal . "#1abc9c") (yellow . "#ecbe7b") (blue . "#51afef") (dark-blue . "#2257a0") (magenta . "#c678dd") (violet . "#a9a1e1") (cyan . "#46d9ff") (dark-cyan . "#5699af")) (doom-one-light (bg . "#fafafa") (bg-alt . "#efefef") (base0 . "#f0f0f0") (base1 . "#e7e7e7") (base2 . "#dfdfdf") (base3 . "#c6c7c7") (base4 . "#b9b9b9") (base5 . "#b2b2b2") (base6 . "#939395") (base7 . "#696969") (base8 . "#383a42") (fg . "#383a42") (fg-alt . "#a0a1a7") (grey . "#b9b9b9") (red . "#e45649") (orange . "#da8548") (green . "#50a14f") (teal . "#1abc9c") (yellow . "#c18401") (blue . "#4078f2") (dark-blue . "#2257a0") (magenta . "#a626a4") (violet . "#a9a1e1") (cyan . "#0184bc") (dark-cyan . "#5699af")) (dracula (background . "#282a36") (current-line . "#44475a") (foreground . "#f8f8f2") (comment . "#6272a4") (cyan . "#8be9fd") (green . "#50fa7b") (orange . "#ffb86c") (pink . "#ff79c6") (purple . "#bd93f9") (red . "#ff5555") (yellow . "#f1fa8c")) (dracula-alucard (background . "#fffbeb") (current-line . "#cfcfde") (foreground . "#1f1f1f") (comment . "#6c664b") (cyan . "#036a96") (green . "#14710a") (orange . "#a34d14") (pink . "#a3144d") (purple . "#644ac9") (red . "#cb3a2a") (yellow . "#846e15")) (solarized-dark (base03 . "#002b36") (base02 . "#073642") (base01 . "#586e75") (base00 . "#657b83") (base0 . "#839496") (base1 . "#93a1a1") (base2 . "#eee8d5") (base3 . "#fdf6e3") (yellow . "#b58900") (orange . "#cb4b16") (red . "#dc322f") (magenta . "#d33682") (violet . "#6c71c4") (blue . "#268bd2") (cyan . "#2aa198") (green . "#859900")) (solarized-light (base03 . "#002b36") (base02 . "#073642") (base01 . "#586e75") (base00 . "#657b83") (base0 . "#839496") (base1 . "#93a1a1") (base2 . "#eee8d5") (base3 . "#fdf6e3") (yellow . "#b58900") (orange . "#cb4b16") (red . "#dc322f") (magenta . "#d33682") (violet . "#6c71c4") (blue . "#268bd2") (cyan . "#2aa198") (green . "#859900")) (modus-operandi (bg-main . "#ffffff") (bg-dim . "#f0f0f0") (bg-active . "#c4c4c4") (bg-inactive . "#e0e0e0") (fg-main . "#000000") (fg-dim . "#595959") (fg-active . "#000000") (fg-alt . "#a6a6a6") (red . "#a60000") (green . "#006800") (yellow . "#6f5500") (blue . "#0031a9") (magenta . "#721045") (cyan . "#00538b")) (modus-vivendi (bg-main . "#000000") (bg-dim . "#1e1e1e") (bg-active . "#535353") (bg-inactive . "#303030") (fg-main . "#ffffff") (fg-dim . "#989898") (fg-active . "#ffffff") (fg-alt . "#c6c6c6") (red . "#ff5f59") (green . "#44bc44") (yellow . "#d0bc00") (blue . "#2fafff") (magenta . "#feacd0") (cyan . "#00d3d0")))

1.2.1 Overview

  • badge-markup — The badge as inline SVG markup, with its ids namespaced per group.
  • badge-search-text — What a badge can be filtered by: its id and the text of every section.
  • gallery-badge-tile — An undocumented procedure.
  • gallery-html — A self-contained HTML page showing every badge in GLYPH-GROUPS, every color
  • logo-display-name — The human-readable title of a logo, falling back to its file name.
  • logo-markup — The logo as inline SVG markup, with its ids namespaced.
  • palette-section — The gallery section that shows every named color, grouped by theme.
  • write-gallery-page — Write the gallery to PATH.

1.2.2 Procedures

Procedure: badge-markup glyph KEY: #:resources #:group

The badge as inline SVG markup, with its ids namespaced per group.

Procedure: badge-search-text glyph

What a badge can be filtered by: its id and the text of every section.

Undocumented procedure.

A self-contained HTML page showing every badge in GLYPH-GROUPS, every color of every theme, and every logo in RESOURCES with its name.

Procedure: logo-display-name name KEY: #:resources

The human-readable title of a logo, falling back to its file name.

Procedure: logo-markup name KEY: #:resources

The logo as inline SVG markup, with its ids namespaced.

Procedure: palette-section

The gallery section that shows every named color, grouped by theme.

Procedure: write-gallery-page path KEY: #:resources #:glyph-groups

Write the gallery to PATH. Return two values: the number of badges and the number of logos it shows.


1.3 (ggg glyph)

1.3.1 Overview

1.3.2 Parameters

Parameter: first-padding

Default value:

3.28
Parameter: logo-width

Default value:

15.29
Parameter: separator-width

Default value:

6.55
Parameter: separator-x-offset

Default value:

3.28
Parameter: text-vertical-center

Default value:

15.29

1.3.3 Procedures

Procedure: glyph-id glyph

The id of GLYPH as a string, or #f when it is missing or not a name.

Procedure: glyph-style glyph

The visual style of GLYPH as a symbol from (ggg style), flat by default.

Procedure: mk-glyph x KEY: #:resources

Undocumented procedure.

Procedure: validate-glyph glyph KEY: #:index #:resources

Return a list of human-readable configuration problems for GLYPH.

Procedure: validate-glyphs glyphs KEY: #:resources

Return every problem found in GLYPHS, so users can fix them in one pass.


1.5 (ggg main)

The pipeline one run of ggg walks.

A glyph configuration is a Scheme file – or a document on stdin – saying what each badge says, which logo it carries and which style and colors it is drawn in. The whole list is validated against the resources directory before the destination is touched, so a typo never leaves a half-generated dist/ behind. Each glyph that passes is written as an SVG; ‘–convert’ then rasterizes every one of them to a PNG with ImageMagick, or Inkscape when a security policy has disabled ImageMagick’s SVG delegate.

Mermaid diagram, as source:

flowchart LR
  config["glyph configuration<br/>file or stdin"] --> load["load-glyphs"]
  load --> validate{"validate-glyphs"}
  validate -- problems --> report["report-problems"]
  validate -- fine --> render["write-svg"]
  logos["resources/logos/*.svg"] --> render
  render --> svg["dist/name.svg"]
  svg --> png["dist/name.png<br/>with --convert"]

‘–stdout’ takes the same path and prints the documents instead of writing them, which is what a pipe into another program uses.

1.5.1 Overview

1.5.2 Procedures

Procedure: main KEY: #:args

Undocumented procedure.

Procedure: render-glyphs KEY: #:file #:resources #:destination #:with-stdin? #:with-convert? #:with-stdout? #:with-keep?

Undocumented procedure.


1.6 (ggg prelude)

1.6.1 Overview

  • get-setting — Get a setting for ggg, from glyph file.
  • assoc-ref-or — An undocumented procedure.
  • delete-directory-tree — Recursively delete PATH without invoking a shell.
  • ensure-directory — Create PATH and any missing parents, like mkdir -p.
  • error-detail — A short, human-readable description of a caught exception.
  • fail — Report an actionable error message on stderr and exit with EXIT-CODE.
  • guard-errors — Run THUNK, turning any exception into a clean, actionable error message.
  • log — An undocumented procedure.
  • log-error — An undocumented procedure.
  • log-info — An undocumented procedure.
  • log-message — An undocumented procedure.
  • lookup — Like assoc-ref, but never throws on malformed entries.
  • safe-filename? — True when VALUE can be used as a badge id and therefore as a file name.
  • serialize-style — An undocumented procedure.
  • suggest-similar — Return the candidate closest to NEEDLE within MAX-DISTANCE, or #f.
  • syscall — An undocumented procedure.

1.6.2 Macros

Macro: get-setting x

Get a setting for ggg, from glyph file.

1.6.3 Procedures

Procedure: assoc-ref-or alist key default

Undocumented procedure.

Procedure: delete-directory-tree path

Recursively delete PATH without invoking a shell.

Procedure: ensure-directory path

Create PATH and any missing parents, like mkdir -p.

Procedure: error-detail key args

A short, human-readable description of a caught exception.

Procedure: fail message KEY: #:hint #:details #:exit-code

Report an actionable error message on stderr and exit with EXIT-CODE. Unlike a raw Guile backtrace this points the user at what to change.

Procedure: guard-errors thunk KEY: #:label #:hint

Run THUNK, turning any exception into a clean, actionable error message. Exits (quit) requests are passed through so ggg can shut down normally.

Procedure: log msg . args

Undocumented procedure.

Procedure: log-error msg . args

Undocumented procedure.

Procedure: log-info msg . args

Undocumented procedure.

Procedure: log-message msg . maybe-port

Undocumented procedure.

Procedure: lookup alist key

Like assoc-ref, but never throws on malformed entries.

Procedure: safe-filename? value

True when VALUE can be used as a badge id and therefore as a file name.

Procedure: serialize-style alist

Undocumented procedure.

Procedure: suggest-similar needle candidates KEY: #:max-distance

Return the candidate closest to NEEDLE within MAX-DISTANCE, or #f.

Procedure: syscall cmd

Undocumented procedure.


1.7 (ggg server)

1.7.1 Overview

  • badge-glyph — The glyph that the (name .
  • badge-handler — Answer REQUEST with a badge, a logo or the builder page, or explain why it has
  • query-params — The (name .
  • serve — Serve badges and the builder at http://HOST:PORT until interrupted.

1.7.2 Procedures

Procedure: badge-glyph params KEY: #:id

The glyph that the (name . value) PARAMS describe: an optional label section, then one section per ’text’ parameter. The Nth bg/fg pair belongs to the Nth text section, and a logo belongs to the first section, as it does in a glyph file.

Procedure: badge-handler request body KEY: #:resources

Answer REQUEST with a badge, a logo or the builder page, or explain why it has none. BODY goes unread: a badge is an enquiry, not an upload.

Procedure: query-params query

The (name . value) pairs of a URL query string, percent-decoded.

Procedure: serve KEY: #:resources #:host #:port

Serve badges and the builder at http://HOST:PORT until interrupted.

The address defaults to the loopback interface, so the server answers only the machine it runs on; pass 0.0.0.0 as HOST to answer other machines.


1.8 (ggg style)

1.8.1 Overview

  • shade — COLOR darkened towards black by AMOUNT.
  • style-id-prefix — A prefix for the SVG ids a style generates for BADGE-ID.
  • style-name — The canonical style symbol for VALUE, or #f when it names no style.
  • style-skin — The skin of STYLE (a symbol from STYLE-NAMES) for the geometry in CTX.
  • tint — COLOR lightened towards white by AMOUNT.
  • style-descriptions — A variable.
  • style-names — A variable.

1.8.2 Procedures

Procedure: shade color OPT: amount

COLOR darkened towards black by AMOUNT.

Procedure: style-id-prefix badge-id

A prefix for the SVG ids a style generates for BADGE-ID. Ids have to be valid XML names, so characters such as ’+’ in a glyph id are replaced.

Procedure: style-name value

The canonical style symbol for VALUE, or #f when it names no style. Spaces and underscores become dashes, so "frosted glass" and frosted_glass both mean frosted-glass.

Procedure: style-skin style ctx

The skin of STYLE (a symbol from STYLE-NAMES) for the geometry in CTX.

Procedure: tint color OPT: amount

COLOR lightened towards white by AMOUNT.

1.8.3 Variables

Variable: style-descriptions
((flat . "flat colors with the usual rounded corners (the default)") (square . "sharp, square corners") (shadow . "a subtle shadow just under the content, in the same box as every other style") (plastic . "a glossy highlight and a bright inner bevel") (frosted-glass . "a translucent frost sheen behind a light hairline border") (material . "a Material-style sheen with a soft elevation shade") (frutiger . "glossy Frutiger Aero glass with a sky tint and a bright reflection") (neon . "a dark plate with crisp glowing outlines and bright text") (crystal . "translucent frosted glass lit from behind, in a rounded capsule with a bright rim") (crystal-mono . "the same crystal glass, with the labels set in a monospace font"))
Variable: style-names
(flat square shadow plastic frosted-glass material frutiger neon crystal crystal-mono)

1.9 (ggg svg)

1.9.1 Overview

  • length-for-text — Estimate the width of a badge section in pixels: TEXT at FONT-SIZE plus
  • rounded — VALUE rounded to two decimals, so that a coordinate built by adding or
  • scaled — VALUE scaled by BADGE-SCALE, rounded to two decimals so that coordinates stay
  • badge-scale — A variable.

1.9.2 Procedures

Procedure: length-for-text text KEY: #:font-size #:padding

Estimate the width of a badge section in pixels: TEXT at FONT-SIZE plus PADDING on both sides, drawn at BADGE-SCALE. The per-character widths are averages for the sans-serif stack badges use, so a badge stays as compact as the ones shields.io and GitHub render. The result is rounded to a whole pixel.

Procedure: rounded value

VALUE rounded to two decimals, so that a coordinate built by adding or subtracting scaled dimensions stays short in the SVG.

Procedure: scaled value

VALUE scaled by BADGE-SCALE, rounded to two decimals so that coordinates stay short in the SVG.

1.9.3 Variables

Variable: badge-scale
1.0918

1.10 (ggg sxml)

1.10.1 Overview

1.10.2 Procedures

Procedure: attribute->xml attr value port

Undocumented procedure.

Procedure: attribute-value->xml value port

Undocumented procedure.

Procedure: check-name name

Undocumented procedure.

Procedure: element->xml tag attrs body port

Undocumented procedure.

Procedure: entity->xml name port

Undocumented procedure.

Procedure: make-char-quotator char-encoding

Undocumented procedure.

Procedure: pi->xml tag str port

Undocumented procedure.

Procedure: string->escaped-xml str port

Undocumented procedure.

Procedure: sxml->string sxml

Detag an sxml tree sxml into a string. Does not perform any formatting.

Procedure: sxml->xml tree OPT: port escape?

Serialize the sxml tree tree as XML. The output will be written to the current output port, unless the optional argument port is present.


1.11 (ggg version)

1.11.1 Overview

1.11.2 Procedures

Procedure: ggg-revision

The revision a page names: GGG_COMMIT when a build set it, the checkout’s revision, or ’unknown’ when ggg runs from an installed copy.

Procedure: ggg-version-string

Return the one-line version banner printed by ‘ggg –version’.

Procedure: print-version OPT: port

Print the version banner, license and homepage of ggg to PORT.

1.11.3 Variables

Variable: ggg-homepage
"https://github.com/jjba23/ggg"
Variable: ggg-license
"MIT"
Variable: ggg-version
"2.1.0"