[英]How do I, programmatically and from inside of a macro, obtain the fully rendered version of a page the macro is included in?
I'm looking to write a moinmoin macro which performs some processing on the fully rendered version of a page (maybe this is best achieved with an action instead? I'm new to moinmoin and uncertain of the best approach). 我希望编写一个moinmoin宏,该宏在页面的完全呈现版本上执行一些处理(也许最好通过操作来实现?我对moinmoin并不陌生,并且不确定最佳方法)。
Is there an easy way for me to obtain the fully rendered version of the moinmoin page the macro is included in? 我是否可以通过一种简单的方法来获取包含宏的moinmoin页面的完整渲染版本?
It seems the request object has some properties which are close (such as page and data), but not the final results 似乎请求对象具有一些接近的属性(例如页面和数据),但没有最终结果
You can't. 你不能
I can't think of any macro language that allows you to do this, and in fact, I can't see how it would be even possible to do, as it would trigger infinite recursion. 我想不出任何允许您执行此操作的宏语言,实际上,我什至看不到怎么可能做,因为它会触发无限递归。 Neither can I see any reason to do it.
我也看不出有任何理由这样做。
If you want to process the fully rendered page, you need to do that after the page has been rendered, not from inside a macro. 如果要处理完全渲染的页面,则需要在渲染页面后执行此操作,而不是从宏内部进行。 I don't know which the best way to do that with MoinMoin is.
我不知道使用MoinMoin的最佳方法是哪种。 Perhaps a WSGI middleware, assuming you run it with WSGI.
假设您是使用WSGI运行的,则可能是WSGI中间件。
It also depends on what processing you want to do. 它还取决于您要执行的处理。 Diazo is a pretty awesome way to skin sites for example.
例如,重氮是一种非常棒的护肤方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.