Giter Club home page Giter Club logo

readme-jsx's Introduction

LICENSE VERSION

README-JSX is a package that lets you write your README documentations in jsx, opening a multitude of new possibilities and oppurtinities to get creative. Not only that, but it also provides you with all the necessary components for writing traditional markdown without having to struggle with spacing and formatting...

NOTICE: This file was generated with this library, you can checkout the sourecode by viewing the README.jsx file

npm i --save-dev readme-jsx

// ./README.jsx
const React = require("react");
const { BADGE, metadata} = require("readme-jsx");

module.exports = (
  <React.Fragment>
    <BADGE 
    label="LICENSE" 
    message={metadata.license} 
    style="for-the-badge" 
    color="blue" />
  </React.Fragment>
)
// ./scripts/readme-gen.js
const { generateMD } = require("readme-jsx");
generateMD("./README.jsx").then(() => {
  console.log("README.md generated !");
  process.exit();
});
)

node ./scripts/readme-gen.js

LICENSE

// ./README.jsx
const React = require("react");
const { metadata} = require("readme-jsx");

const CustomHeader = ({ title, color }) => (
  <h1 className="custom-header" style={{ WebkitTextFillColor:color }}>{title}</h1>
)
module.exports = (
  <React.Fragment>
    <style>
    @import url('https://fonts.googleapis.com/css?family=Pacifico&display=swap');
    .custom-header{
      -webkit-text-stroke-width: 2px;
      -webkit-text-stroke-color: black;
       color:red;
      font-family: Pacifico;
      width: 880px;
      font-size: 3em;
      padding: 0px 0px 10px 10px;
      display: flex;
      margin: 0px;
      align-items: center;
    }
    </style>
    <CustomHeader title={metadata.name} color="yellow"/>
  </React.Fragment>
)
// ./scripts/readme-gen.js
const { generateMD } = require("readme-jsx");
generateMD("./README.jsx").then(() => {
  console.log("README.md generated !");
  process.exit();
});
)

node ./scripts/readme-gen.js

Component Props Description Example Preview
H1 A basic markdown header <H1>A header</H1> # A header
H2 A basic markdown header <H2>A header</H2> ## A header
H3 A basic markdown header <H3>A header</H3> ### A header
H4 A basic markdown header <H4>A header</H4> #### A header
H5 A basic markdown header <H5>A header</H5> ##### A header
H6 A basic markdown header <H6>A header</H6> ##### A header
ITALIC Turns text italic <ITALIC>Italic</ITALIC> Italic
BOLD Turns text bold <BOLD>Bold</BOLD> Bold
SCRATCH Strikes the text <SCRATCH>Scratched</SCRATCH> Scratched
BR A line break <BR/> Doesn't show inside a table
HR A horizontal line <HR/> ---
QUOTE A quote <QUOTE>A thought here</QUOTE> Doesn't show inside a table
OL list: { title: string, content: string[]}[] An ordered list <OL list={[{title: "First item", content: ["Lorem ipsum","Lorem ipsum"]}]} /> Doesn't show inside a table
UL list: { title: string, content: string[]}[] An unordered list <UL list={[{title: "First item", content: ["Lorem ipsum","Lorem ipsum"]}]} /> Doesn't show inside a table
CODE `inline: boolean lang: string` A code snippet <CODE lang="shell">{"npm i readme-jsx"}</CODE>
A href: string A link <A href="https://google.com">Click me</A> Click me
TASKS list: {title: string, done: boolean}[] A list of tasks <TASKS list={[{title: "Refactor", done: false}, {title: "Go to sleep", done: false}]} /> Doesn't show inside a table
COLLAPSIBLE title: string A collapsible aka accordion <COLLAPSIBLE title="Show the content">The content</COLLAPSIBLE>
Show the contentThe content
TABLE columns: string[]; rows: string[][]; A table, like this one <TABLE columns=["Fruit", "Color"] rows={[["Banana", "Yellow"],["Watermelon","Green"]]}/> Doesn't show inside a table
IMG src: string ; href: string ; alt: string An image <IMG src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cd/Nuvola_emblem-favorite.svg/800px-Nuvola_emblem-favorite.svg.png"/>
BADGE label: string; message: string; link: string; color: string; style: "plastic" or "flat" or "flat-square" or "for-the-badge" or "social"; logo: string; logoColor: string; labelColor: string; A custom badge <BADGE label="HELLO" message="WORLD" style="for-the-badge" color="orange" /> HELLO

Function Arguments Description Example
generateMD path: string, options: { linebreak: number; assetsDir: string; packagejson: string; } The function which generates the markdown file generateMD("./README.jsx").then(() => { console.log("README.md generated !"); process.exit(); });
importJSX path: string This function is used to import jsx files inside your README.jsx, since node does not support the JSX engine by default const importJSX = require("import-jsx"); const Button = importJSX("../components/Button.jsx");

Property Description Example
metadata An object which contains the list of metadata properties that can be parsed from the package.json file <BADGE label="LICENSE" message={metadata.license}/>

readme-jsx's People

Contributors

dependabot[bot] avatar solidsnail avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.