microcosm

一行代码,chrome变“编辑器” cool

  •  
  •   microcosm · Feb 14, 2013 · 4561 views
    This topic created in 4838 days ago, the information mentioned may be changed or developed.
    Jose 在CoderWall 分享的一个小技巧:在浏览器地址栏中输入一行代码:
    data:text/html, <html contenteditable> 回车即可把浏览器变临时编辑器。文字, 图片都可以

    jakeonrails 改成了一个支持 Ruby 代码高亮的编辑器
    https://gist.github.com/4666256

    如果把上面的 ace/mode/ruby 改成 ace/mode/python,那么就得到了一个 Python 版的编辑器咯。 改造成支持其他语言语法高亮的,可把 ace/mode/ruby 替换为:

    Python -> ace/mode/python
    C/C++ -> ace/mode/c_cpp
    Javscript -> ace/mode/javascript
    Java -> ace/mode/java
    Scala -> ace/mode/scala
    Markdown -> ace/mode/markdown
    CoffeeScript -> ace/mode/coffee
    其他……

    jakeonrails 语法高亮风格用的是 monokai。
    如果需要换成其他风格,,可把 ace/theme/monokai 替换为:

    Eclipse -> ace/theme/eclipse
    TextMate -> ace/theme/textmate

    firfox也可以啊,IE不知道可不可以???
    2 replies    1970-01-01 08:00:00 +08:00
    gracece
        1
    gracece  
       Feb 14, 2013
    http://www.v2ex.com/t/59345 貌似已经讨论过了
    microcosm
        2
    microcosm  
    OP
       Feb 14, 2013
    oh! 好久没来了,见笑了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2600 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 00:49 · PVG 08:49 · LAX 17:49 · JFK 20:49
    ♥ Do have faith in what you're doing.