简体   繁体   English

如何以编程方式并从宏内部获取包含宏的页面的完整呈现版本?

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

相关问题 如何使用 xlwings 从 Python 调用 Excel 宏? - How do I call an Excel macro from Python using xlwings? Python 初学者问题:如何从这组数据中获取范围(包括问题和尝试) - Python beginner question: How do I obtain a range from this set of data (question and attempt included) 如何使用Excel / VBA宏中的环境变量来进行Python安装? - How do I path to a Python install using an Environment Variable from within an Excel / VBA macro? 使用Python运行宏后如何保存Excel工作簿? - How do I save Excel Workbook after running macro with Python? 我如何编程一个宏,它将在网页游戏中为我完成点击? - How can I program a macro that will do the clicking for me in a web game? 如何从控制器传递用于Jinja宏的变量? - How can I pass a variable for a jinja macro from the controller? 如何使用Django将完全呈现的html页面转换为PDF - How to turn fully rendered html page using Django into PDF 我怎么知道页面真正满载? - How do I know a page is really fully loaded? 如何检测 web 页面是否从 Python 中的 Javascript 动态呈现? - How do I detect if a web page is rendered dynamically from Javascript in Python? 如何从 JavaScript 呈现的响应页面下载最高分辨率的图像? - How do I download the highest resolution image from a JavaScript rendered responsive page?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM