近几篇技术文章所贴的代码都有词法高亮的效果。这是用了我近期写的一个源代码转HTML的工具:SourceTo。它可以生成各种语言的词法高亮文件,然后根据该词法文件将源代码转成HTML文件。
现在将它发布出来,给大家使用。
下面是几种语言源代码的高亮效果:
1 Delphi
type
TForm1=class(TForm)
Button1:TButton;
procedureButton1Click(Sender:TObject);
private
FTest:string;
public
propertyTest:stringreadFTestwriteFTest;
end;
var
Form1:TForm1;
implementation
{$R*.dfm}
procedureTForm1.Button1Click(Sender:TObject);
begin
(*这是一个例子,
测试语言高亮的*)
//结果怎么样,还行吧。
Test:='Resultis:';
Test:=Test+IntToStr($3DFC)+IntToStr(20);
end;
<chmetcnv w:st="on" unitname="C" sourcevalue="2" hasspace="True" negative="False" numbertype="1" tcsc="0"><span lang="EN-US" style='FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: "Courier New"; mso-font-kerning: 0pt'>2 C</span></chmetcnv>++
#include"DialogControl.h"
#include"CoolDialogBar.h"
voidCCoolDialogBar::OnNcLButtonDblClk(UINTnHitTest,CPointpoint)
{
//TODO:Addyourmessagehandlercodehereand/orcalldefault
if((m_pDockBar!=NULL)&&(nHitTest==HTCAPTION))
{
//toggledocking
ASSERT(m_pDockContext!=NULL);
m_pDockContext->ToggleDocking();
}
else
{
CWnd::OnNcLButtonDblClk(nHitTest,point);
}
}
3 XML
<?xmlversion="1.0"?>
<SourceToConfig>
<中国Value="zh">中国</中国>
<AccidenceFiles>
<AccidenceFileName="Delphi"FilePath="Accidencefile\Delphi.xml"/>
<AccidenceFileName="C++"FilePath="Accidencefile\C++.xml"/>
<AccidenceFileName="CSharp"FilePath="Accidencefile\CSharp.xml"/>
<AccidenceFileName="VB"FilePath="Accidencefile\VB.xml"/>
<AccidenceFileName="XML_HTML"FilePath="Accidencefile\XML.xml"/>
</AccidenceFiles>
</SourceToConfig>
效果还可以吧。想让你文章中的代码多一点色彩吗,马上下载SourceTo用用看吧。相信它会成为你的好帮手的。
下载方式1:
http://pickup.mofile.com/cn/index.do
提取码是:9609567997642245
下载方式2:
http://www.dvpx.com/upload/setup.rar
我会对这个工具持续提供维护和升级,使它更加易用强大。
大家用后,如果有Bug,或者有什么更好的建议,请在留言中提出。
分享到:
相关推荐
淘宝开放平台TOP,官方发布的最新java版SDK,2020年7月更新,如需要其他版本请留言,等待上传。
SourceCounter(源代码统计精灵) 1.0.1.0 版 !- Boom 2005-11-26 + 实现对 Basic 代码的统计 + 实现对 C++/Java/Pascal 代码的统计 SourceCounter(源代码统计精灵) 0.9.1.0 版 !- Boom 2005-11-24 主要功能和...
SourceCounter(源代码统计精灵) 1.0.1.0 版 !- Boom 2005-11-26 + 实现对 Basic 代码的统计 + 实现对 C++/Java/Pascal 代码的统计 SourceCounter(源代码统计精灵) 0.9.1.0 版 !- Boom 2005-11-24 主要功能和...
此外,文档中的任何内容不得被复制、分发、重新发布、下载、展示、发布或传输。文档按“原样”提供,没有任何形式的保证,Xilinx公司对任何间接、特殊、偶发性、示范性或结果性损害,包括数据丢失或利润损失,不承担...
第一次发布程序时要做的事。 1、在已开发完成的程序中,在第一个启动的窗体上,放一个TauAutoUpgrader控件。 2.双击auAutoUpgrader1,在弹出的对话框中做以下设置: (1)选择ByNumer,按版本号检查更新,在Numer...
- **2006年**: OpenCV 1.0发布,增加了对Mac OS的支持。 - **2009年**: 发布了OpenCV 1.2和2.0版本,引入了C++接口和多项新特性。 - **2011年**: OpenCV 2.3发布,新增了stitching拼接模块,并改善了Android支持。 -...
- **1994年**:Python 1.0发布,引入了函数式编程工具,进一步完善了语言的功能。 - **2000年**:Python 2.0发布,引入了列表推导式和垃圾回收机制,使程序更加高效。 - **2008年**:Python 3.0发布,这是一个重大的...
source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) options.encoding "UTF-8" options.charSet 'UTF-8' options.author true ...
源代码放在 Mtdap3-Rtc-Totalflow 工程中,编译后的包为 Mtdap3-Rtc-Totalflow-1.0.jar,放在默认的 target 目录下。该包只包括应用程序,所依赖的 jar 文件全部取自 $FLINK_HOME/lib。 六、Flink 集群启动 Flink ...
Learning to Guide Random Search Ozan Sener, Vladlen Koltun International Conference on Learning Representations (ICLR) 2020 实验框架基于并扩展了的实现。 源代码是根据MIT许可证发布的。 有关详细信息,...
Cute Editor allows developers to set the image directory, set the controls width, disable image uploading and deleting, restrict access to the source/preview tabs, hide buttons and lists that you don'...
Struts——an open-source MVC implementation This article introduces Struts, a Model-View-Controller implementation that uses servlets and JavaServer Pages (JSP) technology. Struts can help you control...
Ver 1.05.12 UenuProbe PHP探针Ver1.0发布。 Ver 0.04.08 UenuProbe PHP探针测试版本完成。 ******************************************************************************* 程序下载 ...
Ver 1.05.12 UenuProbe PHP探针Ver1.0发布。 Ver 0.04.08 UenuProbe PHP探针测试版本完成。 ******************************************************************************* 程序下载 ...
set the controls width, disable image uploading and deleting, restrict access to the source/preview tabs, hide buttons and lists that you don't want your clients to see or access. 支持...
Ver 1.05.12 UenuProbe PHP探针Ver1.0发布。 Ver 0.04.08 UenuProbe PHP探针测试版本完成。 ******************************************************************************* Copyright Uenu.Com(优艺国际)
用于无监督域自适应的域白化转换(CVPR 2019) 于2019年6月在加利福尼亚... python resnet50_dwt_mec_officehome.py --s_dset_path path-to-source-dataset-folder --t_dset_path path-to-target-dataset folder --re
定义规则:`[Router1-acl-basic-2000] rule permit source 192.168.1.0 0.0.0.255`; 3. 应用ACL到接口:`[Router1] interface Ethernet0/0`;`[Router1-Ethernet0/0] acl inbound 2000`; 4. 验证ACL应用情况:`...