A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/markdown-table-prettify below:

markdown-table-prettify - npm

Markdown table prettifier

Makes tables more readable for humans. Compatible with the Markdown writer plugin's table formatter feature in Atom.

Feature highlights Visual Studio Code

The extension is available for markdown language mode. It can either prettify a selection (Format Selection) or the entire document (Format Document). A VSCode command called Prettify markdown tables is also available to format the currently opened document.

Configurable settings: NPM

The core formatting logic is available as an NPM package: npm install --save markdown-table-prettify. The Typescript code is compiled down to ES5 and shipped inside the package.

It currently exposes the entry point also used by the CLI. It can be used from regular NodeJS or web apps:

import { CliPrettify } from 'markdown-table-prettify';
// or
const { CliPrettify } = require('markdown-table-prettify');

console.log(CliPrettify.prettify(
`hello|world
-|-
foo|bar`));
/* Output:
hello | world
------|------
foo   | bar
*/

// specifying a column padding
console.log(CliPrettify.prettify(
`hello|world
-|-
foo|bar`, { columnPadding: 1 }));
/* Output:
 hello  |  world
 ------ | ------
 foo    |  bar
*/
Docker & CLI

The core formatting logic is available as a node docker image: docker pull darkriszty/prettify-md or as a stand alone CLI tool.

Formatting files or checking if they're already formatted is also possible from the command line without docker. This requires node and npm (optionally also npx).

Feature Docker CLI Prettify a file docker container run -i darkriszty/prettify-md < input.md npm run --silent prettify-md < input.md Prettify a file and save the output docker container run -i darkriszty/prettify-md < input.md > output.md npm run --silent prettify-md < input.md > output.md Check whether a file is pretty or not docker container run -i darkriszty/prettify-md --check < input.md npm run --silent check-md < input.md Use 1 as column padding docker container run -i darkriszty/prettify-md --columnPadding=1 < input.md npm run --silent prettify-md -- --columnPadding=1 < input.md

Notes:

Installation

To access the CLI, the extension can either be used from the Github sources, from the already installed VSCode extension or from NPM.

Compiling from the source code Using the already installed VSCode extension

Locate the installed extension path. The typical location of the installed extension:

Getting it from NPM

Install the NPM package npm install -g markdown-table-prettify.

Known Issues

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4