All Projects β†’ viblo-asia β†’ sdk-js

viblo-asia / sdk-js

Licence: other
Viblo Javascript SDK

Programming Languages

typescript
32286 projects
SCSS
7915 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to sdk-js

MinifyAllCli
πŸ“¦ A lightweight, simple and easy npm tool to π—Ίπ—Άπ—»π—Άπ—³π˜† JSON/C, HTML and CSS! Also known as MinifyAll core! ⭐ Usable as π‘ͺ𝑳𝑰 tool or π’Šπ’Žπ’‘π’π’“π’•π’‚π’ƒπ’π’† in TS/JS as a 𝑴𝑢𝑫𝑼𝑳𝑬 πŸ₯°
Stars: ✭ 21 (+23.53%)
Mutual labels:  npm-package
nba-stats-client
πŸ€ JavaScript Client for stats from NBA.com
Stars: ✭ 29 (+70.59%)
Mutual labels:  npm-package
ansicolor
A JavaScript ANSI color/style management. ANSI parsing. ANSI to CSS. Small, clean, no dependencies.
Stars: ✭ 91 (+435.29%)
Mutual labels:  npm-package
micro-signals
A tiny typed messaging system inspired by js-signals that uses ES2015 sets
Stars: ✭ 39 (+129.41%)
Mutual labels:  npm-package
ugql
πŸš€GraphQL.js over HTTP with uWebSockets.js
Stars: ✭ 27 (+58.82%)
Mutual labels:  npm-package
js-mdict
*.mdx/*.mdd interpreter js implements
Stars: ✭ 91 (+435.29%)
Mutual labels:  npm-package
intersection-wasm
Mesh-Mesh and Triangle-Triangle Intersection tests based on the algorithm by Tomas Akenine-MΓΆller
Stars: ✭ 17 (+0%)
Mutual labels:  npm-package
youtube-playlist
❄️ Extract links, ids, and names from a youtube playlist
Stars: ✭ 73 (+329.41%)
Mutual labels:  npm-package
eslint-plugin-todo-plz
Enforce consistent and maintainable TODO comments
Stars: ✭ 19 (+11.76%)
Mutual labels:  npm-package
djb2a
DJB2a non-cryptographic hash function
Stars: ✭ 31 (+82.35%)
Mutual labels:  npm-package
stimulus-content-loader
A Stimulus controller to asynchronously load HTML from an url.
Stars: ✭ 39 (+129.41%)
Mutual labels:  npm-package
2018-package-three-webpack-plugin
[ARCHIVED] Webpack plugin to use Three.js "examples" classes
Stars: ✭ 45 (+164.71%)
Mutual labels:  npm-package
hydra-js
DOES NOT WORK WITH VERSIONS > 0.10.0 - A simple library to help you build node-based identity providers that work with Hydra.
Stars: ✭ 17 (+0%)
Mutual labels:  npm-package
node-reactive-postgres
Reactive queries for PostgreSQL
Stars: ✭ 28 (+64.71%)
Mutual labels:  npm-package
fadable
Fade in elements as they move into view, at both the bottom and top of the viewport.
Stars: ✭ 16 (-5.88%)
Mutual labels:  npm-package
arcscord
A Discord library written in typescript
Stars: ✭ 18 (+5.88%)
Mutual labels:  npm-package
eslint-plugin-vue-scoped-css
ESLint plugin for Scoped CSS in Vue.js
Stars: ✭ 58 (+241.18%)
Mutual labels:  npm-package
front-matter-manipulator
A utility for parsing and manipulating documents with Front Matter
Stars: ✭ 25 (+47.06%)
Mutual labels:  npm-package
react-microsoft-login
Microsoft services authorization with React.
Stars: ✭ 65 (+282.35%)
Mutual labels:  npm-package
npmlint
[DEPRECATED] Lint your npm package
Stars: ✭ 57 (+235.29%)
Mutual labels:  npm-package

Viblo Javascript SDK

Build Status npm version


Installing

npm install --save viblo-sdk

Basic usage

Markdown

Create folder libs include file markdown.js (libs/markdown.js)

import { createRenderer } from 'viblo-sdk/markdown';

const md = createRenderer({
  baseURL: 'http://localhost:3000',
  absoluteURL: false,
  embed: {
    wrapperClass: 'embed-responsive embed-responsive-16by9',
    iframeClass: 'embed-responsive-item',
  },
  katex: {
    maxSize: 500,
    maxExpand: 100,
    maxCharacter: 1000,
  },
});

export default md;

Reactjs:

Create components index.js (components/Markdown/index.js)

import React from 'react';
import PropTypes from 'prop-types'
import md from './libs/markdown';

const Markdown = ({ markdown }) => {
  const rawHtml = md.render(markdown);

  return (
    <div className="md-contents" dangerouslySetInnerHTML={{ __html: rawHtml }} />
  );
}

Markdown.propTypes = {
  markdown: PropTypes.string,
}

Markdown.defaultProps = {
  markdown: '',
}

export default Markdown;

Create page index.js

import Markdown from './components/Markdown'

const Preview = () => {
  return (
    <Markdown markdown={'This is content markdown'} />
  );
}

export default Preview;

Vuejs:

Create components Mardown.vue (components/Mardown.vue)

<template>
    <div v-html="html"/>
</template>

<script>
    import md from './libs/markdown';

    export default {
        props: {
            content: {
                type: String,
                required: true,
            },
        },

        computed: {
            html() {
                return md.render(this.content);
            },
        },
    };
</script>

Create page index.vue

<template>
   <Markdown :content={'This is content markdown'} />
</template>
<script>
    import Markdown from './components/Markdown.vue'

    export default {
        components: {
            Markdown,
        }
    }
</script

Echo

import cookies from 'axios/lib/helpers/cookies'
import { newConnection as newEchoConnection } from 'viblo-sdk/echo'

let options = {
    host: '/',
    csrfToken: cookies.read('XSRF-TOKEN'),
}

export default newEchoConnection(options)

API

// api for comments
import { ... } from 'viblo-sdk/api/comments'

// api for me
import { ... } from 'viblo-sdk/api/me'

// api for users
import { ... } from 'viblo-sdk/api/users'

// api for answers
import { ... } from 'viblo-sdk/api/answers'

...

How to use Viblo Markdown Syntax?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].