Re: [pollen] Filenames in index.ptree

2016-07-20 Thread Matthew Butterick
AFAICT that's a bug (Pollen also permits the _ character to be used as an extension separator, and wasn't handling filenames like "foo_bar.html" properly). I've pushed a fix. On Jul 19, 2016, at 11:14 PM, Chris Forster wrote: > Hi All, > > Not totally sure if I'm

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

2016-07-20 Thread Matthew Butterick
On Jul 19, 2016, at 9:42 PM, Joel Dueck wrote: > > So to that end I wrote the poly-branch-tag macro, a simplified version of > which is here: > > (define-for-syntax site-poly-targets '(pdf html)) > > (define-syntax (poly-branch-tag stx) > (syntax-parse stx > [(_

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.

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,

[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

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

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

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

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: >

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

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,

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:

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

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)`

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,

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

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

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

Re: [pollen] pollen rock 0.4

2017-07-20 Thread Matthew Butterick
. > > So, 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` but I do

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

[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

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

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?

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

[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

[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

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 >

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

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.

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 >

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

2017-09-24 Thread Matthew Butterick
quire "article2.html.pm > <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://inde

[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

[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] 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.

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] 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

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

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-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 >

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

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 <m...@mbtype.com> wrote: > > Seems l

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

[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,

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

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

Re: [pollen] pollen for slide-show presentations

2017-12-06 Thread Matthew Butterick
1 Nov 2017 10:45:51 -0800 > Matthew Butterick <m...@mbtype.com > 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

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),

Re: [pollen] Rewriting URLs in Pollen server

2018-05-04 Thread Matthew Butterick
Perhaps, though a feature that claims to be "compatible" comes with a lot of housekeeping and maintenance. Why couldn't the URL rewriting happen in the tag function, rather than at the Pollen level? For instance, you would write ◊clean-apache-link["ooh/la/la.html"]{my link text} And use an

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

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 Severance &l

Re: [pollen] Pollen Footnotes

2018-01-24 Thread Matthew Butterick
> On Jan 24, 2018, at 8:30 PM, Matthew Butterick <m...@mbtype.com> 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

[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

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

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

[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

Re: [pollen] Automatic non-breaking space inserter in Russian

2018-08-21 Thread Matthew Butterick
> On Aug 21, 2018, at 9:12 AM, Natanael de Kross wrote: > > I mean there is so much going on and I know so little. Last month it's like a > whole new world got opened to me. My to-learn list is huge enough already and > my head is going to explode. But I can't say that I don't enjoy the

Re: [pollen] ‘raco pollen start’ and ‘raco pollen render --recursive’ inconsistent with respect to ‘current-project-root’

2018-03-07 Thread Matthew Butterick
OK, I just pushed an update with a `--subdir` switch that behaves this way. > On Mar 7, 2018, at 3:32 AM, 'Leandro Facchinetti' via Pollen > wrote: > > Hi, > > Consider the following Pollen project: > > ;; a.txt.pp > #lang pollen > ◊(current-project-root) > >

Re: [pollen] Templates interlinked within templates interlinked

2018-03-15 Thread Matthew Butterick
> On Mar 15, 2018, at 6:00 AM, Joel Dueck wrote: > > I was pretty happy to learn about the web-server/templates package, which > allows you to include the contents of a template file and have it dropped > into the lexical context of the calling site. I’ve often wanted

Re: [pollen] ‘raco pollen start’ and ‘raco pollen render --recursive’ inconsistent with respect to ‘current-project-root’

2018-03-07 Thread Matthew Butterick
This sounds wrong. And yet: is it? `current-project-root` is documented as the "the directory where you launched raco pollen start". (I'm not saying that pedantically — I often read the Pollen docs to find out things I've forgotten ;) The idea of `raco pollen render --recursive` is that

Re: [pollen] ‘raco pollen start’ and ‘raco pollen render --recursive’ inconsistent with respect to ‘current-project-root’

2018-03-07 Thread Matthew Butterick
> On Mar 7, 2018, at 8:01 AM, 'Leandro Facchinetti' via Pollen > wrote: > > I believe the directory containing ‘pollen.rkt’ is the “real home directory.” > Is this conception problematic? Yes. Consider a project structured like this at the top level: a.html.pm

Re: [pollen] ‘raco pollen publish’ shouldn’t publish templates

2018-03-02 Thread Matthew Butterick
I agree. But templates can have any name. ("template.html" is just the default convention.) So automatic filtering could be finicky. I think the best policy is to use the `omitted-path?` setting in pollen/setup. I just failed to do so in this instance ;) > On Mar 2, 2018, at 11:42 AM,

Re: [pollen] What are the differences between Scribble and Pollen?

2018-03-02 Thread Matthew Butterick
> On Mar 2, 2018, at 7:03 AM, Joel McCracken wrote: > > But, I have been wondering, how do Pollen and Scribble differ? Its not clear > to me if I should actually start with Pollen, or evaluate both libraries. It's a question of control & flexibility. Scribble is

Re: [pollen] Pygments doesn't work

2018-09-26 Thread Matthew Butterick
> On Sep 25, 2018, at 11:49 PM, Evžen Wybitul wrote: > > I followed the tutorial from the official Pollen docs > and tried to make > Pygments work. I have installed Pygments with both pip and easy_install, and > have `pygmentize`

Re: [pollen] Source files in multiple directories and generating an index

2019-01-20 Thread Matthew Butterick
> On Jan 20, 2019, at 12:03 PM, Evžen Wybitul wrote: > > 1. I can't find out how to keep the "notes" from different subjects in > different folders. The problem is I'm unable to dynamically build the > "master-index" of such files. What have you tried that didn't work? It seems

Re: [pollen] Source files in multiple directories and generating an index

2019-01-21 Thread Matthew Butterick
> On Jan 20, 2019, at 11:33 PM, Evžen Wybitul wrote: > > And it works, partially. However, when I call `(next here)` on order to do > page navigation, the value for file1 is `analysis/file2.html`, but I'd need > it to be only `file2.html`. Of course, I could just strip the `[...]/` part >

Re: [pollen] How to make a tag do nothing for specific output formats

2018-12-08 Thread Matthew Butterick
> On Dec 8, 2018, at 5:15 AM, Fletcher Hardison wrote: > > I've been doing something like: > > (define (my-tag . xs) >(case (current-poly-target) >[(ltx) do something] >[else xs])) > > Is there a better way to pass elements through without doing anything to > them. I'm

Re: [pollen] local-require local files in a template

2018-12-19 Thread Matthew Butterick
The template is merely an accessory for a source file being rendered. Everything in the template (including relative path strings) will be evaluated as if it were in the source file already. AFAICT this is consistent with how we usually expect relative path strings to behave. You hint that

Re: [pollen] Moving to Pollen from WordPress

2019-03-23 Thread Matthew Butterick
1) Converting individual HTML pages is sometimes more straightforward than unraveling the mysteries of the XML export. 2) See the `pollen/unstable/convert` module for possibly useful helper functions. https://docs.racket-lang.org/pollen/Convert.html?q=pollen%2Funstable%2Fconvert

Re: [pollen] getting the filename of current input source in pollen.rkt

2019-03-28 Thread Matthew Butterick
> On Mar 28, 2019, at 6:23 AM, Ifeoluwapo Eleyinafe > wrote: > I think I can pull from metas using 'here-path but I don't know how to > access metas from pollen.rkt. I can do so from the template file but then I > won't be able to use the data in my tag

Re: [pollen] Enthusiastic thank you and beginner question about metas

2019-03-28 Thread Matthew Butterick
> On Mar 28, 2019, at 12:42 AM, Zach Mandeville > wrote: > > And below this I wanted a function to turn ◊author into that details element > by referencing ◊author text against that 'scuttlebutts' meta...but, I can't > get it to work. The closest I got is this: FWIW though you call

Re: [pollen] Simple question about nested custom tags

2019-02-25 Thread Matthew Butterick
> On Feb 25, 2019, at 3:43 PM, Brendan Stromberger > wrote: > > I've got a simple Pollen question for anyone that is familiar. > > ◊; digram-row would map to an , and digram-row-item to an , > > (define (digram . elements) > (case (current-poly-target) > [(txt) elements] > [else

Re: [pollen] Library for rendering Pollen to JSON?

2019-02-27 Thread Matthew Butterick
> On Feb 26, 2019, at 6:53 AM, Brendan Stromberger > wrote: > > Has anyone written a library to generalize (at least to some extent) the > process of rendering a Pollen document to JSON? When you say "Pollen document" I take it you mean an X-expression (because a rendered source file could

Re: [pollen] Navigation issue with Pollen templates

2019-02-28 Thread Matthew Butterick
> On Feb 28, 2019, at 6:42 AM, Brendan Stromberger > wrote: > > I can't seem to get next/previous navigation working. When I use `◊(previous > here)` and `◊(next here)` > for my nav links, they evaluate to blank strings. `◊|here|` correctly > evaluates (as far as I can tell) to the current

Re: [pollen] Using generated pagetree as an index pagetree

2019-02-28 Thread Matthew Butterick
> On Feb 28, 2019, at 9:09 AM, Brendan Stromberger > wrote: > > Side question but related: is `doc` a magical export from ptree files? How do > I know what is being exported from any given Pollen file (*.ptree, *.p, *.pm)? `doc` and `metas` are exported from every Pollen source file.

[pollen] dropping support for Rackets earlier than verison 6.3

2019-02-27 Thread Matthew Butterick
Short version: Pollen will soon be dropping support for Rackets earlier than 6.3. If this is bothersome for some reason, now is the time to say so. Long version: To date, Pollen (and associated libraries, like `txexpr` and `sugar` and `hypheneate`) have supported Racket 6.0 or later. This

Re: [pollen] Using generated pagetree as an index pagetree

2019-02-28 Thread Matthew Butterick
Sometimes there's a misapprehension among new users that Pollen represents a monolithic "take it or leave it" system. (Not a surprise, because many page-making systems are like that.) Pollen tries to make simple projects easy (by providing non-astonishing default behavior) while not inhibiting

Re: [pollen] Navigation issue with Pollen templates

2019-02-28 Thread Matthew Butterick
> On Feb 28, 2019, at 3:17 PM, Brendan Stromberger > wrote: > > In my template, I have `◊(define here (path->pagenode (->output-path > (hash-ref metas 'here-path` > > This renders out to a pagenode that looks something like > "body/3_the_trigrams.html" > > When I send this pagenode

Re: [pollen] Navigation issue with Pollen templates

2019-02-28 Thread Matthew Butterick
> On Feb 28, 2019, at 4:28 PM, Matthew Butterick wrote: > > But I would put the code inside a function in "pollen.rkt". In that case you > can pass `metas` as an argument, or use the `current-metas` parameter. (Of course in that case the `require` could go

Re: [pollen] Navigation issue with Pollen templates

2019-03-01 Thread Matthew Butterick
> On Mar 1, 2019, at 11:08 AM, Brendan Stromberger > wrote: > > build-path: contract violation > expected: (or/c path-for-some-system? path-string? 'up 'same) > given: 'body/2_understanding_the_lines.poly.pm > argument position: 2nd > other arguments...: ># My error, the last line

Re: [pollen] Highlight code blocks are indenting too much

2019-03-10 Thread Matthew Butterick
When I tried your example, I got the right result. But there is a known issue with the Scribble indenter (which Pollen uses) changing the indentation within curly braces, which it shouldn't. [1] Thus, your example persuades me that it's better policy for Pollen to leave whatever indenting is

Re: [pollen] Question about Pollen markup

2019-03-10 Thread Matthew Butterick
The curly-brace syntax is almost always preferable. Keep in mind that the linebreaks are separated into their own elements (For more on this behavior see [1].) So this markup: ◊ol{The remaining forty-nine stalks ◊(comment "" ",") two piles. another item another item } Produces this list of

Re: [pollen] Highlighted blocks of code in pre tags wrapped in by decode-paragraphs

2019-03-11 Thread Matthew Butterick
> On Mar 11, 2019, at 2:48 AM, Evžen Wybitul wrote: > > The `decode-pagaraphs` incorrectly wraps blocks of code in tags into > paragraphs. I'm using pygments, so within the the code is split into > various s, which I think is causing the problem. Simply seting > as block-tag didn't fix

Re: [pollen] Re: ◊(select …) function returns nothing, always.

2019-03-15 Thread Matthew Butterick
I recommend sorting this out in the REPL, and then moving back to the template. For instance, it should be possible to preview the result like so (where `doc` is imported from "your-source.poly.pm"): #lang racket (require pollen/core "your-source.poly.pm") (select 'line-image doc) Though as

Re: [pollen] Question about Pollen markup

2019-03-13 Thread Matthew Butterick
it elements (λ (e) > (equal? e "\n")])) > > On Sunday, March 10, 2019 at 8:22:40 PM UTC-5, Matthew Butterick wrote: > The curly-brace syntax is almost always preferable. Keep in mind that the > linebreaks are separated into their own elements (For more on this behavior &g

Re: [pollen] Getting the first N words: speed comparison

2019-03-21 Thread Matthew Butterick
As a Racket rule of thumb, I find that most efforts toward "custom-built loops" end in defeat, because the Racket macro expander and JIT compiler are aware of better optimizations. If I were writing another book on Racket, it would be High-Performance Racket, which I know more about than I used

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

2019-02-14 Thread Matthew Butterick
refix-in nextChapter: fileName)) ; > ◊nextChapter:doc > ) > fileList) > > > I know this is probably terrible cringeworthy code but I don't know racket so > well. Any help would be greatly appreciated. Thank you. > > On Sunday, September 24, 2017 at 3:53:34 PM UTC-4, Mat

