[pollen] importing one Pollen source into another

2018-02-19 Thread Matthew Butterick
I pushed an update today that prevents importing one Pollen source into another without changing the name of the imported `doc` and `metas`. If this is bothersome please let me know whether I should reconsider (ideally with an example that shows a practical use) This wasn't behavior that was gu

Re: [pollen] Macro expansion inside templates?

2018-02-15 Thread Matthew Butterick
The newest update to Pollen includes a `current-metas` parameter that makes this kind of operation simpler. The parameter contains the metas of the source file currently being evaluated or rendered. So you can avoid using macros, and write `desc` like so: #lang racket/base (require pollen/core

Re: [pollen] Error rendering value from cache

2018-02-15 Thread Matthew Butterick
Hard to say exactly without seeing the code. Judging from the error msg: > output: don't know how to render value: '#hasheq((here-path . > "/Users/basus/src/basus/publications/index.html.pm ") > (title . "Publications")) It looks like you're trying to drop the whole `meta

Re: [pollen] Printing hyperlinks as links in some output targets, as footnotes in others, and as endnotes/separate document in still others

2018-02-13 Thread Matthew Butterick
Pollen delegates the nitty-gritty of generating layout to other tools. So the workflow is 1) find a tool that will make the layout you want 2) write a program that commands the tool to make this layout 3) generate this program with Pollen. Today — hopefully not forever — the best option for

Re: [pollen] Why is render-from-source-or-output-path function quicker than get-source and then render?

