html转换成keynote,keynote代码高亮【转】
碼農(nóng)即使做ppt,也離不開代碼,在keynote下,如果要粘貼代碼,如何做到語法高亮呢?
補(bǔ)充1,該功能由pygments提供支持,所以支持的語言見:http://pygments.org/languages/
補(bǔ)充2,下文中的直接轉(zhuǎn)化剪貼板里的內(nèi)容,設(shè)置語言為-S py,其中py的意思是如果這段代碼存成文件的話,應(yīng)該是.py,所以,如果你想要貼一段objective-c的代碼,顯然就是-s m了。
原文和出處轉(zhuǎn)載如下,不另行翻譯了:
Do you want to display some code in a?Keynote?presentation?
It‘s easy. All you need is?Homebrew?installed.
First you need to install the program?highlight.
$ brew install highlight
So you have a piece of code. For example some Python code. The take that snippet of code and save it to a file like?code.py. Now all you need to do is run this:
$ highlight -O rtf code.py | pbcopy
Then, switch back into Keynote and simply paste.
But if you don‘t want to create a file of the snippet, simply copy the snippet from within your editor and run this:
$ pbpaste | highlight -S py -O rtf | pbcopy
The?-S py?means "syntax is py (for python)".
You can use?highlight?for a bunch of other things like creating HTML. See?man highlight?for more tips.
原文:http://www.cnblogs.com/walkerwang/p/3957144.html
總結(jié)
以上是生活随笔為你收集整理的html转换成keynote,keynote代码高亮【转】的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android 通过类名跳转activi
- 下一篇: html 不同字数对齐,表单短标题不同字