Re: [pollen] Re: Source files in multiple directories and generating an index

2019-02-19 Thread Matthew Butterick
What is your `raco pollen version`? > On Feb 19, 2019, at 3:56 PM, Evžen Wybitul wrote: > > Even with the new fix the relative paths don't work. I'm getting the > following error: > > find-relative-path: contract violation > expected: (and/c path-for-some-system? simple-form?) > given:

Re: [pollen] Re: Source files in multiple directories and generating an index

2019-02-19 Thread Matthew Butterick
The revision with the bugfix is 1.5.2028.835. > On Feb 19, 2019, at 4:01 PM, Evžen Wybitul wrote: > > It says 1.5.1987.839 > > Dne středa 20. února 2019 1:00:33 UTC+1 Matthew Butterick napsal(a): > What is your `raco pollen version`? -- You received this message because

Re: [pollen] Source files in multiple directories and generating an index

2019-02-19 Thread Matthew Butterick
(FWIW I cannot reproduce your bug with 1.5.2028.835) > On Feb 19, 2019, at 4:02 PM, Matthew Butterick wrote: > > The revision with the bugfix is 1.5.2028.835. > > >> On Feb 19, 2019, at 4:01 PM, Evžen Wybitul > <mailto:wybitul.ev...@gmail.com>> wrote: >&