2018-02-10 Thread Matthew Butterick
> On Feb 9, 2018, at 10:18 PM, Junsong Li wrote: > > I think I might have hit a bug in racket serve/servlet. The actual blocking > point is the pollen get-source. It runs only half way through for certain js > files (it detects markup, markdown, and are blocked before > null-source/scribble-s

Re: [pollen] Why is render-from-source-or-output-path function quicker than get-source and then render?

2018-02-09 Thread Matthew Butterick
> On Feb 9, 2018, at 10:55 AM, Junsong Li wrote: > I noticed pollen server is using a function called > render-from-source-or-output-path , which is defined here > https://github.com/mbutterick/pollen/blob/5f338b5ecf9bbca7d7a44ca0e721b22a6cf8210a/pollen/render.rkt#L71 > > And once I switch to t

Re: [pollen] Pollen Footnotes

2018-01-24 Thread Matthew Butterick
> On Jan 24, 2018, at 8:30 PM, Matthew Butterick wrote: > > FWIW this is the same as `(length (member name fn-names))` if you avoid > putting duplicates in `fn-names` to begin with. `member` returns the tail of > the list beginning with the matching item. So in this case, y

Re: [pollen] Pollen Footnotes

2018-01-24 Thread Matthew Butterick
> On Jan 24, 2018, at 7:38 PM, Joel Dueck wrote: > > I found that, conveniently, the #:txexpr-proc will match the ◊fn tags in the > same order a left-to-right reader would encounter them in the text, > regardless of nesting. If I had given it more thought, I might have figured > out that Poll

Re: [pollen] Pollen Footnotes

2018-01-24 Thread Matthew Butterick
Correction: `(length fn-names)` should be `(length (member name fn-names))` to handle the possibility of multiple references to the same footnote. ;; #lang racket/base (require racket/list) (provide (all-defined-out)) (define (fn-id x) (string-append x "_fn")) (define (f

Re: [pollen] Pollen Footnotes

2018-01-24 Thread Matthew Butterick
> On Jan 22, 2018, at 4:38 PM, Joel Dueck wrote: > > We’re getting heavy snow all day today here in Minneapolis, so I took the day > off. I spent some of the down time writing up my approach for implementing > footnotes in an upcoming project: > https://thenotepad.org/posts/pollen-footnotes-a

Re: [pollen] Re: Pollen project server does not invalidate compile cache when files required by pollen.rkt change. Any lighter option than turning off the compile caches?

2018-01-20 Thread Matthew Butterick
Correction: name of the setup value will be `cache-watchlist`, not `compile-cache-watchlist` On Saturday, January 20, 2018 at 5:57:20 PM UTC-5, Matthew Butterick wrote: > > I've been persuaded this is a good idea & therefore implemented it. You > can now track extra depende

Re: [pollen] Re: Pollen project server does not invalidate compile cache when files required by pollen.rkt change. Any lighter option than turning off the compile caches?

2018-01-20 Thread Matthew Butterick
I've been persuaded this is a good idea & therefore implemented it. You can now track extra dependencies with the new setup value `compile-cache-watchlist`. On Friday, May 5, 2017 at 10:01:07 PM UTC-4, Matthew Butterick wrote: > > On May 5, 2017, at 6:48 PM, Shannon Sever

Re: [pollen] Yet another Pollen project: mbtype.com

2018-01-13 Thread Matthew Butterick
> On Jan 13, 2018, at 6:16 AM, Joel McCracken wrote: > > Nice! I was planning on doing something similar for my own blog/personal > site. Is the source available anywhere so I can examine some of your > techniques? I do not see it on you github. Because I had no idea what I was doing, the s

[pollen] Yet another Pollen project: mbtype.com

2018-01-12 Thread Matthew Butterick
https://mbtype.com Whereas Practical Typography and Beautiful Racket were almost entirely static web pages, this is the first project where I used Pollen with scripts running on a Racket web server (many good ideas came from Jesse Alama's book Server: Racket [1]) The pages aren't generated dy

Re: [pollen] Using expressions to define metas

2017-12-30 Thread Matthew Butterick
> On Dec 30, 2017, at 1:23 PM, Joel Dueck wrote: > > I would have expected define-meta to take the result of the expression rather > than quoting it. Is there a way to define a meta in terms of an expression > result? > > I don’t have a use for this right now, just curious. No, `define-meta

Re: [pollen] Citations

2017-12-19 Thread Matthew Butterick
> On Dec 19, 2017, at 8:13 AM, jakedrake.r...@gmail.com wrote: > > AFAICT, the main advantage of Pollen over Scribble is that Pollen is more > extensible so that a user could customize the latex template and easily add > new tag functions. Is that indeed the case? You can add tags to Scribble

Re: [pollen] Citations

2017-12-19 Thread Matthew Butterick
> On Dec 19, 2017, at 4:22 AM, J Lorieau wrote: > > 1. I'd like to test out the functionality for bibtex citation rendering in > Scribble, but the API from Racket is somewhat opaque and difficult to > use--this is largely due to my inexperience with racket and lisps. I have yet > to use these

[pollen] Re: Typesetting Racket code with Pollen

2017-12-15 Thread Matthew Butterick
Neither. The code is tagged with Pygments. The terms that end up in the `k` and `nb` classes are Racket identifiers. These are passed through a function that generates a link to the docs, derived from the `docs` function here. [1] Then a few housekeeping details to make everything look right.

Re: [pollen] Licensing for Pollen projects

2017-12-07 Thread Matthew Butterick
> On Dec 7, 2017, at 3:26 PM, Joel Dueck wrote: > > For any serious work, though, I am wondering how this approach would really > shake out. When “the book is a program”, is it ever a) useful or b) legally > meaningful to license the prose and the code separately when they are > interwoven an

Re: [pollen] pollen for slide-show presentations

2017-12-06 Thread Matthew Butterick
On Sat, 11 Nov 2017 10:45:51 -0800 > Matthew Butterick > wrote: > > > I should be a little clearer: it seems to me that a theme in your > > questions across the years has been "is Pollen a turnkey solution for > > X". My answer to this kind of question has a

Re: [pollen] cached-doc questions

2017-12-03 Thread Matthew Butterick
> On Dec 2, 2017, at 10:39 PM, Joel Dueck wrote: > The get-* functions will accept a pagenode or a path/string, but the cached-* > functions will only accept a path/string > The get-* functions take an argument pointing at the output filename (when > using a pagenode), but the cached-* functio

[pollen] `pollen/markup` now filters out void values

2017-11-26 Thread Matthew Butterick
I pushed an update yesterday that changes `pollen/markup` to ignore void values, the same way `pollen/pre` and `pollen/markdown` do. So this file: #lang pollen/markup ◊(cond) Which used to parse this way: '(root <#void>) Will henceforth do this: '(root) I don't know why I had it the other w

Re: [pollen] How to print time/call for a racket function?

2017-11-21 Thread Matthew Butterick
> On Nov 21, 2017, at 1:23 PM, Karim Chellaoui wrote: > > I'm still new to Pollen so excuse me if I missed the information but I'm > getting quite lost in the documentation... > My goal is to write a date as version number, for today I would like it to be > "20171121" for instance. How can I b

Re: [pollen] How to insert CDATA?

2017-11-20 Thread Matthew Butterick
> On Nov 20, 2017, at 12:39 PM, a.bezle...@gmail.com wrote: > > Unfortunately in this case the result for > > ◊(->html > ◊ac:link{ > ◊ri:attachment[#:ri:filename "atlassian_logo.gif"]{ > ◊ac:plain-text-link-body{◊as-cdata{Text with <> ) > > is > ri:filename="atlassian_logo.gif">

Re: [pollen] How to insert CDATA?

2017-11-20 Thread Matthew Butterick
> On Nov 19, 2017, at 10:49 PM, a.bezle...@gmail.com wrote: > > I need to export in "confluence storage format" - > https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html#ConfluenceStorageFormat-Links > >

Re: [pollen] How to insert CDATA?

2017-11-19 Thread Matthew Butterick
BTW the `->html` function, consistent with the HTML spec, will automatically treat `script` and `style` blocks as CDATA, so if that's what you're aiming for, no special sorcery needed. > On Nov 19, 2017, at 3:36 PM, Matthew Butterick wrote: > > Seems like it should

Re: [pollen] How to insert CDATA?

2017-11-19 Thread Matthew Butterick
Seems like it should work. Not sure why it isn't. I'll look into it. > On Nov 19, 2017, at 1:10 PM, a.bezle...@gmail.com wrote: > > > > My plan_b.html.pm > > #lang pollen > ◊as-cdata{567} > > > My pollen.rkt > > #lang racket/base > (require pollen/tag) > (require pollen/decode)

Re: [pollen] pollen for slide-show presentations

2017-11-11 Thread Matthew Butterick
> On Nov 11, 2017, at 9:47 AM, Saša Janiška wrote: > >> Though now, I think you will be happier with anything but Pollen. > > OK, thank you for clear input. I should be a little clearer: it seems to me that a theme in your questions across the years has been "is Pollen a turnkey solution for

Re: [pollen] pollen for slide-show presentations

2017-11-11 Thread Matthew Butterick
> On Nov 10, 2017, at 11:58 PM, Saša Janiška wrote: > > > What do you think whether Pollen is the right tool for the job? > > Let me add that besides slide presentation, I'd like to have same source > document to create handouts etc. IIRC we had this discussion in Feb 2016: https://groups.g

Re: [pollen] pollen for slide-show presentations

2017-11-09 Thread Matthew Butterick
> On Nov 9, 2017, at 6:43 AM, Gour wrote: > > Has anyone thought about using Pollen for creating slide-show > presentation like Racket's slideshow presentations? > > One concern, besides creating slide-show itself is how one could select which > font(s) to use and/or being able to 'embed' presen

[pollen] Pollen update: better caching / faster renders

2017-11-05 Thread Matthew Butterick
Pollen will now cache output files on disk, in addition to the `doc` and `metas` from each Pollen source. This means that during renders, Pollen can skip the step where it combines doc & metas with the template (which is expensive). The idea is that after the project has been rendered once, yo

Re: [pollen] invitations for thoughts about the Pollen / LaTeX nexus

2017-10-05 Thread Matthew Butterick
True, though I see it as possibly analogous to Pollen's relationship to HTML — when you're working with boilerplate structures (e.g., and ) you can let Pollen take care of them. But when you want to insert literal chunks of markup because of their specialness or complexity, you can do that to

[pollen] invitations for thoughts about the Pollen / LaTeX nexus

2017-10-05 Thread Matthew Butterick
I know that more than a few Pollen users (Pollenizers?) use it as a front end to LaTeX. I don't use LaTeX in any deep way so I've not really considered the Pollen–LaTeX interaction deeply. OTOH it seems like: 1) There is a small set of recurring problems that arise with LaTeX, that could ma

[pollen] Re: Seeking Advice re: Pollen

2017-10-05 Thread Matthew Butterick
> On Oct 5, 2017, at 9:55 AM, George Cox wrote: > > Hi, I've stumbled across your "book-is-the-program" software Pollen and feel > it is a solution to something I've wanted for years. One quick question on > practical implementation: Do you 'write' inside DrRacket, use a text editor, > or so

Re: [pollen] Re: Dynamically generating a pollen book site for every user

2017-10-02 Thread Matthew Butterick
As they say here in Hollywood: you're nobody till somebody hates you. > On Sep 30, 2017, at 2:35 PM, Joel Dueck wrote: > > Unrelated, but I wish I had learned of that HN thread when it was fresh. So > much misinformation. I would have had fun arguing^H^H supplying better > information -- Yo

Re: [pollen] Combining multiple input pages into single output.

2017-09-24 Thread Matthew Butterick
> <http://article2.html.pm/>")) > ◊(require (prefix-in art2: 'art2-submod)) > - template.html > > > > > ◊(->html ◊doc) > > > With this configuration I end up with and empty page when > renderingindex.html.pm <http://index.html.pm/> .

Re: [pollen] Combining multiple input pages into single output.

2017-09-23 Thread Matthew Butterick
> On Sep 23, 2017, at 3:29 AM, Karim Chellaoui wrote: > > I'm new to Pollen, I read the tutorial but couldn't find the way to apply > this answer. I'm getting confused: how to effectively insert submodule > ch1-submod in the main file? I tried different functions but it seems that > I'm missi

Re: [pollen] Is there a nice way to display a hash table in my document?

2017-09-17 Thread Matthew Butterick
> On Sep 17, 2017, at 10:02 AM, 飛羽如月 wrote: > > Now I want to feed each element of this list into a tag function, basically > something like > ◊(map p (hash-map references (lambda (x y) (string-append x ": " y > if it actually works. How do I make this work? Which part isn't working? Your

Re: [pollen] Does pollen pre-processor support languages other than English?

2017-09-07 Thread Matthew Butterick
> On Sep 7, 2017, at 7:53 PM, Leandro Facchinetti wrote: > > the Pollen development server could send an ‘Content-Encoding’ HTTP header, > to avoid issues like the one jcheng8 reported. By default, it would send > ‘UTF-8’, but this choice could be parameterizable via the ‘pollen/setup’ > mech

Re: [pollen] Does pollen pre-processor support languages other than English?

2017-09-07 Thread Matthew Butterick
> On Sep 6, 2017, at 7:55 PM, Leandro Facchinetti wrote: > > Pollen does not come with opinions regarding enconding, the author (you) has > to specify it. PS By default, all Racket strings are encoded as UTF-8. And thus, so are Pollen strings. https://docs.racket-lang.org/reference/encoding

Re: [pollen] Does pollen pre-processor support languages other than English?

2017-09-06 Thread Matthew Butterick
> On Sep 6, 2017, at 6:34 PM, jche...@gmail.com wrote: > > Hi, first time pollen user here. I am trying to write a book in Chinese. > Seems like Chinese could not be correctly parsed by pre-processor. Below is > an example. Is there a way to get it working?Thanks a lot. > > vegetables.pp > #la

Re: [pollen] A "second-run" for a txexpr?

2017-09-05 Thread Matthew Butterick
> On Sep 5, 2017, at 4:26 PM, trent...@ifi.uio.no wrote: > > Bullet-list is in my control, I was just using the example from the pollen > Typography for Lawyers for inspiration since it felt like writing tags for > every list felt too heavy, and I figured others had run into this issue > befor

Re: [pollen] Books with code including curly braces

2017-07-28 Thread Matthew Butterick
> On Jul 28, 2017, at 12:38 PM, 'Leandro Facchinetti' via Pollen > wrote: > > 2. If they are not balanced, use ◊___|{}| instead of ◊___{}: You can even keep going and insert other characters [1] between the bars and curly braces, e.g. — #lang pollen ◊bars|{ {{ }| ◊barbangs|!{ {{ }!| ◊barba

Re: [pollen] pollen rock 0.4

2017-07-20 Thread Matthew Butterick
, for now you can't "launch" an editor, instead you can only edit an > existing file in the editor. > > > On Wednesday, July 19, 2017 at 10:51:46 AM UTC-7, Matthew Butterick wrote: > Thank you Junsong. I've installed this version of `pollen-rock` bu

Re: [pollen] pollen rock 0.4

2017-07-19 Thread Matthew Butterick
Thank you Junsong. I've installed this version of `pollen-rock` but I don't understand how to launch the editor. Can you please describe this further? > On Jul 18, 2017, at 10:32 PM, Junsong Li wrote: > > Hi list, > > I am glad to release pollen-rock 0.4. > > https://github.com/lijunsong

[pollen] RacketCon 2017 & quasi-PollenCon

2017-06-12 Thread Matthew Butterick
RacketCon is happening Oct 7-8 in Seattle, and tickets are available now: http://con.racket-lang.org This year, we'll be having our usual day of speakers (Sat) but also a day of free-form hacking (Sun). Although Sunday is not officially "PollenCon", I will be there the whole day to work on Poll

Re: [pollen] Scribble-style codeblocks

2017-05-21 Thread Matthew Butterick
> On May 21, 2017, at 10:11 AM, Vincent Nys wrote: > > I'd like to display some Racket code in a Pollen book. In Beautiful Racket, > it looks like Racket code is produced by the Scribble HTML renderer, because > it links to the Racket docs all over the place. No, I don't use the Scribble HTML

Re: [pollen] Restrictions on using a pagetree in pollen.rkt?

2017-05-12 Thread Matthew Butterick
> On May 12, 2017, at 11:07 AM, vincent...@gmail.com wrote: > > That allows me to load index.html, but it contains parenlog/introduction.html > as well as parenlog/predicates_variables_and_unification.html. I'd prefer to > use siblings instead of next* and remove index.html, but for some reason

Re: [pollen] Re: Pollen project server does not invalidate compile cache when files required by pollen.rkt change. Any lighter option than turning off the compile caches?

2017-05-05 Thread Matthew Butterick
> On May 5, 2017, at 6:48 PM, Shannon Severance wrote: > > Finally found the answer in the documentation, Pollen tracks what it tracks > and not any more, turning off the cache is the only sollution. > https://docs.racket-lang.org/pollen/Cache.html#%28part._.Scope_of_dependency_tracking%29 >

Re: [pollen] Can we compile a battery-included library?

2017-04-26 Thread Matthew Butterick
> On Apr 25, 2017, at 9:17 PM, Junsong Li wrote: > > Oh I didn't realize the typography module. I'll check it out. Do you accept > pull request on that module? :D Maybe. Accepting a pull request means that I have to maintain that code as if it were my own. So I think of PRs as most appropriat

Re: [pollen] Can we compile a battery-included library?

2017-04-23 Thread Matthew Butterick
I encourage you to post a new package and invite pull requests. IMO little utility functions like these can be difficult to turn into worthwhile library functions, because they tend to be connected to particulars of the author's project design. This is why, for instance, `pollen/unstable/typogr

Re: [pollen] Pollen source for TFL PDF samples

2017-04-20 Thread Matthew Butterick
Actually no, those PDFs were made with InDesign. (They existed before Pollen did.) > On Apr 20, 2017, at 12:13 AM, roberto.me...@gmail.com wrote: > > A question for Matthew: > > I imagine the sample PDFs for TFL were themselves written in Pollen. If so, > is the Pollen source available anywhe

Re: [pollen] Setting "hash-ref" failure result; Error handling conditionals?

2017-03-23 Thread Matthew Butterick
I'm afraid it's difficult to offer more precise advice without seeing more of the code that's causing trouble. > On Mar 23, 2017, at 4:29 PM, Paul Atlan wrote: > > ... as shown by the fact that I'm still struggling: > * I've defined the "maybe-date" outside of the ◊(define latex-source > ◊st

Re: [pollen] Setting "hash-ref" failure result; Error handling conditionals?

2017-03-22 Thread Matthew Butterick
Are you taking the square brackets in `[failure-result]` too literally? ;) They simply denote an optional argument. Racket reads `[]` as `()` which it interprets as an incomplete function expression. The fallback value can be passed directly: (hash-ref metas 'doc-publish-date "") (hash-ref meta

Re: [pollen] Writing a book - Pollen and/or Ormode's Babel

2017-03-20 Thread Matthew Butterick
> On Mar 20, 2017, at 5:48 PM, Steve Graham > wrote: > > I have started to write a book on programming using various languages to > illustrate different concepts. My plan has been to use orgmode's babel to > produce the book because it enables you to actually execute code within a > documen

Re: [pollen] A mysterious issue…

2017-03-20 Thread Matthew Butterick
> On Mar 20, 2017, at 7:01 PM, Jon Sterling wrote: > ◊(define (infer concl . premises) > (string-append "\\frac{" (apply string-append (add-between premises > "\\quad ")) "}{" concl "}")) > > Now, what I would expect is for ◊(infer "a" "b" "c") to reduce to > "\frac{b\qquad c}{a}" or somethi

Re: [pollen] Beautiful Racket 1.0

2017-03-17 Thread Matthew Butterick
> Great job with Beautiful Racket 1.0, makes the top in hacker news. For > those of us who like to hold a beautiful book, what would be the best > way to go from Beautiful Racket as you created to Beautiful Racket in > dead tree form and still preserve it's beautiful-ness? > > I am unsure if the

Re: [pollen] Comments to book drafts online

2017-03-16 Thread Matthew Butterick
> On Mar 16, 2017, at 3:05 AM, Paulo Matos wrote: > > Thanks, given my JS-fu being weak I might be better off starting with > what you provide. :) One Google search on the topic would yield a hundred more qualified teachers, including people who actually like JS, which I do not ;) > Now, I

