Git Product home page Git Product logo

hexo-kotlin-playground's Introduction

Hexo Kotlin Playground

使Hexo的CodeBlock支持Kotlin Playground

使用方法

安装
npm install hexo-kotlin-playground --save
启用插件

拷贝样例_config.yml内的内容至你的_config.yml

注意事项

  • 如果是由v1升级来的,注意用法已经不是首行注释了,而是tag,标签名为ktpg

  • 而且已经没有设置独立开关的地方了(除了总开关),要关闭就使用普通代码块

独立设置

  • 在tag参数列表里,设置在后面即可

    {% ktpg line-number=false auto-indent=4 %}
    //@playground enable line-number=false
    fun main(){
      println("Hello Kotlin")
    }
    {% endktpg %}

    支持 key | key=value | key='value' | key="value" 四种格式的设置 支持如下设置:

  • 支持使用别名来指定参数名

    如:
    version => data-version
    platform => data-target-platform
    readonly => data-highlight-only
    ...
    更多可以看SpecialConfigKey

    其他别名

  • 隐藏代码 在代码块中插入以//@hidestart,以//@hideend结尾的,即可隐藏这段代码块中间的内容 如:

    {% ktpg line-number=false auto-indent=4 %}
    fun main(){
      println(str)
    }
    //@hidestart
    val str = "Hello Kotlin"
    //@hideend
    {% endktpg %}
  • 仅显示代码 在代码块中插入以//sampleStart,以//sampleEnd结尾,即可只显示这块代码中间的内容 忽略此注释则使用代码块的none-markers属性 取消显示隐藏代码的按钮则设置代码块的属性folded-buttonfalse(folded-button=false)

    这部分和Kotlin Playground Customizing editors官方使用方法一样

hexo-kotlin-playground's People

Contributors

kairlec avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.