0.8.6 • Published 8 months ago

@mryhryki/markdown-preview v0.8.6

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

markdown-preview

Markdown realtime preview on browser with your favorite editor.

Concept

Demo

Usage

npx

$ npx @mryhryki/markdown-preview
Version        : v0.6.0
Root Directory : /current/dir
Default File   : README.md
Extensions     : md, markdown
Template File  : /path/to/template/default.html
Preview URL    : http://localhost:34567

npm / yarn (install)

$ npm install -g @mryhryki/markdown-preview
# or
$ yarn install -g @mryhryki/markdown-preview

$ markdown-preview
Version        : v0.6.0
Root Directory : /current/dir
Default File   : README.md
Extensions     : md, markdown
Template File  : /path/to/template/default-dark.html
Preview URL    : http://localhost:34567

Parameter

shortlongenvironment variableparameterrequireddefault
-f--fileMARKDOWN_PREVIEW_FILErelative file pathnoREADME.md
-e--extensionsMARKDOWN_PREVIEW_EXTENSIONScomma separated extensionsnomd,markdown
-t--templateMARKDOWN_PREVIEW_TEMPLATEdefined template name (1) or template file path (2)nodefault
-p--portMARKDOWN_PREVIEW_PORTport numberno34567
--log-levelMARKDOWN_PREVIEW_LOG_LEVELtrace, debug, infowarn, error, fatalnoinfo
--no-openerMARKDOWN_PREVIEW_NO_OPENERtrue (only env var)no
-v--versionno
-h--helpno

*1: Defined Template Names

  • default

*2: How to create a template file

You just need to load /markdown-preview-websocket.js and register a callback to connectMarkdownPreview.

A simple example code is below:

<!doctype html>
<html>
  <head>
    <title>Minimum Template Sample</title>
  </head>
  <body>
    <pre id="raw-markdown"></pre>
    <script type="module">
      import { connectMarkdownPreview } from "/markdown-preview-websocket.js";
      connectMarkdownPreview(({ markdown }) => {
        document.getElementById('raw-markdown').innerHTML =
          markdown.replace(/</g, '&lt;').replace(/>/g, '&gt;');
      });
    </script>
  </body>
</html>

Development

$ npm install

# Watch mode
$ npm run dev

# Build and Run
$ npm start

# Test
$ npm test
$ npm run test:watch

# Type check
$ npm run type
$ npm run type:watch

# Check code format
$ npm run lint

# Formatter
$ npm run fmt

Release

Run release workflow.

0.8.5

8 months ago

0.8.6

8 months ago

0.8.4

9 months ago

0.8.3

9 months ago

0.8.2

10 months ago

0.8.1

10 months ago

0.8.0

10 months ago

0.7.2

10 months ago

0.7.1

10 months ago

0.7.0

11 months ago

0.6.2

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.9

1 year ago

0.5.8

1 year ago

0.5.7

1 year ago

0.5.6

1 year ago

0.5.4

1 year ago

0.5.5

1 year ago

0.5.3

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.2

3 years ago

0.4.0

3 years ago

0.3.11

4 years ago

0.3.10

4 years ago

0.3.8

4 years ago