Re: [pollen] Comments to book drafts online

2017-03-15 Thread Matthew Butterick
> On Mar 15, 2017, at 2:54 PM, Paulo Matos wrote: > > Would you be able to share the code doing this so I don't need to reinvent > the wheel? If you want to see the JS, it's here, and it's garbage: http://beautifulracket.com/functions.js There are

Re: [pollen] Comments to book drafts online

2017-03-15 Thread Matthew Butterick
> On Mar 15, 2017, at 7:56 AM, 'Paulo Matos' via Pollen > Once I get my book chapter draft online, what's the best way to enable public > comments to paragraphs? > > I am sure I have seen this before but maybe not integrated with Pollen. I've been doing something like this on the preview page

Re: [pollen] Combining multiple input pages into single output.

2017-03-10 Thread Matthew Butterick
Joel's idea of using a "master file" to combine the chapter source files is good. Joel is using `dynamic-require`. Another mechanism would be making a submodule for each chapter with `module`: (module ch1-submod racket/base (require "ch1.html.pm") (provide doc metas)) (require (prefix-in c

Re: [pollen] Composing select functions is awkward

2017-03-09 Thread Matthew Butterick
> On Mar 9, 2017, at 1:17 PM, Shrutarshi Basu wrote: > It would be great to have some functions that allow us to easily select > txexprs from within txexprs. Have you investigated `findf-txexpr` and `findf*-txexpr` in the `txexpr` module? -- You received this message because you are subscri

