我想知道是否有人可以帮助我。我想将一些菜单项转换为Bootstrap约定;不幸的是,有超过1000行代码,我想自动实现它,而不是手动编辑整个文件。你觉得有可能吗?
原始代码如下:
<span class="header"><img src="images/icons/anicon.png" class="absmiddle" width="16" height="16" /> {$_thetitle}</span>
<ul class="menu">
<li><a href="anurl.php"><img src="images/icons/todolist.png" class="absmiddle" width="16" height="16" /> {$_sometextinhere}</a></li>
<li><a href="anurl.php?action=anaction"><img src="images/icons/anicon.png" class="absmiddle" width="16" height="16" /> {$_sometextinhere}</a></li>
<li><a href="anurl.php"><img src="images/icons/domains.png" class="absmiddle" width="16" height="16" /> {$_sometextinhere}</a></li>
<li><a href="#" onClick="showDialog('geninvoices');return false"><img src="images/icons/someicon.png" class="absmiddle" width="16" height="16" /> {$_sometextinhere}</a></li>
<li><a href="#" onClick="showDialog('cccapture');return false"><img src="images/icons/anothericon.png" class="absmiddle" width="16" height="16" /> {$_sometextinhere}</a></li>
</ul>
我需要将其转换为:
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<i class="fa fa-arrow-left"></i> {$_thetitle}
</h3>
</div>
<div class="list-group">
<a href="anurl.php" class="list-group-item">
<i class="fa fa-arrow-left fa-fw"></i> {$_sometextinhere}
</a>
<a href="anurl.php" class="list-group-item">
<i class="fa fa-arrow-left fa-fw"></i> {$_sometextinhere}
</a>
<a href="anurl.php?action=anaction" class="list-group-item">
<i class="fa fa-arrow-left fa-fw"></i> {$_sometextinhere}
</a>
<a href="#" onClick="showDialog('cccapture');return false" class="list-group-item">
<i class="fa fa-arrow-left fa-fw"></i> {$_sometextinhere}
</a>
<a href="#" onClick="showDialog('cccapture');return false" class="list-group-item">
<i class="fa fa-arrow-left fa-fw"></i> {$_sometextinhere}
</a>
</div>
font-awesome图标对于所有这些都可以是相同的,我可以稍后手动更改它们,但我当然需要摆脱标签,转换ul标签,并添加其他...你相信吗?没有太多人工干预就可以进行这种转变?
感谢您的建议。 此致