Index: code-docs/dust.scrbl ================================================================== --- code-docs/dust.scrbl +++ code-docs/dust.scrbl @@ -65,14 +65,22 @@ @defproc[(tx-strs [tx txexpr?]) string?] Finds all the strings from the @emph{elements} of @racket[_tx] (ignoring attributes) and concatenates them together. +@examples[#:eval dust-eval +(tx-strs '(p [[class "intro"]] + (em "I’m not opening the safe") ", Wilson remembers thinking."))] + @defproc[(first-words [str string?] [n exact-nonnegative-integer?]) string?] Returns a string containing the first @racket[_n] words of @racket[_str], removing any trailing -punctuation. +punctuation. It will trip on opening punctuation or punctuation surrounded by spaces. + +@examples[#:eval dust-eval +(first-words "Another time, perhaps." 2) +(first-words "‘One problem’ – it don’t always do punctuation right." 3)] @section{Article parsers and helpers} @defproc[(default-title [date string?]) string?] @@ -120,16 +128,17 @@ Given a list of tagged X-expressions (ideally a list of @code{note}s), returns two values: the value of the @racket['disposition] attribute for the last note that contains one, and the ID of that note. @examples[#:eval dust-eval -(define notelist (list '(note [[date "2018-02-19"] [disposition "* problematic"]] "First note") - '(note [[date "2018-03-19"]] "Second note") - '(note [[date "2018-04-19"] [disposition "† recanted"]] "Third note"))) -(notes->last-disposition-values notelist)] +(define notelist + (list + '(note [[date "2018-02-19"] [disposition "* problematic"]] "First note") + '(note [[date "2018-03-19"]] "Second note") + '(note [[date "2018-04-19"] [disposition "† recanted"]] "Third note"))) -;; Extract the last disposition (if any), and the ID of the disposing note, out of a list of notes +(notes->last-disposition-values notelist)] @section{Date formatters} @defproc[(ymd->english [ymd-string string?]) string?] Index: code-docs/pollen.scrbl ================================================================== --- code-docs/pollen.scrbl +++ code-docs/pollen.scrbl @@ -7,18 +7,19 @@ @; notice and this notice are preserved. This file is offered as-is, @; without any warranty. @(require "scribble-helpers.rkt") @(require (for-label "../pollen.rkt" + "../dust.rkt" racket/base txexpr pollen/tag pollen/setup pollen/core sugar/coerce)) -@title{@filepath{pollen.rkt}} +@title[#:tag "pollen-rkt"]{@filepath{pollen.rkt}} @defmodule["pollen.rkt" #:packages ()] The file @filepath{pollen.rkt} is implicitly @code{require}d in every template and every @code{#lang pollen} file in the project. It defines the markup for all Pollen documents, and also re-provides @@ -71,11 +72,11 @@ Wrap text in a paragraph. You almost never need to use this tag explicitly; just separate paragraphs by an empty line. Single newlines within a paragraph will be replaced by spaces, allowing you to use -@link["https://scott.mn/2014/02/21/semantic_linewrapping/"]{semantic line wrapping}. +@ext-link["https://scott.mn/2014/02/21/semantic_linewrapping/"]{semantic line wrapping}. @defproc[(newthought [element xexpr?] ...) txexpr?] An inline style intended for the first few words of the first paragraph in a new section. Applies a “small caps” style to the text. Any paragraph containing a @code{newthought} tag is given extra @@ -145,11 +146,11 @@ The @code{#:date} attribute is required and must be of the form @tt{YYYY-MM-DD}. The @code{#:author} and @code{#:author-url} attributes can be used to credit notes from other people. If the @code{#:author} attribute is not supplied then the value of @code{default-authorname} -from @filepath{dust.rkt} is used. +is used. The @code{#:disposition} attribute is used for notes that update or alter the whole disposition of the article. It must be a string of the form @racket[_mark _past-tense-verb], where @racket[_mark] is a symbol suitable for use as a marker, such as * or †, and @racket[_past-tense-verb] is the word you want used to describe the article’s current state. An article stating a metaphysical position Index: code-docs/scribble-helpers.rkt ================================================================== --- code-docs/scribble-helpers.rkt +++ code-docs/scribble-helpers.rkt @@ -43,8 +43,8 @@ (hyperlink (string-append repo-url/ "wiki?name=" (uri-encode title)) title #:style (style #f (list (attributes '((target . "_parent"))))))) (define (ext-link url-str . elems) - (keyword-apply hyperlink '(#:style) (list (style #f (list (attributes '((target . "_parent")))))) + (keyword-apply hyperlink '(#:style) (list (style #f (list (attributes '((target . "_blank")))))) url-str elems)) Index: code-docs/scribble-iframe.html ================================================================== --- code-docs/scribble-iframe.html +++ code-docs/scribble-iframe.html @@ -1,8 +1,10 @@ -