Re: [pollen] pollen-rock: a server and an in-browser editor for Pollen

2017-03-02 Thread Matthew Butterick
This is fantastic. Thank you Junsong for figuring this out. I tried an earlier version but I look forward to trying the newest version. > On Mar 2, 2017, at 1:17 AM, Junsong Li wrote: > > Hello list, > > I am happy to announce the first release of pollen-rock, an in-browser editor > for Poll

Re: [pollen] Defined element incorrect behaviour

2017-02-05 Thread Matthew Butterick
> On Feb 5, 2017, at 11:05 AM, Greg Trzeciak > wrote: > > Am I missing something simple? Can you replicate it on your machines? Yes, you're missing a binding for `empty?`, which is part of `#lang racket` but not `#lang pollen`. If you import `racket/list` (or use `n

Re: [pollen] Parsing Markdown in Pollen Markup

2017-01-07 Thread Matthew Butterick
> On Jan 7, 2017, at 1:39 PM, Oliver Taylor wrote: > > It doesn’t seem that Pollen parses Pollen markup when in markdown-authoring > mode. The following does’t work Right. Pollen has two mutually exclusive authoring modes: Markdown, or Pollen markup. http://docs.racket-lang.org/pollen/second

Re: [pollen] Using highlight.js

2017-01-04 Thread Matthew Butterick
> > Now the problem. I transferred the python function into pollen.rkt like > follows: > > (define (python . xs) > `(pre (code ((class ,(format "~a" "python"))) ,@xs))) > > > Now the python code will not be highlighted. > > What is my mistake? Thanks a lot. Did you `(provide python)` fro

Re: [pollen] Excessive spaces in pre

2016-12-29 Thread Matthew Butterick
One can also produce the same behavior in `#lang scribble/text`: #lang scribble/text @(require pollen/template/html) @(define (test) (->html `(pre " 1\n 2\n 3\n 4"))) @(define (iden . s) s) @iden{@(test)} Given that this is not a Pollen problem per se, you might get a more satisfying answe

Re: [pollen] How to access a pollen source's path in pollen.rkt

2016-12-29 Thread Matthew Butterick
> On Dec 29, 2016, at 9:50 AM, Alexander George McKenzie > wrote: > > I know it's possible to pass it in using (current-contract-region), but > that's a bit unwieldy. Out of curiosity, why would you use that, rather than the `here-path` value in `metas`? > Example: you define an ◊image fu

Re: [pollen] Getting unbound identifier back

2016-12-24 Thread Matthew Butterick
> Right. That's why I have the exception to allow unbound id that starts with > "/" to become a tag (after stripping "/" out, of course) like what Pollen > would normally do. At one point I considered having a magic character that would denote tags, somewhat like you suggest. But: 1) It breaks

Re: [pollen] Getting unbound identifier back

2016-12-23 Thread Matthew Butterick
> This might be an unpopular opinion, but I am kinda annoyed at how Pollen let > unbound identifiers become tag while sometimes it is actually my mistake. I agree that the behavior can "make debugging difficult sometimes". [1] But having to define every tag in advance would be a massive, soul-k

[pollen] update: new `-l` or `--launch` flag for `raco pollen start`

2016-11-22 Thread Matthew Butterick
This flag will launch the project dashboard in your default web browser right after the server starts. -- You received this message because you are subscribed to the Google Groups "Pollen" group. To unsubscribe from this group and stop receiving emails from it, send an email to pollenpub+unsub

[pollen] Relocating / renaming the "pollen-cache" directory

2016-11-21 Thread Matthew Butterick
Rather than maintaining a separate directory, Pollen will now put Pollen's cached files inside a "pollen" subdirectory of the "compiled" directory. Racket already uses this directory to store source caches, and it seems simpler to combine everything. The benefit is that if you use source contro

Re: [pollen] Splitting multiple-output tag functions with a Racket macro

2016-11-15 Thread Matthew Butterick
PS Jens Axel recommended looking at Racket units. I know nothing about those. Jens Axel is usually right, however. -- You received this message because you are subscribed to the Google Groups "Pollen" group. To unsubscribe from this group and stop receiving emails from it, send an email to pol

Re: [pollen] Splitting multiple-output tag functions with a Racket macro

2016-11-15 Thread Matthew Butterick
On Nov 14, 2016, at 5:30 PM, Matthew Butterick wrote: > Not joking, but also not claiming to have a full-fledged idea ;) Here's a rudimentary version of moving tag functions into classes: https://gist.github.com/mbutterick/b169900fedf84810b6335365b89562e4 In this example, all

