From d7860e0eaf1231a6cd24ceae140472b2f1157e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Wed, 18 Nov 2015 16:26:33 +0100 Subject: [PATCH] Fixed footnotes rendering in documentation. --- graph/graph/graph2.lp2.rkt | 31 ++++++++++++++----------------- graph/lib/doc.rkt | 22 +++++++++++++++++----- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/graph/graph/graph2.lp2.rkt b/graph/graph/graph2.lp2.rkt index 89c802e7..e756a42c 100644 --- a/graph/graph/graph2.lp2.rkt +++ b/graph/graph/graph2.lp2.rkt @@ -202,8 +202,9 @@ When the graph constructor is called with the arguments for the root parameters, it is equivalent to make and then resolve an initial placeholder. We will use a function from the @tc[fold-queue] library to process the queues of pending placeholders, starting with a queue containing only that root placeholder. -We will have one queue for each placeholder type@note{Otherwise, when extracting - an element from the collection of results, we would need a @racket[cast].}. The +We will have one queue for each placeholder type.@note{It we had only one queue, + we would have only one collection of results, and would need a @racket[cast] + when extracting nodes from the collection of results.} The queues' element types will therefore be these placeholder types. @chunk[ @@ -222,21 +223,17 @@ The return type for each queue will be the corresponding with-promises type. @; type. @; TODO: clarity. -@(void #| -The @tc[fold-queues] function allows us to associate each element with a tag, so -that, inside the processing function and outside, we can refer to an element -using this tag, which can be more lightweight than keeping a copy of the -element. - -We will tag our elements with an @tc[Index], which prevents memory leakage: if -we kept references to the original data added to the queue, a graph's -representation would hold references to its input, which is not the case when -using simple integers to refer to other nodes, instead of using the input for -these nodes. Also, it makes lookups in the database much faster, as we will be -able to use an array instead of a hash table.|#) - -@chunk[ - Index] +@; The @tc[fold-queues] function allows us to associate each element with a tag, so +@; that, inside the processing function and outside, we can refer to an element +@; using this tag, which can be more lightweight than keeping a copy of the +@; element. +@; +@; We will tag our elements with an @tc[Index], which prevents memory leakage: if +@; we kept references to the original data added to the queue, a graph's +@; representation would hold references to its input, which is not the case when +@; using simple integers to refer to other nodes, instead of using the input for +@; these nodes. Also, it makes lookups in the database much faster, as we will be +@; able to use an array instead of a hash table. @subsection{The queues of placeholders} diff --git a/graph/lib/doc.rkt b/graph/lib/doc.rkt index 9e30fbd0..77a076db 100644 --- a/graph/lib/doc.rkt +++ b/graph/lib/doc.rkt @@ -8,21 +8,33 @@ ; @setup-math is returned in @doc-lib-setup. - +(require scriblib/render-cond) ;(require "low-untyped.rkt") ;(#lang reader "scribble-custom/lp2.rkt" #:lang typed/racket) ;; http://lists.racket-lang.org/users/archive/2015-January/065752.html -;; http://bugs.racket-lang.org/query/?cmd=view%20audit-trail&database=default&pr=14068 +;; http://bugs.racket-lang.org/query/?cmd=view%20audit-trail&pr=14068 +;; &database=default (require (for-label (only-meta-in 0 typed/racket))) (provide (for-label (all-from-out typed/racket))) -;(require scriblib/footnote) -;(provide (all-from-out scriblib/footnote)) -(require (only-in scribble/base [margin-note note])) +;; ==== hybrid footnotes/margin-note ==== (provide note) +(require (only-in scriblib/footnote [note footnote]) + (only-in scribble/base margin-note) + (only-in scribble/core nested-flow style)) + +(define (note . args) + (cond-element + [html (element (style "refpara" '()) + (list (element (style "refcolumn" '()) + (list (element (style "refcontent" '()) + (list args))))))] + [else (apply footnote args)])) + +;; ==== ==== (require (for-syntax mzlib/etc)) (define-syntax (doc-lib-setup stx)