Skip to content

Respo/respo-markdown.cljs

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Respo Markdown

Render Markdown subset to Respo DSL.

Demo http://repo.respo-mvc.org/respo-markdown/

Supported features:

  • Code block
  • Headers, h1, h2, h3, h4
  • Quoteblock
  • Unordered list
  • Inline code
  • Url
  • Inline link
  • Image link

Usage

Clojars Project

[respo/markdown "0.2.4"]
(respo-md.comp.md/comp-md-block "a\n" {})
; returns DSL
(respo-md.comp.md/comp-md "text inline")
; render inline DOM elements

For options {}, highlight.js is suggested:

{:highlight (fn [code lang]
   (let [result (.highlight hljs lang code)]
     (comment .log js/console "Result" result code lang js/hljs)
     (.-value result)))
 :style {}
 :css ".md-p {}"
 :class-name "demo"}

Write your own CSS to style the HTML:

.md-block {}

.md-span {}

.md-p {
  margin: 16px 0;
}

.md-code-block {
  color: white;
  background-color: hsl(300, 80%, 20%);
  padding: 8px;
  display: block;
  line-height: 1.5em;
}

Develop

Workflow https://github.com/mvc-works/calcit-workflow

License

MIT