@@ -90,24 +90,31 @@ @racket[articles+notes], but can be any custom query that projects onto the @racket[listing] schema (see @racket[project-onto]). } -@deftogether[(@defproc[(articles [type (or/c 'full 'excerpt 'short)] +@deftogether[(@defproc[(articles [type (or/c 'full 'excerpt 'short 'content)] [#:series series (or/c string? (listof string?) boolean?) #t] [#:limit limit integer? -1] [order stringish? 'desc]) query?] - @defproc[(articles+notes [type (or/c 'full 'excerpt 'short)] + @defproc[(articles+notes [type (or/c 'full 'excerpt 'short 'content)] [#:series series (or/c string? (listof string?) boolean?) #t] [#:limit limit integer? -1] [order stringish? 'desc]) query?])]{ Create a query that fetches either articles only, or articles and notes intermingled, respectively. The results will be sorted by publish date according to @racket[_order] and optionally limited to a particular series. Use the resulting query with the @racket[listing-htmls] or @racket[fenced-listing] functions provided by this module, or with deta’s @racket[in-entities] if you want to work with the @racket[listing] schema structs. + +The @racket[_type] parameter specifies what version of the articles’ and notes’ HTML markup you +want. For HTML suitable for listing several articles and/or notes together on the same page, use +@racket['full] (the full content but not including @tech{notes}), @racket['excerpt] (like full but +abbreviated to only the excerpt if one was specified) or @racket['short] (date and title only). Use +@racket['content] to get the entire HTML content, including any notes but not including any header +or footer. (This is the option used in the RSS feed.) If @racket[_series] expression evaluates to @racket[#f], articles will not be filtered by series. If it evaluates to @racket[#t] (the default), articles will be filtered by those that specify the current output of @racket[here-output-path] in their @tt{series_pagenode} column in the SQLite cache. If a string or a symbol is supplied, articles will be filtered by those containing the result @@ -114,14 +121,15 @@ of @racket[(format "series/~a.html" _series)] in their @tt{series_pagenode} column in the SQLite cache. If a list of strings or symbols is provided, this @racket[format] operation will be applied to each of its members and articles whose @tt{series_pagenode} column matches any of the resulting values will be included. -The @racket[_order] expression must evaluate to either @racket["ASC"] or @racket["DESC"] and the -@racket[_limit] expressions must evaluate to a value suitable for use in the @tt{LIMIT} clause of -@ext-link["https://sqlite.org/lang_select.html"]{a SQLite @tt{SELECT} statement}. An expression that -evaluates to a negative integer (the default) is the same as having no limit. +The @racket[_order] expression must evaluate to either @racket["ASC"] or @racket["DESC"] (or +equivalent symbols) and the @racket[_limit] expressions must evaluate to a value suitable for use in +the @tt{LIMIT} clause of @ext-link["https://sqlite.org/lang_select.html"]{a SQLite @tt{SELECT} +statement}. An expression that evaluates to a negative integer (the default) is the same as having +no limit. Typically you will pass these functions by name to listing functions like @racket[fenced-listing] rather than calling them directly. @examples[#:eval example-eval @@ -172,11 +180,11 @@ [author string/f] [conceal string/f] [series-page string/f] [noun-singular string/f] [note-count integer/f] - [doc-html string/f] + [content-html string/f] [disposition string/f] [disp-html-anchor string/f] [listing-full-html string/f] [listing-excerpt-html string/f] [listing-short-html string/f]) @@ -228,14 +236,18 @@ Table holding cached information about index entries found in articles. } -@defstruct*[listing ([html string/f] - [published date/f] - [series-page symbol/f]) +@defstruct*[listing ([path string/f] + [title string/f] + [author string/f] + [published string/f] + [updated string/f] + [html string/f]) #:constructor-name make-listing]{ -This is not a table that persists in the cache database; rather it is the schema targeted by -@racket[articles] and @racket[articles+notes] using deta’s @racket[project-onto]. +This is a “virtual” schema targeted by @racket[articles] and @racket[articles+notes] using deta’s +@racket[project-onto]. It supplies the minimum set of fields needed to build the RSS feed; most +times (e.g., on @tech{series} pages) only the @tt{html} field is used, via @racket[fenced-listing]. }