Giter Site home page Giter Site logo

rich-message's Introduction

rich-message

Turn a plain message into a rich HTML message

npm travis

Install

npm install rich-message

Usage

var richMessage = require('rich-message')
var basicMessage = {
  text: 'hi maxogden', // text entered by a user
  username: 'mafintosh', // github username
  timestamp: Date.now()
}
var username = 'maxogden' // current user's github username (used for highlighting)

var output = richMessage(basicMessage, username)
// { text: 'hi maxogden',
//   username: 'mafintosh',
//   timestamp: 1458939703123,
//   anon: false,
//   avatar: 'https://github.com/mafintosh.png',
//   timeago: '2:01 PM',
//   html: '<div class="highlight"><p>hi maxogden</p><p></p></div>' }

This module is currently very tightly coupled with friends (sorry). If you'd like to help make it more usable for other projects, please fork and contribute!

Contributing

Contributions welcome! Please read the contributing guidelines first.

License

MIT

rich-message's People

Contributors

ungoldman avatar flet avatar feross avatar max-mapper avatar mafintosh avatar

Stargazers

 avatar Saad Shahd avatar Gokhan Celik avatar  avatar  avatar Jerzerak avatar Seggy Umboh avatar Yosh avatar MaX Falstein avatar Kyungwook, Park avatar Michael Anthony avatar  avatar Ben Evans avatar Lubomir Anastasov avatar Charlike Mike Reagent avatar  avatar Kyle Robinson Young avatar Bret Comnes avatar noa avatar  avatar

Watchers

 avatar Beau Gunderson avatar  avatar  avatar  avatar Kira Oakley avatar James Cloos avatar Calvin Metcalf avatar Michael Anthony avatar Dave Justice avatar Martin Ek avatar

rich-message's Issues

img and/or open graph parsing

From @derekr on April 28, 2015 4:23

Understandably not a desired feature, but I appreciate link/og parsing found in apps like slack and hipchat. Happy to work on it, but looking for some feedback on if this is wanted before I spend some time on it.

Copied from original issue: moose-team/friends#29

Prior Art

There has been a bit of plaintext projects in indieweb projects. Interested in prior art examples?

Escape HTML in urls

From @noffle on April 30, 2015 17:33

As is, entering something like the following, which was posted into #friends:

![Sorry guys](http://my.setale.me/image/052u2w2q3u3w/Schermata 2015-04-30 alle 19.09.21.png)

will fail because spaces aren't being translated into %20s.

Copied from original issue: moose-team/friends#86

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.