Pollen pmd does not read pollen.rkt?

I would have asked at the Pollen repository, but I see no sign-up button there.

When I create a filename.poly.pmd file, I seem unable to write a pollen.rkt file to redefine tags. I wanted to do this in order to write Markdown and then output it as both HTML and LaTeX/PDF by writing a series of rules such as the following:

(define (p . elements)
  (case (current-poly-target)
    [(ltx pdf) (apply string-append `("" ,@elements "\\par "))]
    [else `(p ,@elements)]))

(define (a attrs . elements)
  (case (current-poly-target)
    [(ltx pdf) (apply string-append `( "\\href{" ,(assoc 'href attrs) "}{" ,@(filter string? elements) "}"))]
    [else `(a ,attrs ,@elements)]))

(define (strong . elements)
  (case (current-poly-target)
    [(ltx pdf) (apply string-append `( "\\textbf{" ,@(filter string? elements) "}"))]
    [else `(strong ,@elements)]))


I don’t know if this is by design, a bug, or something I did wrong; I appreciate any comments.

Hard to say without seeing the whole pollen.rkt file. Did you provide your tags?

Yeah, I provided (all-defined-out). I’ll pastebin all the files in the next comment, which I’m making separate since I think there’s a chance of temporary issues with the Discourse spam filter.

The full pollen.rkt file is here; this SEO-guide.poly.pmd file output as if everything after the ; BEGIN TAGS comment were not there, but taking the X-expression that it output (to the txt file) to create a makeshift SEO-guide.poly.pm file was able to get the right substitutions for ltx output. (Here’s the LTX template.)

Edit, since the topic was closed: I thought it was clear that the AI-written “SEO guide” was just dummy text. I can at least use Pollen to write Markdown and output PDF by using this workflow – i.e., using the generated X-expression as the basis for a .pm file – but it seemed to me like it would be more useful if it worked like how I initially thought it did. Anyway, thank you for the attention.

In pollen/markdown, (or pmd files) the Markdown parsing happens after all the tag functions are evaluated.

Whereas in your project, you want the Markdown parsing to happen first and then the tag functions to be applied. I’m afraid that’s not the order of operations.

Beyond that, I’m going to close this topic. I can’t offer free support for enhancing SEO guides or AI-generated material.