Coder Social home page Coder Social logo

github-readme-preview's Introduction

github-readme-preview

This is markdown file preview in GitHub makeup on localhost.
Supports for the dark and light themes of browser.

preview

Required

  • Node.js 16
  • Npm

Install

git clone https://github.com/webdiscus/github-readme-preview.git
cd github-readme-preview
npm install

Setup

Create/copy a markdown file, e.g. README.md, in the github-readme-preview/ directory or in any subdirectory.

Start preview in commandline

Run from the github-readme-preview/ directory:

npm run preview --file=path/to/markdown_file

The commandline argument --file is optional. Default file is README.md. The file extension .md can be omitted.

Now you can open this file in a code editor, change the file and save it. The browser will show the changes.

Stop preview

Press CTRL + C

Usage examples

Preview the ./README.md file:

npm run preview

Preview the ./CHANGELOG.md file:

npm run preview --file=CHANGELOG

Preview the ./docs/myMarkdownFile.md file:

npm run preview --file=docs/myMarkdownFile

Preview a file with absolute path, like /absolute/path/to/README.md:

npm run preview --file=/absolute/path/to/README

Switch dark / light themes

Open the browser settings and change browser theme to dark or light.

For example, in Firefox, open the address about:preferences.
On the settings site go to General > Language and Appearence > Web site appearence.
Then select theme: Light or Dark.

Syntax highlighting example

HTML

<!-- Comment -->
<div class="container">
  <p>Paragraph</p>
</div>

JavaScript

const arr = [1, 2, 'banana'];

⚠️ Limitation

Relative image path is not supported, use URL, e.g.:

![image](https://github.com/path/to/docs/image.png?raw=true "image")

github-readme-preview's People

Watchers

 avatar  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.