Skip to content
This repository has been archived by the owner on Sep 17, 2022. It is now read-only.

How to reset variable between pages #73

Closed
pmarinov opened this issue Nov 1, 2020 · 2 comments
Closed

How to reset variable between pages #73

pmarinov opened this issue Nov 1, 2020 · 2 comments

Comments

@pmarinov
Copy link

pmarinov commented Nov 1, 2020

I've updated my Ubuntu and Racket moved from v7.0 to v7.2, using raco pkg I installed Pollen for the new Racket which probably also moved it to a later version

Something has changed because a feature for footnotes that used to work started to behave differently.

In pollen.rkt I have:

(define footnotes null)

(define (footnote . elements)
  (case (current-poly-target)
    ...
    [(html)
      ;; Collect into footnotes
      (set! footnotes (append footnotes (list elements)))
    ...

Before, when it worked, the variable footnotes used to collect only entries from the current page that has been rendered, now it collects entries randomly between pages.

What is the best way to reset the variable between pages?

The project:
https://github.com/pmarinov/bash-scripting-guide/blob/master/pollen.rkt

@mbutterick
Copy link
Owner

See #43 generally, and this message in particular. In short, Pollen now reuses namespaces during batch operations, so tag functions that assume a fresh namespace may need to be adjusted.

@pmarinov
Copy link
Author

pmarinov commented Nov 1, 2020

Thanks for the advise.

@pmarinov pmarinov closed this as completed Nov 1, 2020
pmarinov added a commit to pmarinov/bash-scripting-guide that referenced this issue Nov 1, 2020
* Old Pollen would render each page in a fresh namespace, an optimization
  has removed this side effect

* Footnotes need to be reset at the beginning of each page

* See: mbutterick/pollen-users#73
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants