Skip to content

cscottmills/ssb-markdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssb-markdown

render patchwork/ssb messages to markdown.

patchwork has a few changes from standard markdown.

  • emoji - everybody hearts emoji
  • ssb links - links to cryptographic objects see ssb-ref
  • mentions - @mentions like on twitter or github. mentions allow people to convieniently talk to each other, but are written as both the name used, plus the cryptographic reference.

api

var md = require('ssb-markdown')

md.block(source, { toUrl:, imageLink: })

Render raw markdown source to html. The output will be html content without a surrounding tag.

toUrl is a function which accepts an ssb-ref or @-mention string, and whether it is for an image or not, and returns a url string.

imageLink is a function which accepts an ssb-ref and will be used to generate links to wrap any images.

md.inline (source)

Render raw markdown to a single line of test, suitable for a one line preview that is opened to a view rendered with block.

License

MIT

About

patchwork's markdown parser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%