1.0.0 • Published 5 years ago

codingo v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

Codingo

Codingo is a javascript library which is used for coloring the code.

Installation

Use npm to install codingo

npm i codingo

Usage

To know, how does codingo work follow the following steps:

  1. Create an index.html file an write these codes
<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>codingo_example</title>
    <link rel="stylesheet" href="_style_.css">
  </head>
  <body>
    <div class="_myCodes_"></div>
    <script type="text/javascript" src="main.js"></script>
  </body>
</html>
  1. Create a main.js file and write these codes
const {codingo} = require('codingo');
codingo({
  code:['var', 'me', '=', "'codingo'", ';','>>',
        'console','.', 'log', '(me)', ';','>>',
     '// It is an example']
},'._myCodes_');
  1. Create a style.css file and write these codes
body {
    font-family: monospace;
    font-size: 20px;
    background-color: rgb(40, 44, 52);
}
.keyword {
    color: rgb(198, 120, 221);
}
.text {
    color: rgb(171, 178, 191);
}
.string {
    color: rgb(152, 195, 121);
}
.object, .property {
    color: rgb(224, 108, 117);
}
.operator {
    color: rgb(86, 182, 194);
}
.number {
    color: rgb(209, 154, 102);
}
.method {
    color: rgb(97, 175, 239);
}
._myCodes_{
    border: 2px solid grey;
    padding: 20px;
    border-radius:5px;
    background-color:rgba(45, 45, 45, 0.68);
}
.comment {
    color: rgb(92, 99, 112);
}
  1. Once you have followed these steps execute the index.html file using node.
  • you will get the following result.

result

1.0.0

5 years ago