gpt4 book ai didi

blogger - SyntaxHighlighter 不适用于 Blogger 动态 View ?

转载 作者:行者123 更新时间:2023-12-02 15:12:44 26 4
gpt4 key购买 nike

目前我计划添加SyntaxHighlighter到我的 Blogger(动态 View )。但是网上的方法我都试过了还是不行,包括[1] [2] [3] [4] [5] [6] .

知道如何解决这个问题吗?或者为 Blogger 动态 View 建议的任何替代语法荧光笔?

最佳答案

首先确保您将此代码包含在您的头部:

<link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css">
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css">
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript">
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'/>
<script language='javascript'>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';
SyntaxHighlighter.all();
</script>

现在,每当您向博客文章添加代码(将它们添加到 pre 标签内)时,请在每个帖子的末尾添加此 javascript(您可以通过切换到博客帖子编辑器中的 HTML 选项卡来添加它)

<script type="text/javascript">
SyntaxHighlighter.highlight();
</script>

谢谢:)

关于blogger - SyntaxHighlighter 不适用于 Blogger 动态 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20800818/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com