Skip to content

Commit

Permalink
Update Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkGriffiths committed Jul 17, 2020
1 parent 9310731 commit 648012f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 32 deletions.
10 changes: 5 additions & 5 deletions bin/truwrap
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ var getStdin = _interopDefault(require('get-stdin'));
var updateNotifier = _interopDefault(require('update-notifier'));
var commonTags = require('common-tags');
var string = require('@thebespokepixel/string');
var _merge = _interopDefault(require('lodash/merge'));
var trucolor = require('trucolor');
var deepAssign = _interopDefault(require('deep-assign'));
var path = require('path');
var terminalFeatures = _interopDefault(require('term-ng'));
var columnify = _interopDefault(require('columnify'));
Expand All @@ -26,7 +26,7 @@ var _split = _interopDefault(require('lodash/split'));
var _forEach = _interopDefault(require('lodash/forEach'));

const name = "truwrap";
const version = "2.0.2";
const version = "2.0.3";
const description = "Smarter terminal text wrapping (handles 24bit color)";
const author = "Mark Griffiths <mark@thebespokepixel.com> (http://thebespokepixel.com/)";
const main = "index.js";
Expand Down Expand Up @@ -211,14 +211,14 @@ var pkg = {
badges: badges
};

const clr = deepAssign(trucolor.simple({
const clr = _merge(trucolor.simple({
format: 'sgr'
}), trucolor.palette({
format: 'sgr'
}, {
}), {
bright: 'bold rgb(255,255,255)',
dark: '#333'
}));
});
const colorReplacer = new commonTags.TemplateTag(commonTags.replaceSubstitutionTransformer(/([a-zA-Z]+?)[:/|](.+)/, (match, colorName, content) => `${clr[colorName]}${content}${clr[colorName].out}`));

const tabRegex = /\t/g;
Expand Down
20 changes: 10 additions & 10 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8" />
<title>truwrap 2.0.2 | Documentation</title>
<title>truwrap 2.0.3 | Documentation</title>
<meta name='description' content='Smarter terminal text wrapping (handles 24bit color)'>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="assets/css/ace.min.css" rel="stylesheet">
Expand All @@ -15,7 +15,7 @@
<div id='split-left' class='overflow-auto fs0 height-viewport-100 sidebar'>
<div class='py1 px2'>
<h3 class="m0 no-anchor">truwrap</h3>
<div class="mb1"><code>2.0.2</code></div>
<div class="mb1"><code>2.0.3</code></div>
<input
placeholder="Filter"
id="filter-input"
Expand Down Expand Up @@ -220,7 +220,7 @@ <h3 class='left m0 panel-title' id='truwrap'>
</h3>


<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/c6b88b7540a9dfb28926cea12e733364d98ed92c/src/index.js#L50-L218'>
<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/93107316e86f7d437ce9a32d5b372b68636064cf/src/index.js#L50-L218'>
<span>src/index.js</span>
</a>

Expand Down Expand Up @@ -383,7 +383,7 @@ <h3 class='left m0 panel-title' id='api'>
</h3>


<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/c6b88b7540a9dfb28926cea12e733364d98ed92c/src/index.js#L100-L167'>
<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/93107316e86f7d437ce9a32d5b372b68636064cf/src/index.js#L100-L167'>
<span>src/index.js</span>
</a>

Expand Down Expand Up @@ -432,7 +432,7 @@ <h3 class='left m0 panel-title' id='api'>
<div class='clearfix'>


<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/c6b88b7540a9dfb28926cea12e733364d98ed92c/src/index.js#L107-L113'>
<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/93107316e86f7d437ce9a32d5b372b68636064cf/src/index.js#L107-L113'>
<span>src/index.js</span>
</a>

Expand Down Expand Up @@ -495,7 +495,7 @@ <h3 class='left m0 panel-title' id='api'>
<div class='clearfix'>


<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/c6b88b7540a9dfb28926cea12e733364d98ed92c/src/index.js#L119-L119'>
<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/93107316e86f7d437ce9a32d5b372b68636064cf/src/index.js#L119-L119'>
<span>src/index.js</span>
</a>

Expand Down Expand Up @@ -558,7 +558,7 @@ <h3 class='left m0 panel-title' id='api'>
<div class='clearfix'>


<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/c6b88b7540a9dfb28926cea12e733364d98ed92c/src/index.js#L128-L134'>
<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/93107316e86f7d437ce9a32d5b372b68636064cf/src/index.js#L128-L134'>
<span>src/index.js</span>
</a>

Expand Down Expand Up @@ -644,7 +644,7 @@ <h3 class='left m0 panel-title' id='api'>
<div class='clearfix'>


<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/c6b88b7540a9dfb28926cea12e733364d98ed92c/src/index.js#L142-L145'>
<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/93107316e86f7d437ce9a32d5b372b68636064cf/src/index.js#L142-L145'>
<span>src/index.js</span>
</a>

