Skip to content

A simple and minimalist comment system based on Leancloud.

License

Notifications You must be signed in to change notification settings

fossabot/MiniValine

Repository files navigation

MiniValine

version NPM GPL Licence npm downloads gzip-size FOSSA Status

Build Status Build Status Mergify Status codecov Codacy Badge DeepScan grade

MiniValine is a simple and minimalist comment system based on Leancloud


Live Demo

Awesome MiniValine

Features

Install

Two ways.

  • links
<script src="https://unpkg.com/minivaline/dist/MiniValine.min.js"></script>

<!-- or -->

<script src="https://cdn.jsdelivr.net/npm/minivaline/dist/MiniValine.min.js"></script>

<!-- or -->

<script src="https://cdn.jsdelivr.net/gh/MiniValine/MiniValine/dist/MiniValine.min.js"></script>
  • npm install
# Install minivaline
npm install minivaline --save
// Use import
import MiniValine from 'minivaline';
// or Use require
const MiniValine = require('minivaline');

new MiniValine({
    el:'#vcomments',
    // other config
})

Get App ID/App Key

Get App ID/App Key from LeanCloud
Click here to register or login in LeanCloud.
Click here Create new application in LeanCloud, and you will get appId/appKey.

Usage

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>MiniValine - A simple comment system based on Leancloud.</title>
    <!--Load js and insert it before </ body>-->
    <script src="https://unpkg.com/minivaline/dist/MiniValine.min.js"></script>
</head>
<body>
    <div class="comment"></div>
    <script>
      new MiniValine({
          el: '.comment',
          appId: 'Your App ID',
          appKey: 'Your Key',
          placeholder: 'Write a Comment O(∩_∩)O~~'
      });
    </script>
</body>
</html>

Options

  • el String

    Required. [object HTMLDivElement]

  • appId String

    Required. Your App ID

  • appKey String

    Required. Your App Key

  • placeholder String

    Input Placeholder

  • pathname String

    Default: location.pathname.replace(/\/$/, '')

    The pathname of the page.

  • adminEmailMd5 String

    The MD5 of Admin Email to show Admin Flag.

  • math Boolean or Number

    Default: true

    Options:

    • false or 0 Close MathJax.
    • true or 1 Support MathJax@2 initialization.
    • 2 Support MathJax@2 initialization.
    • 3 Support MathJax@3 initialization.

    The above is the initialization operation of integrating MathJax in MiniValine. If MathJax is loaded on the page, MiniValine will use the MathJax version on the page.

  • md Boolean

    Default: true

    Support Markdown.

  • lang String

    Default: navigator.language || navigator.userLanguage.

    Localization language key, en and zh-CN are currently available.

    More i18n info: minivaline-i18n

  • emoticonUrl String

    Default: 'https://cdn.jsdelivr.net/npm/alus'

    Expression Url.

  • maxNest Number

    Default: 3

    Nest size.

  • pageSize Number

    Default: 6

    Pagination size.

  • serverURLs String

    Default: http[s]://[tab/us].avoscloud.com

    This configuration is suitable for domestic custom domain name users, the overseas version will be automatically detected (no need to fill in manually).

ToDo

  • Extraction from the core library to reduce volume.

  • Project engineering

  • Component modularity

  • And more.

Feedback

Contributing

We welcome you to join the development of MiniValine. Please see contributing document. 🤗

Also, we welcome Issue or PR to MiniValine.

Contributors

contributors-image

Thanks

Powered by MathJax

License

GPL-3.0

FOSSA Status

About

A simple and minimalist comment system based on Leancloud.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published