Re: [pollen] Splitting multiple-output tag functions with a Racket macro

2016-11-14 Thread Matthew Butterick
On Nov 14, 2016, at 1:49 PM, Joel Dueck wrote: > > When you talk about functions transparently overriding other functions in > some kind of inheritance hierarchy, are you talking about ... classes? > > http://docs.racket-lang.org/guide/classes.html > > I'm familiar with inheritance and overlo

Re: [pollen] Splitting multiple-output tag functions with a Racket macro

2016-11-14 Thread Matthew Butterick
On Nov 14, 2016, at 10:40 AM, Joel Dueck wrote: > What if Pollen automatically branched to tag functions prefixed with pdf: > when current-poly-target is 'pdf ? That is, if 'pdf is the current target, > Pollen would check for pdf:strong and, if it didn't find one, default to > plain-ol strong

Re: [pollen] Splitting multiple-output tag functions with a Racket macro

2016-11-12 Thread Matthew Butterick
On Nov 11, 2016, at 11:48 AM, Joel Dueck wrote: > I created a macro to help myself out as I consider adding a third and fourth > output format to a Pollen project. > > I wrote about it at my Pollen-as-blog project here: > https://thenotepad.org/posts/splitting-pollen-tags-with-racket-macros.h

Re: [pollen] Splitting multiple-output tag functions with a Racket macro