Re: [pollen] Writing in raw X-expressions

2019-04-06 Thread Matthew Butterick
> On Apr 6, 2019, at 4:00 PM, Daniel Sockwell wrote: > > I have a quick question: is it possible to use Pollen to write x-expressions > directly? That is, can I directly write > >'(root "I want to attend " (em "RacketCon " (strong "this") " year") ".") > > instead of > >#lang pollen

Re: [pollen] Semantic markup in generated X-expression?

2019-04-12 Thread Matthew Butterick
OK, then suppose you store the attributes in the X-expressions for the purposes of your internal Pollen processing. You can always strip out those private attributes before the `doc` is injected into the HTML template. Does that work? You're right that the X-expression closely models HTML

Re: [pollen] Semantic markup in generated X-expression?

2019-04-12 Thread Matthew Butterick
You could preserve the semantic information inside a `class` attribute, or custom attribute. These would also be reachable through CSS selectors, if you're into that. > On Apr 12, 2019, at 7:51 AM, Daniel Sockwell wrote: > > In general, my intuition is that the semantics should be preserved

Re: [pollen] Newbie Question about Rendering from Author Mode

2019-05-17 Thread Matthew Butterick
Looks like you put an incorrect "pp" extension on those source files. The first one needs to be named "downtown.html.pmd" and the other "uptown.html.pm". > On May 17, 2019, at 10:52 AM, Eugene Wallingford wrote: > > I am new to Pollen and just working through the Quick Tour. Everything

