diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 57de941..0000000 --- a/.npmignore +++ /dev/null @@ -1,10 +0,0 @@ -.DS_Store -.idea/ - -irrelevant/ -wtfpython-pypi/** - -# Python-specific byte-compiled files should be ignored -__pycache__/ -*.py[cod] -*$py.class diff --git a/package.json b/package.json deleted file mode 100644 index eae9e95..0000000 --- a/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "wtfpython", - "version": "2.2.2", - "description": "A collection of surprising Python snippets and lesser known features. [ARCHIVED]", - "bin": "wtfpython", - "scripts": { - "postpublish": "git push origin master", - "toc": "doctoc --github --title '# Table of Contents' --maxlevel 3 README.md" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/satwikkansal/wtfPython.git" - }, - "keywords": [ - "python", - "specification", - "notes", - "wtf", - "learning", - "guide", - "handbook" - ], - "author": "Satwik Kansal (https://satwikkansal.xyz)", - "license": "WTFPL 2.0", - "bugs": { - "url": "https://github.com/satwikkansal/wtfPython/issues" - }, - "homepage": "https://github.com/satwikkansal/wtfPython#readme", - "devDependencies": { - "doctoc": "^1.3.0" - }, - "dependencies": { - "boxen": "^1.1.0", - "chalk": "^1.1.1", - "default-pager": "^1.1.0", - "meow": "^3.7.0", - "msee": "^0.3.3", - "through2": "^2.0.2", - "update-notifier": "^2.0.0" - } -} diff --git a/wtfpython b/wtfpython deleted file mode 100644 index b8a3fa6..0000000 --- a/wtfpython +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env node - -const fs = require('fs'); -const obj = require('through2').obj; -const pager = require('default-pager'); -const msee = require('msee'); -const join = require('path').join; -const boxen = require('boxen'); -const chalk = require('chalk'); -const updateNotifier = require('update-notifier'); -const pkg = require('./package.json'); -const meow = require('meow'); - -const cli = meow([ - 'Usage', - ' bash-handbook', - '', - 'Options', - ' --lang, -l Translation language', - '', - 'Examples', - ' bash-handbook', - ' bash-handbook --lang pt-br' -], { - string: [ - 'lang' - ], - alias: { - l: 'lang', - h: 'help' - }, - default: { - lang: '' - } -}); - -const boxenOpts = { - borderColor: 'yellow', - margin: { - bottom: 1 - }, - padding: { - right: 1, - left: 1 - } -}; - -const mseeOpts = { - paragraphEnd: '\n\n' -}; - -const notifier = updateNotifier({ pkg }); - -process.env.PAGER = process.env.PAGER || 'less'; -process.env.LESS = process.env.LESS || 'FRX'; - -const lang = cli.flags.lang - .toLowerCase() - .split('-') - .map((l, i) => i === 0 ? l : l.toUpperCase()) - .join('-'); - -const translation = join(__dirname, !lang ? './README.md' : `./README-${lang}.md`); - -fs.stat(translation, function (err, stats) { - if (err) { - console.log('The %s translation does not exist', chalk.bold(lang)); - return; - } - - fs.createReadStream(translation) - .pipe(obj(function (chunk, enc, cb) { - const message = []; - - if (notifier.update) { - message.push(`Update available: {green.bold ${notifier.update.latest}} {dim current: ${notifier.update.current}}`); - message.push(`Run {blue npm install -g ${pkg.name}} to update.`); - this.push(boxen(message.join('\n'), boxenOpts)); - } - - this.push(msee.parse(chunk.toString(), mseeOpts)); - cb(); - })) - .pipe(pager()); -});