本文介绍了如何在IPython对话框中编写html?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在IPython Dialog中将html写为html(而不是HTML String)?
How can I write html as html (not as HTML String) inside IPython Dialog?
例如:我有一个显示对话框的Ipython UI扩展
For example: I have a Ipython UI Extension that shows a Dialog box
require(
["base/js/dialog"],
function(dialog) {
dialog.modal({
title: 'Hello world',
body: ?? ,
buttons: {
'schedule': {}
}
});
}
);
现在在对话框的正文中,我想显示以下HTML内容。
Now inside body of the dialog box, I want to show following HTML content.
<label>Quick Schedule</label><br />
<a class="btn btn-primary" onclick="schedule = '@reboot'; job_string();">Startup</a>
<a class="btn btn-primary" onclick="schedule = '@hourly'; job_string();">Hourly</a>
<a class="btn btn-primary" onclick="schedule = '@daily'; job_string();">Daily</a>
<a class="btn btn-primary" onclick="schedule = '@weekly'; job_string();">Weekly</a>
<a class="btn btn-primary" onclick="schedule = '@monthly'; job_string();">Monthly</a>
<a class="btn btn-primary" onclick="schedule = '@yearly'; job_string();">Yearly</a><br /><br />
<div class="row">
<div class="col-md-2">Minute</div>
<div class="col-md-2">Hour</div>
<div class="col-md-2">Day</div>
<div class="col-md-2">Month</div>
<div class="col-md-2">Week</div>
</div>
<div class="row">
<div class="col-md-2"><input type="text" class="form-control" id="job-minute" value="*" onclick="this.select();"/></div>
<div class="col-md-2"><input type="text" class="form-control" id="job-hour" value="*" onclick="this.select();"/></div>
<div class="col-md-2"><input type="text" class="form-control" id="job-day" value="*" onclick="this.select();"/></div>
<div class="col-md-2"><input type="text" class="form-control" id="job-month" value="*" onclick="this.select();"/></div>
<div class="col-md-2"><input type="text" class="form-control" id="job-week" value="*" onclick="this.select();"/></div>
<div class="col-md-2"><a class="btn btn-primary" onclick="set_schedule();">Set</a></div>
</div>
如何显示此HTML内容?这里的领导真的很感激吗?
How can I show this HTML content? Lead here is really appreciated?
推荐答案
请参阅
提示:为Jupyter Lab编写扩展,而不是支持编写Typescripts。
Tip: Write extensions for Jupyter Lab instead that supports writing Typescripts too.
这篇关于如何在IPython对话框中编写html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!