New way to combine klipse with org-modesteemCreated with Sketch.

in org-mode •  6 years ago  (edited)

Wrote one
https://steemit.com/common-lisp/@sundawning/use-klipse-in-org-mode
, but the method is very limited, and it can not be closely combined with the original org-mode, but it is not entirely useless. There are still merits, so this article is relative to the previous article. Say it is a new way.

The new method can be easily implemented in org-mode to export code block that klipse can handle. This method is so intuitive that I didn't find it at first.

Step-by-step implementation:

  1. Create a block of code in the "your-language" language
    #+BEGIN_SRC your-language
    (print "hello")
    #+END_SRC
    
  2. Add the language class in the klipse configuration
    Selector_eval_clisp: '.src-your-language',
    

When an org file is converted to HTML, the src prefix is ​​added to the class name of the code block, stitched into "src-your-language", and klipse can correctly process the formatted code block.

The full content of the org file is like:

#+BEGIN_SRC your-language
(print "hello")
#+END_SRC

#+BEGIN_HTML
<link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css">
<script>
window.klipse_settings = {
    codemirror_options_in: {
        lineWrapping: true,
        autoCloseBrackets: true
    },
    codemirror_options_out: {
        lineWrapping: true
    },
    beautify_strings: true,
    selector_eval_clisp: '.src-your-language',
};
</script>
<script src="https://storage.googleapis.com/app.klipse.tech/plugin_prod/js/klipse_plugin.min.js?v=7.4.0">
</script>
#+END_HTML
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!