2016-11-11 Thread Matthew Butterick
On Nov 11, 2016, at 11:48 AM, Joel Dueck wrote: > I created a macro to help myself out as I consider adding a third and fourth > output format to a Pollen project. > > I wrote about it at my Pollen-as-blog project here: > https://thenotepad.org/posts/splitting-pollen-tags-with-racket-macros.h

Re: [pollen] Collecting a wish list for a pollen editor

2016-10-20 Thread Matthew Butterick
Interesting. How would you implement these? As extensions to DrRacket? On Oct 20, 2016, at 9:44 AM, Li Junsong wrote: > > I am collecting a wish list for a pollen editor. > > I always wish my editor could tell me whether a tag is defined and exported. > The only way to know this now seems to

Re: [pollen] How to access current output type from `pollen.rkt'?

2016-10-20 Thread Matthew Butterick
On Oct 20, 2016, at 11:50 AM, lfacc...@jhu.edu wrote: > The existence of a current-output-type function, available to pollen.rkt. It > would return the same things that current-poly-target returns, but would > always be in correspondence with the output type in question, regardless of > the so

Re: [pollen] How to access current output type from `pollen.rkt'?

2016-10-20 Thread Matthew Butterick
On Oct 20, 2016, at 8:33 AM, lfacc...@jhu.edu wrote: > Use (current-poly-target). Notice that the files have extensions such as > .html.pm and .atom.pm, and not .poly.pm. This is no accident, since each file > only generates one output type. Thus, (current-poly-target) always answers > with the

