技术博客中的格式代码 [英] format code in technical blog

查看:68
本文介绍了技术博客中的格式代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从技术博客提交了文章,一切都在那里,我只需要将代码部分的格式设置为橙色/黄色即可.但是我在编辑部分看不到这样做的方法.有任何想法吗?谢谢.

I submitted my article from the technical blog, everything is there and I just need to format the code section to be orange/yellow. But I don''t see a way of doing it in the editing sections. Any ideas? Thank you.

推荐答案

将代码夹在标签上< pre lang ="???"/> 包装在PRE块中"使它自动化.请小心使用尖括号,并使用HTML实体& lt;将其转义. & gt;使用允许HTML"时.另一个常见的错误是滥用忽略文本中的HTML(对代码段有用)"-在发布前取消选中它.
另一个常见的问题是包装.您应确保在编辑控件的右边界没有包装较长的代码.如果遵守此规则,则认为源代码行是合理的短.

我只概述了如何避免最常见的错误.

另请参见: http://www.codeproject.com/info/Submit.aspx [
-SA
Sandwich the code with tag <pre lang="???"/> "Wrap in PRE block" automates it. Be careful using angular brackets, escape them with HTML entities &lt; &gt; when using "allow HTML". Another common mistake is misusing "Ignore HTML in text (good for code snippets)" — un-check it before posting.
Another common problem is wrapping. You should make sure long lines of the code is not wrapped at the right bound of the editing control. Is this rule is observed, source code lines are considered to be reasonable short.

I outlined only how to avoid most common mistakes.

See also: http://www.codeproject.com/info/Submit.aspx[^]. Not all delicate formatted aspects are described in this article. Basically, you need to understand CodeProject escaping and be well familiar with HTML formatting. Pay attention for the chapter "Syntax colourisation".

—SA


是否本文 [ ^ ]回答您所有写文章的问题吗? br/> 也许您想使用前置标记?
Does this article[^] give an answer to all your article writing questions?
Perhaps you want to use pre tags?


这篇关于技术博客中的格式代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