renamings

main
Matthew Butterick 6 years ago
parent 7e9d4f53d8
commit f153c4e775

@ -119,7 +119,7 @@ Next, on the REPL enter this:
You will see the actual input to Quadwriter, which is called a @tech{Q-expression}:
@repl-output{
'(q () (q ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "default-serif") (line-height "17")) (q ((keep-first-lines "2") (keep-last-lines "3") (font-size-adjust "100%") (character-tracking "0") (hyphenate "true") (display "g49598")) "Brennan and Dale like fancy sauce.")))
'(q () (q ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "text") (line-height "17")) (q ((keep-first-lines "2") (keep-last-lines "3") (font-size-adjust "100%") (character-tracking "0") (hyphenate "true") (display "g49598")) "Brennan and Dale like fancy sauce.")))
}
In the demos that follow, the input language will change slightly. But the PDF will be rendered the same way (by running the source file) and you can always look at @racket[doc] or use @racket[view-result].
@ -172,9 +172,9 @@ To see this:
'(q
()
(q
((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "default-serif") (line-height "17"))
((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "text") (line-height "17"))
(q ((break "para")))
(q ((font-family "default-heading") (first-line-indent "0") (display "block") (font-size "20") (line-height "24.0") (border-width-top "0.5") (border-inset-top "9") (inset-bottom "-3") (inset-top "6") (keep-with-next "true") (id "did-you-know")) "Did you know?")
(q ((font-family "heading") (first-line-indent "0") (display "block") (font-size "20") (line-height "24.0") (border-width-top "0.5") (border-inset-top "9") (inset-bottom "-3") (inset-top "6") (keep-with-next "true") (id "did-you-know")) "Did you know?")
···
}
@ -247,7 +247,7 @@ Brennan and Dale like fancy sauce.
In the REPL, the @racket[doc] was this Q-expression:
@repl-output{
'(q () (q ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "default-serif") (line-height "17")) "Brennan and Dale like fancy sauce."))
'(q () (q ((page-margin-left "120") (page-margin-top "80") (page-margin-bottom "120") (font-family "text") (line-height "17")) "Brennan and Dale like fancy sauce."))
}
Let's copy this Q-expression and use it as our new source code. This time, however, we'll switch to plain @code{#lang quadwriter} (instead of the @racket[markup] or @racket[markdown] dialects):
@ -256,7 +256,7 @@ Let's copy this Q-expression and use it as our new source code. This time, howev
@codeblock|{
#lang quadwriter
'(q () (q ((page-margin-left "120") (page-margin-top "80")
(page-margin-bottom "120") (font-family "default-serif")
(page-margin-bottom "120") (font-family "text")
(line-height "17")) "Brennan and Dale like fancy sauce."))
}|
]

@ -686,9 +686,9 @@
(setup-font-path-table! pdf-path)
(parameterize ([current-missing-glyph-action 'fallback])
(time-name atomize (atomize qx #:attrs-proc handle-cascading-attrs
#:fallback "default-fallback"
#:emoji "default-emoji"
#:math "default-math"
#:fallback "fallback"
#:emoji "emoji"
#:math "math"
#:font-path-resolver resolve-font-path)))))
;; page size can be specified by name, or measurements.

@ -7,7 +7,7 @@
(define-runtime-path quadwriter-fonts-dir "fonts")
(define-runtime-path default-font-face "fonts/default/SourceSerifPro-Regular.otf")
(define default-font-family "default-serif")
(define default-font-family "text")
(define default-font-size 12)
(define default-line-height 16)
(define default-font-color "black")

@ -27,7 +27,7 @@
(first-line-indent "0")
(background-color "#eee")
(clip "true")
(font-family "default-sans") (font-size "10") (line-height "14")
(font-family "blockquote") (font-size "10") (line-height "14")
(border-width-top "0.5") (border-color-top "gray") (border-inset-top "8")
(border-width-left "3") (border-color-left "gray") (border-inset-left "20")
(border-width-bottom "0.5") (border-color-bottom "gray") (border-inset-bottom "-2")
@ -53,7 +53,7 @@
(define-syntax-rule (attr-list . attrs) 'attrs)
(define (heading-base font-size attrs exprs)
(qexpr (append `((font-family "default-heading") (first-line-indent "0") (display "block") (font-size ,(number->string font-size))(line-height ,(number->string (* 1.2 font-size))) (border-width-top "0.5")(border-inset-top "9") (inset-bottom "-3") (inset-top "6") (keep-with-next "true")) attrs) exprs))
(qexpr (append `((font-family "heading") (first-line-indent "0") (display "block") (font-size ,(number->string font-size))(line-height ,(number->string (* 1.2 font-size))) (border-width-top "0.5")(border-inset-top "9") (inset-bottom "-3") (inset-top "6") (keep-with-next "true")) attrs) exprs))
(define-tag-function (h1 attrs exprs)
(heading-base 20 (append '() attrs) exprs))
@ -66,7 +66,7 @@
(define h6 h3)
(define-tag-function (code attrs exprs)
(qexpr (append '((font-family "default-mono")#;(line-align "right")(font-size "10")(bg "aliceblue")) attrs) exprs))
(qexpr (append '((font-family "code")#;(line-align "right")(font-size "10")(bg "aliceblue")) attrs) exprs))
(define-tag-function (pre attrs exprs)
;; pre needs to convert white space to equivalent layout elements
@ -78,7 +78,7 @@
(qexpr (list* '(display "block") '(background-color "aliceblue")
'(first-line-indent "0")
'(clip "true")
'(font-family "default-mono") '(font-size "11") '(line-height "14")
'(font-family "code") '(font-size "11") '(line-height "14")
'(border-inset-top "10")
'(border-width-left "2") '(border-color-left "#669") '(border-inset-left "0")
'(border-inset-bottom "-4")

Loading…
Cancel
Save