Re: [pollen] Beautiful Racket

2016-10-14 Thread Matthew Butterick
On Oct 14, 2016, at 6:00 AM, Tom Brooke wrote: > I assume Beautiful Racket is written with Pollen. I looked at it a while back > and worked through the the one section and I haven't checked again until > yesterday - Amazing. A beautiful sight and apparently it isn't finished yet. > > If you

Re: [pollen] Modifying output filenames (extensionless urls)

2016-10-02 Thread Matthew Butterick
I think that's likely a bug. I'll look into it. On Sat, Oct 1, 2016 at 10:24 PM, Alexander George McKenzie < a.mcken...@gmail.com> wrote: > Since avoiding the problem altogether should never be discounted — Can you >> elaborate on why you're stripping the extensions after the fact rather than >>

Re: [pollen] Modifying output filenames (extensionless urls)

2016-10-01 Thread Matthew Butterick
On Sep 28, 2016, at 4:42 AM, Alexander George McKenzie wrote: > Question #1: is there a way I can override the here, next, previous functions > in pollen.rkt (so in template.html I can just use ◊here instead of ◊(no-ext > here)? > > > > Question #2: is there a better solution I am missing?

Re: [pollen] txexpr in attributes?

2016-09-10 Thread Matthew Butterick
1) if the citation is not a one-shot thing, I would recommend creating an external list of sources and making a reference into that list (rather than hard-coding it into the tag) 2) either way, rather than using a #:source attribute within `epigraph`, you could make a `source` subtag within, an

Re: [pollen] Deploying pollen server live

2016-08-19 Thread Matthew Butterick
On Aug 19, 2016, at 12:35 PM, Ifeoluwapo Eleyinafe wrote: > Hey. Thanks so much. I was looking into trying to use Racket as the > webserver and pollen as the preprocessor but this will not work as I am not > yet smart enough. But pollen to php, html, css and on and on incorporates > nicely

Re: [pollen] Deploying pollen server live

2016-08-19 Thread Matthew Butterick
On Aug 19, 2016, at 1:45 AM, Ifeoluwapo Eleyinafe wrote: > I am really new to programming but I can follow a few things. Can anyone > please lay out a framework for deploying a book made using pollen live. I'd > like to avoid the overhead of PHP, a database or a CMS. Or is that > unavoidab

[pollen] Pollen update: index pages for the project server

