Issue #2 resolved

Let once_ macros see page contents

Justin Forest avatarJustin Forest created an issue

Macros aren't currently able to generate RSS with page contents. This is because the Markdown syntax is processed after the macros are executed.

I propose a patch which processes the contents after building the list of pages, but before calling the macros. This way when a page is being transformed to HTML, we already have the list of pages (in case some inline python code needs it). The HTML code is stored in the page list, so when the once_ macros are called afterwards, they have access to it.

Comments (5)

  1. Oben Sonne
    • changed status to open

    Yes, I see your point. On the other hand one might explicitly favor the current behavior. For instance in one of my Poole projects I use the once macros to edit and set page attributes which are used by inlined Python code. That would fail if the once macros are processed after inlined Python code.

    To meet both requirements, we need different types of once macros: pre and post. Current once macros actually are pre macros, yours are post macros.

  2. Oben Sonne

    Looks good. I've taken your changes and did some polish. Please see the attached patch. If you agree, I'll apply it to the main branch. I did not yet tested it, so if you could do that .. great, thanks!

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.