Expand Down Expand Up @@ -722,7 +722,7 @@ <h3 class='left m0 panel-title' id='api'>
<div class='clearfix'>


<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/c6b88b7540a9dfb28926cea12e733364d98ed92c/src/index.js#L152-L155'>
<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/93107316e86f7d437ce9a32d5b372b68636064cf/src/index.js#L152-L155'>
<span>src/index.js</span>
</a>

Expand Down Expand Up @@ -785,7 +785,7 @@ <h3 class='left m0 panel-title' id='api'>
<div class='clearfix'>


<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/c6b88b7540a9dfb28926cea12e733364d98ed92c/src/index.js#L163-L166'>
<a class='pl3 pr1 right rounded github' href='https://github.com/thebespokepixel/truwrap/blob/93107316e86f7d437ce9a32d5b372b68636064cf/src/index.js#L163-L166'>
<span>src/index.js</span>
</a>

Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ var commonTags = require('common-tags');
var meta = _interopDefault(require('@thebespokepixel/meta'));
var nSelector = require('@thebespokepixel/n-selector');
var ansiRegex = _interopDefault(require('ansi-regex'));
var _merge = _interopDefault(require('lodash/merge'));
var trucolor = require('trucolor');
var deepAssign = _interopDefault(require('deep-assign'));
var fs = require('fs');
var path = require('path');
var _min = _interopDefault(require('lodash/min'));
Expand Down Expand Up @@ -178,14 +178,14 @@ function createWrapTool(options) {
return new WrapTool(options);
}

const clr = deepAssign(trucolor.simple({
const clr = _merge(trucolor.simple({
format: 'sgr'
}), trucolor.palette({
format: 'sgr'
}, {
}), {
bright: 'bold rgb(255,255,255)',
dark: '#333'
}));
});
const colorReplacer = new commonTags.TemplateTag(commonTags.replaceSubstitutionTransformer(/([a-zA-Z]+?)[:/|](.+)/, (match, colorName, content) => `${clr[colorName]}${content}${clr[colorName].out}`));

const prefix = '\u001B]1337;File=inline=1;';
Expand Down
8 changes: 4 additions & 4 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { TemplateTag, replaceSubstitutionTransformer, stripIndent } from 'common
import meta from '@thebespokepixel/meta';
import { createSelector } from '@thebespokepixel/n-selector';
import ansiRegex from 'ansi-regex';
import _merge from 'lodash/merge';
import { simple, palette } from 'trucolor';
import deepAssign from 'deep-assign';
import { statSync, readFileSync } from 'fs';
import { join, extname, basename } from 'path';
import _min from 'lodash/min';
Expand Down Expand Up @@ -172,14 +172,14 @@ function createWrapTool(options) {
return new WrapTool(options);
}

const clr = deepAssign(simple({
const clr = _merge(simple({
format: 'sgr'
}), palette({
format: 'sgr'
}, {
}), {
bright: 'bold rgb(255,255,255)',
dark: '#333'
}));
});
const colorReplacer = new TemplateTag(replaceSubstitutionTransformer(/([a-zA-Z]+?)[:/|](.+)/, (match, colorName, content) => `${clr[colorName]}${content}${clr[colorName].out}`));

const prefix = '\u001B]1337;File=inline=1;';
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "truwrap",
"version": "2.0.2",
"version": "2.0.3",
"description": "Smarter terminal text wrapping (handles 24bit color)",
"author": "Mark Griffiths <mark@thebespokepixel.com> (http://thebespokepixel.com/)",
"main": "index.js",
Expand Down Expand Up @@ -56,7 +56,6 @@
"ansi-regex": "^5.0.0",
"columnify": "^1.5.4",
"common-tags": "^1.8.0",
"deep-assign": "^3.0.0",
"es6-promisify": "^6.1.1",
"get-stdin": "^8.0.0",
"lodash": "^4.17.19",
Expand Down Expand Up @@ -161,4 +160,4 @@
]
]
}
}
}
14 changes: 9 additions & 5 deletions src/lib/colour.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
│ truwrap colour │ Colour handling, here for optimisation
╰────────────────┴──────────────────────────────────────────────────────────── */

import _ from 'lodash'
import {simple, palette} from 'trucolor'
import deepAssign from 'deep-assign'
import {TemplateTag, replaceSubstitutionTransformer} from 'common-tags'

export const clr = deepAssign(simple({format: 'sgr'}), palette({format: 'sgr'}, {
bright: 'bold rgb(255,255,255)',
dark: '#333'
}))
export const clr = _.merge(
simple({format: 'sgr'}),
palette({format: 'sgr'}),
{
bright: 'bold rgb(255,255,255)',
dark: '#333'
}
)

export const colorReplacer = new TemplateTag(
replaceSubstitutionTransformer(
Expand Down

0 comments on commit 648012f

Please sign in to comment.