2016-08-17 Thread Matthew Butterick
I pushed an update today that improves the behavior of "/"-terminated URLs in the project server by using default index pages. The "index.html" case will work by default. I also added an `index-pages` setting to `pollen/setup` that will let you configure the names of the default pages that the p

Re: [pollen] Implementing unordered lists in plaintext output

2016-08-17 Thread Matthew Butterick
On Aug 17, 2016, at 1:25 PM, Chris Forster wrote: > I see your point Junsong; this is just a list (it's a LIST! for heaven's > sake) and so can be handled like a list (i.e. without any global variable to > track mutation). In part I led astray I think by modeling my solution to this > problem o

Re: [pollen] Implementing unordered lists in plaintext output

2016-08-16 Thread Matthew Butterick
On Aug 16, 2016, at 11:00 PM, Matthew Butterick wrote: > there's a sample in the `pollen-tfl` code, showing how the surrounding list > tag decodes the items inside Meant to include a link: http://docs.racket-lang.org/pollen-tfl/_pollen_rkt_.html#%28def._%28%28lib._pollen-tfl%2F

Re: [pollen] Implementing unordered lists in plaintext output

2016-08-16 Thread Matthew Butterick
1. You might want to see if the `pollen-count` package suits your needs: https://github.com/malcolmstill/pollen-count 2. >> After some playing around, it seems that when list items are processed >> (when the li function is called), the code for the ordered list in the case >> statement isn't

Re: [pollen] Using here-path to Produce an Output Filename

2016-08-15 Thread Matthew Butterick
On Aug 15, 2016, at 4:22 PM, Chris Forster wrote: > here-path seems to be a string (rather than a path object), hence the > string->path call. It seems as though last isn't evaluating... and so > string->path is getting the whole list... but why? You're right about the problem. `last` is in

[pollen] RacketCon is Sun Sept 18 in St Louis

2016-08-09 Thread Matthew Butterick
You are invited: http://con.racket-lang.org Once again, I am a sponsor of RacketCon and its web-designer-in-chief. Additionally, I will be talking about the "Beautiful Racket" book project. -- You received this message because you are subscribed to the Google Groups "Pollen" group. To unsubs

Re: [pollen] Markup/Tags in Metas

2016-08-09 Thread Matthew Butterick
On Aug 8, 2016, at 3:35 PM, Matthew Butterick wrote: > The splice mark should never show up. I consider this wrong: > >> >> <@>Markup in MetaData > So I'll look into that. I have now looked into that. I adjusted the `->html` function so that it will h

Re: [pollen] Markup/Tags in Metas

2016-08-08 Thread Matthew Butterick
On Aug 8, 2016, at 1:58 PM, Chris Forster wrote: > You may note that in both these cases, I've removed the splice (@); that's > because when I include it, we have this situation. I believe I suggested the `◊(define-meta title ◊@{Markup in ◊em{MetaData}})` idea to you. But I see that it doesn

Re: [pollen] Output into Subdirectories based on Format

2016-08-08 Thread Matthew Butterick
On Aug 8, 2016, at 8:40 AM, Chris Forster wrote: > Is it (easily) feasible to put all files from a particular output target in a > subdirectory of the project root? This would clean up the project root, but > also help for some other purposes; for instance, I'm trying to use Pollen to > create

Re: [pollen] Nesting within txexpr

2016-08-01 Thread Matthew Butterick
On Aug 1, 2016, at 12:43 PM, Chris Forster wrote: > > (txexpr 'div '((id "top")) '("Hello" (p "World"))) > > I'm not sure I understand why the nested paragraph wouldn't also be a > txexper--would there ever be a situation where the following would make sense? > > (txexpr 'div '((id "top")) '(

Re: [pollen] Nesting within txexpr

2016-08-01 Thread Matthew Butterick
On Aug 1, 2016, at 10:57 AM, Chris Forster wrote: > I have written the following Pollen code to create such links: > > (txexpr 'a `((href ,(string-append "#fn" (number->string footnote-number > `(sup ,(number->string footnote-number))) > > > Everything is correct here except the s

Re: [pollen] Emacs pollen-mode company backend available

2016-07-20 Thread Matthew Butterick
Thanks! I still don't use Emacs, but I appreciate your work on this ;) On Jul 19, 2016, at 9:32 PM, Li Junsong wrote: > Hello, > > Emacs pollen-mode supports company-mode now. You'll get tag function > completion in your pollen file. See https://github.com/lijunsong/pollen-mode > > > > >

Re: [pollen] "cannot reference undefined identifier" when using eval in Pollen

2016-07-20 Thread Matthew Butterick
On Jul 20, 2016, at 8:37 AM, Joel Dueck wrote: > > This is a big help for my understanding of macros, thanks. I felt that eval > was a bit of a hack, but I had not understood that with-syntax could use > `...` to produce repeating patterns that aren't tied to the syntax pattern > passed in by

<    1   2   3   >