Re: [pollen] Citation system update

2019-05-27 Thread Matthew Butterick
Looks cool! You should turn this into an installable Racket package with docs & tests, perhaps? I'm sure others would benefit from your suffering. > On May 27, 2019, at 12:06 PM, sanc...@gmail.com wrote: > > Joel and I each shared our approaches to footnotes a while back >

Re: [pollen] A few questions about pollen capabilities

2019-05-27 Thread Matthew Butterick
> On May 27, 2019, at 3:20 PM, Joel McCracken wrote: > > I suppose I might be able to do that, but I don't think it will solve my > overall problem. `pollen.rkt` gets loaded/computed repeatedly, once per page, > so it would lose context between pages. I would then have to re-compute it, >

Re: [pollen] A few questions about pollen capabilities

2019-05-27 Thread Matthew Butterick
> On May 27, 2019, at 5:24 PM, Joel McCracken wrote: > > The point is I was hoping to avoid having to rebuild the entire links table > every time I process another file. Here's a perhaps simpler way to do it that you could customize further. The Pollen sources define metas for each target

[pollen] better meta values?

2019-05-29 Thread Matthew Butterick
tl;dr 1) Would it be useful to allow meta values to be expressions, not merely datums? 2) Is anyone using identifiers or lists as meta values? Mostly my impression is that they're usually strings, numbers, or booleans (whose meaning wouldn't change with this upgrade). I was thinking that it

[pollen] Re: parallel rendering fixes

2019-06-13 Thread Matthew Butterick
I'm afraid the parallel-processing problem is going to require more scrutiny about how it can be done safely. For the time being I've disabled parallel processing (you can still ask for `raco pollen render -p`, but it won't be parallel). > On Jun 13, 2019, at 7:33 PM, Matthew Butterick wr

  1   2   >