├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── LICENSE ├── README.md ├── code ├── arrow.js ├── express.js ├── jasmine.js ├── number.js └── request.js ├── jslistings.sty ├── main.pdf ├── main.tex ├── package-lock.json ├── package.json ├── release_notes └── 1.0.0.md └── renovate.json /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## How to Contribute to This Project 2 | 3 | #### **Did You Find a Bug?** 4 | 5 | * **Ensure the bug was not already reported** by searching on GitHub under [Issues](issues). 6 | * If you're unable to find an open issue addressing the problem, [open a new one](new-issue). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. 7 | 8 | #### **Did You Write a Patch That Fixes a Bug?** 9 | 10 | * Open a new GitHub pull request with the patch. 11 | 1. Fork this project 12 | 1. Create your feature branch: `git checkout -b my-new-feature` 13 | 1. Commit your changes: `git commit -am 'Add some feature'` 14 | 1. Push to the branch: `git push origin my-new-feature` 15 | 1. Submit a pull request :tada: 16 | * Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. 17 | 18 | #### **Do You Intend to Add a New Feature or Change an Existing One?** 19 | 20 | * Suggest your change as a new [issue](new-issue) using the label `enhancement` **BEFORE** you start writing code. 21 | 22 | Thanks for contributing! :heart: 23 | 24 | 25 | 26 | [//]: # (Simply change the urls below to your project information) 27 | 28 | [issues]: daniellmb/daniellmb.github.io/issues 29 | [new-issue]: daniellmb/daniellmb.github.io/issues/new 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Expected Behavior 2 | 3 | 4 | ## Actual Behavior 5 | 6 | 7 | ## Steps to Reproduce the Problem 8 | 9 | 1. 10 | 1. 11 | 1. 12 | 13 | ## Specifications 14 | (The version of the project, operating system, hardware etc.) 15 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Issue Fixed # 2 | 3 | ## Proposed Changes 4 | 5 | - 6 | - 7 | - 8 | 9 | @xgirma 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.aux 3 | *.log 4 | *.out 5 | *.gz 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Latex-JavaScript 2 | Typeset JavaScript codes in Latex. 3 | 4 | Keywords from 5 | 6 | - JavaScript (ES 6) 7 | - Node.js 8 | - Express.js 9 | - Jasmine 10 | 11 | 12 | ![Sample](https://cloud.githubusercontent.com/assets/5876481/26476923/c2932232-4176-11e7-9017-329709928c3d.png) 13 | -------------------------------------------------------------------------------- /code/arrow.js: -------------------------------------------------------------------------------- 1 | // Expression bodies 2 | var odds = evens.map(v => v + 1); 3 | var nums = evens.map((v, i) => v + i); 4 | var pairs = evens.map(v => ({even: v, odd: v + 1})); 5 | 6 | // Statement bodies 7 | nums.forEach(v => { 8 | if (v % 5 === 0) 9 | fives.push(v); 10 | }); 11 | 12 | // Lexical this 13 | var bob = { 14 | _name: "Bob", 15 | _friends: [], 16 | printFriends() { 17 | this._friends.forEach(f => 18 | console.log(this._name + " knows " + f)); 19 | } 20 | } -------------------------------------------------------------------------------- /code/express.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var http = require('http'); 3 | var path = require('path'); 4 | var methods = require('methods'); 5 | var express = require('express'); 6 | var bodyParser = require('body-parser'); 7 | var session = require('express-session'); 8 | var cors = require('cors'); 9 | var passport = require('passport'); 10 | var errorhandler = require('errorhandler'); 11 | var mongoose = require('mongoose'); 12 | 13 | var isProduction = process.env.NODE_ENV === 'production'; 14 | 15 | // Create global app object 16 | var app = express(); 17 | 18 | app.use(cors()); 19 | 20 | // Normal express config defaults 21 | app.use(require('morgan')('dev')); 22 | app.use(bodyParser.urlencoded({extended: false})); 23 | app.use(bodyParser.json()); 24 | 25 | app.use(require('method-override')()); 26 | app.use(express.static(__dirname + '/public')); 27 | 28 | app.use(session({secret: 'conduit', cookie: {maxAge: 60000}, resave: false, saveUninitialized: false})); 29 | 30 | if (!isProduction) { 31 | app.use(errorhandler()); 32 | } 33 | 34 | app.use(require('./routes')); 35 | 36 | /// catch 404 and forward to error handler 37 | app.use(function (req, res, next) { 38 | var err = new Error('Not Found'); 39 | err.status = 404; 40 | next(err); 41 | }); 42 | 43 | // finally, let's start our server... 44 | var server = app.listen(process.env.PORT || 3000, function () { 45 | console.log('Listening on port ' + server.address().port); 46 | }); -------------------------------------------------------------------------------- /code/jasmine.js: -------------------------------------------------------------------------------- 1 | describe('built-in matchers', function() { 2 | describe('toBeTruthy', function() { 3 | it('passes if subject is true', function() { 4 | expect(true).toBeTruthy(); 5 | expect(false).not.toBeTruthy(); 6 | }); 7 | }); 8 | 9 | describe('toBeFalsy', function() { 10 | it('passes if subject is false', function() { 11 | expect(false).toBeFalsy(); 12 | expect(true).not.toBeFalsy(); 13 | }); 14 | }); 15 | 16 | describe('toBeDefined', function() { 17 | it('passes if subject is not undefined', function() { 18 | expect({}).toBeDefined(); 19 | expect(undefined).not.toBeDefined(); 20 | }); 21 | }); 22 | 23 | describe('toBeNull', function() { 24 | it('passes if subject is null', function() { 25 | expect(null).toBeNull(); 26 | expect(undefined).not.toBeNull(); 27 | expect({}).not.toBeNull(); 28 | }); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /code/number.js: -------------------------------------------------------------------------------- 1 | Number.EPSILON 2 | Number.isInteger(Infinity); // false 3 | Number.isNaN("NaN"); // false 4 | 5 | Math.acosh(3); // 1.762747174039086 6 | Math.hypot(3, 4); // 5 7 | Math.imul(Math.pow(2, 32) - 1, Math.pow(2, 32) - 2) // 2 8 | ; 9 | "abcde".includes("cd"); // true 10 | "abc".repeat(3); // "abcabcabc" 11 | 12 | Array.from(document.querySelectorAll('*')); // Returns a real Array 13 | Array.of(1, 2, 3) // Similar to new Array(...), but without special one-arg behavior 14 | [0, 0, 0].fill(7, 1) // [0,7,7] 15 | [1, 2, 3].find(x => x == 3) // 3 16 | [1, 2, 3].findIndex(x => x == 2) // 1 17 | [1, 2, 3, 4, 5].copyWithin(3, 0) // [1, 2, 3, 1, 2] 18 | ["a", "b", "c"].entries() // iterator [0, "a"], [1,"b"], [2,"c"] 19 | ["a", "b", "c"].keys() // iterator 0, 1, 2 20 | ["a", "b", "c"].values(); // iterator "a", "b", "c" 21 | 22 | Object.assign(Point, { origin: new Point(0,0) }); -------------------------------------------------------------------------------- /code/request.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | var http = require('http'); 4 | var request = require('request'); 5 | var TMP_FILE_PATH = path.join(path.sep, 'tmp', 'foo'); 6 | 7 | // write a temporary file: 8 | fs.writeFileSync(TMP_FILE_PATH, 'foo bar baz quk\n'); 9 | 10 | http.createServer(function (req, res) { 11 | console.log('the server is receiving data!\n'); 12 | req.on('end', res.end.bind(res)).pipe(process.stdout); 13 | }).listen(3000).unref(); 14 | 15 | fs.createReadStream(TMP_FILE_PATH) 16 | .pipe(request.post('http://127.0.0.1:3000')); -------------------------------------------------------------------------------- /jslistings.sty: -------------------------------------------------------------------------------- 1 | \ProvidesPackage{jslistings} 2 | \usepackage{listings} 3 | \usepackage{color} 4 | \usepackage[pdftex]{xcolor} 5 | \usepackage{textcomp} 6 | \usepackage[T1]{fontenc} 7 | \usepackage{caption} 8 | \usepackage{hyperref} 9 | 10 | \definecolor{jskeywords}{HTML}{E4D00A}% JavaScript keywords 11 | \definecolor{jsextkeywords}{HTML}{FF6700}% JavaScript extended keywords 12 | 13 | \definecolor{identifiers}{HTML}{645452} % identfiers 14 | \definecolor{string}{HTML}{B57281} % string literals 15 | \definecolor{allcomment}{HTML}{808080} % comment 16 | 17 | \definecolor{nodejs}{HTML}{629755} % Nodejs keywords 18 | \definecolor{testing}{HTML}{4169E1} % Node.js assert, jasmine 19 | \definecolor{express}{HTML}{FF8C69} % Express.js 20 | \definecolor{linenumber}{HTML}{996515} % line number 21 | \definecolor{apricot}{HTML}{98777B} % numbers 22 | \definecolor{linenofill}{HTML}{BEBEBE} % line number fill color 23 | \definecolor{antiquefuchsia}{HTML}{915C83} % braces 24 | \definecolor{ballblue}{HTML}{21ABCD} % braces 25 | 26 | \definecolor{captioncolor}{rgb}{0.39, 0.33, 0.32} % caption color 27 | \captionsetup[lstlisting]{font={color=captioncolor, small,tt}} 28 | 29 | \captionsetup[lstlisting]{font={color=captioncolor, small, tt}} 30 | \DeclareCaptionFormat{listing}{\rule{\dimexpr\textwidth+17pt\relax}{0.4pt}\vskip1pt#1#2#3} 31 | \captionsetup[lstlisting]{format=listing,singlelinecheck=false, margin=0pt, font={sf},labelsep=space,labelfont=bf} 32 | 33 | \lstdefinelanguage{JavaScript}{ 34 | alsoletter={.}, 35 | keywords={arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,enum,eval,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,var,void,while,with,yield}, % JavaScript ES6 keywords 36 | keywordstyle=\color{jskeywords}\bfseries, 37 | ndkeywords={add, apply, args, Array, Array.from, Array.isArray, Array.of , Array.prototype, ArrayBuffer, bind, Boolean, call, charAt, charCodeAt, clear, codePointAt, concat, constructor, copyWithin, DataView, Date, Date.now, Date.parse, Date.prototype, Date.UTC, decodeURI, decodeURIComponent, encodeURI, encodeURIComponent, endsWith, entries, Error, Error.prototype, EvalError, every, false, fill, filter, find, findIndex, Float32Array, Float64Array, forEach, FulfillPromise, Function, Function.length, get, getDate, getDay, getFullYear, getHours, getMilliseconds, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getUTCDate, getUTCDay, getUTCFullYear, getUTCHours, getUTCMilliseconds, getUTCMinutes, getUTCMonth, getUTCSeconds, has,hasInstance, hasOwnProperty, ignoreCase, includes, indexOf, indexOf, Infinity, Int8Array, Int16Array, Int32Array, isConcatSpreadable, isFinite, isNaN, IsPromise, isPrototypeOf, Iterable, iterator, join, JSON, JSON.parse, JSON.stringify, keys, lastIndexOf, lastIndexOf, length, localeCompare, map, Map, match, match, Math, Math.abs , Math.acos, Math.acosh, Math.asin, Math.asinh, Math.atan, Math.atan2, Math.atanh, Math.cbrt, Math.ceil, Math.clz32, Math.cos, Math.cosh, Math.E, Math.exp, Math.expm1, Math.floor, Math.fround, Math.hypot, Math.imul, Math.LN2, Math.LN10, Math.log, Math.log1p, Math.log2, Math.LOG2E, Math.log10, Math.LOG10E, Math.max, Math.min, Math.PI, Math.pow, Math.random, Math.round, Math.sign, Math.sin, Math.sinh, Math.sqrt, Math.SQRT1_2, Math.SQRT2, Math.tan, Math.tanh, Math.trunc, message, multiline, name, NaN, NewPromiseCapability, next, normalize, null, Number, Number.EPSILON, Number.isFinite, Number.isInteger, Number.isNaN, Number.isSafeInteger, Number.MAX_SAFE_INTEGER, Number.MAX_VALUE, Number.MIN_SAFE_INTEGER, Number.MIN_VALUE, Number.NaN, Number.NEGATIVE_INFINITY, Number.parseFloat, Number.parseInt, Number.POSITIVE_INFINITY, Number.prototype, Object, Object, Object.assign, Object.create, Object.defineProperties, Object.defineProperty, Object.freeze, Object.getOwnPropertyDescriptor, Object.getOwnPropertyNames, Object.getOwnPropertySymbols, Object.getPrototypeOf, Object.is, Object.isExtensible, Object.isFrozen, Object.isSealed, Object.keys, Object.preventExtensions, Object.prototype, Object.seal, Object.setPrototypeOf, of, parseFloat, parseInt, pop, Promise, Promise.all , Promise.race, Promise.reject, Promise.resolve, PromiseReactionJob, propertyIsEnumerable, prototype, Proxy, Proxy.revocable , push, RangeError, reduce, reduceRight, ReferenceError, Reflect, Reflect.apply, Reflect.construct , Reflect.defineProperty, Reflect.deleteProperty, Reflect.enumerate, Reflect.get, Reflect.getOwnPropertyDescriptor, Reflect.getPrototypeOf, Reflect.has, Reflect.isExtensible, Reflect.ownKeys, Reflect.preventExtensions, Reflect.set, Reflect.setPrototypeOf, Reflection, RegExp, RegExp, RegExp.prototype, repeat, replace, replace, reverse, search, search, Set, set, setDate, setFullYear, setHours, setMilliseconds, setMinutes, setMonth, setSeconds, setTime, setUTCDate, setUTCFullYear, setUTCHours, setUTCMilliseconds, setUTCMinutes, setUTCMonth, setUTCSeconds, shift, slice, slice, some, sort, species, splice, split, split, startsWith, String, String.fromCharCode, String.fromCodePoint, String.raw, substring, Symbol, Symbol.for, Symbol.hasInstance, Symbol.isConcatSpreadable, Symbol.iterator, Symbol.keyFor, Symbol.match, Symbol.prototype, Symbol.replace, Symbol.replace, Symbol.search, Symbol.species, Symbol.split, Symbol.toPrimitive, Symbol.toStringTag, Symbol.unscopables, SyntaxError, then, toDateString, toExponential, toFixed, toISOString, toJSON, toLocaleDateString, toLocaleLowerCase, toLocaleString, toLocaleString, toLocaleString, toLocaleString, toLocaleTimeString, toLocaleUpperCase, toLowerCase, toPrecision, toPrimitive, toString, toStringTag, toTimeString, toUpperCase, toUTCString, TriggerPromiseReactions, trim, true, TypeError, Uint8Array, Uint8ClampedArray, Uint16Array, Uint32Array, undefined, unscopables, unshift, URIError, valueOf, WeakMap, WeakSet 38 | }, % JavaScript extended keywords 39 | ndkeywordstyle=\color{jsextkeywords}\bfseries, 40 | identifierstyle=\color{identifiers}, 41 | sensitive=true, 42 | stringstyle=\color{string}\ttfamily, 43 | morestring=[b]", 44 | morestring=[d]', 45 | morestring=[s][\color{string}\ttfamily]{`}{`}, 46 | commentstyle=\color{red}\itshape, 47 | morecomment=[l][\color{allcomment}]{//}, 48 | morecomment=[s][\color{allcomment}]{/*}{*/}, 49 | morecomment=[s][\color{allcomment}]{/**}{*/}, 50 | emph={app.all, app.delete, app.disable, app.disabled, app.enable, app.enabled, app.engine, app.get, app.listen, app.locals, app.METHOD, app.mountpath, app.param, app.path, app.post, app.put, app.render, app.route, app.set, app.use, express, express.Router, express.static, req.acceptLanguages, req.accepts, req.acceptsCharsets, req.acceptsEncodings, req.app, req.baseUrl, req.body, req.cookies, req.fresh, req.get, req.hostname, req.ip, req.ips, req.is, req.method, req.originalUrl, req.param, req.params, req.path, req.protocol, req.query, req.range, req.route, req.secure, req.signedCookies, req.stale, req.subdomains, req.xhr, res.app, res.append, res.attachment, res.clearCookie, res.cookies, res.download, res.end, res.format, res.get, res.headersSent, res.json, res.jsonp, res.links, res.locals, res.location, res.redirect, res.render, res.sendFile, res.sendStatus, res.set, res.status, res.type, res.vary, router.all, router.METHOD, router.param, router.route, router.use}, % express keywords 51 | emph={[2]agent.createConnection, agent.destroy, agent.freeSockets, agent.getName, agent.maxFreeSockets, agent.maxSockets, agent.requests, agent.sockets, certificate.exportChallenge, certificate.exportPublicKey, certificate.verifySpkac, child.channel, child.connected, child.disconnect, child.kill, child.pid, child.send, child.stderr, child.stdin, child.stdio, child.stdout, child_process.exec, child_process.execFile, child_process.execFileSync, child_process.execSync, child_process.fork, child_process.spawn, child_process.spawnSync, cipher.final, cipher.getAuthTag, cipher.setAAD, cipher.setAutoPadding, cipher.update, clearImmediate, clearImmediate, clearInterval, clearInterval, clearTimeout, clearTimeout, console, console.assert, console.dir, console.error, console.info, console.log, console.time, console.timeEnd, console.trace, console.warn, decipher.final, decipher.setAAD, decipher.setAuthTag, decipher.setAutoPadding, decipher.update, dgram.createSocket, dgram.createSocket, diffieHellman.computeSecret, diffieHellman.generateKeys, diffieHellman.getGenerator, diffieHellman.getPrime, diffieHellman.getPrivateKey, diffieHellman.getPublicKey, diffieHellman.setPrivateKey, diffieHellman.setPublicKey, diffieHellman.verifyError, dns.getServers, dns.getServers, dns.lookup, dns.lookup, dns.lookupService, dns.resolve, dns.resolve4, dns.resolve6, dns.resolveCname, dns.resolveMx, dns.resolveNaptr, dns.resolveNs, dns.resolvePtr, dns.resolveSoa, dns.resolveSrv, dns.resolveTxt, dns.reverse, dns.setServers, ecdh.computeSecret, ecdh.generateKeys, ecdh.getPrivateKey, ecdh.getPublicKey, ecdh.setPrivateKey, ecdh.setPublicKey, error.address, error.code, error.errno, error.message, error.path, error.port, error.stack, error.syscall, exports, fs.access, fs.accessSync, fs.appendFile, fs.appendFileSync, fs.chmod, fs.chmodSync, fs.chown, fs.chownSync, fs.close, fs.closeSync, fs.constants, fs.createReadStream, fs.createWriteStream, fs.exists, global, http.createServer, http.get, http.globalAgent, http.request, https.createServer, https.get, https.globalAgent, https.request, message.destroy, message.headers, message.httpVersion, message.method, message.rawHeaders, message.rawTrailers, message.setTimeout, message.socket, message.statusCode, message.statusMessage, message.trailers, message.url, module, module.children, module.exports, module.filename, module.id, module.loaded, module.parent, module.require, os.arch, os.constants, os.cpus, os.endianness, os.EOL, os.freemem, os.homedir, os.hostname, os.loadavg, os.networkInterfaces, os.platform, os.release, os.tmpdir, os.totalmem, os.type, os.uptime, os.userInfo, path.basename, path.delimiter, path.dirname, path.extname, path.format, path.isAbsolute, path.join, path.normalize, path.parse, path.posix, path.relative, path.resolve, path.sep, path.win32, process, process.abort, process.arch, process.argv, process.argv0, process.channel, process.chdir, process.config, process.connected, process.cpuUsage, process.cwd, process.disconnect, process.emitWarning, process.env, process.execArgv, process.execPath, process.exit, process.exitCode, process.getegid, process.geteuid, process.getgid, process.getgroups, process.getuid, process.hrtime, process.initgroups, process.kill, process.mainModule, process.memoryUsage, process.nextTick, process.pid, process.platform, process.release, process.send, process.setegid, process.seteuid, process.setgid, process.setgroups, process.setuid, process.stderr, process.stdin, process.stdout, process.title, process.umask, process.uptime, process.version, process.versions, querystring.escape, querystring.parse, querystring.stringify, querystring.unescape, r.clearLine, readable.pause, readable.pipe, readable.push, readable.push, readable.read, readable.read, readable.resume, readable.setEncoding, readable.unpipe, readable.unshift, readable.wrap, readable._read, readStream.bytesRead, readStream.isRaw, readStream.path, readStream.setRawMode, repl.start, request.abort, request.aborted, request.end, request.flushHeaders, request.setNoDelay, request.setSocketKeepAlive, request.setTimeout, request.write, require, require.cache, require.extensions, response.addTrailers, response.end, response.finished, response.getHeader, response.getHeaderNames, response.getHeaders, response.hasHeader, response.headersSent, response.removeHeader, response.sendDate, response.setHeader, response.setTimeout, response.statusCode, response.statusMessage, response.write, response.writeContinue, response.writeHead, rl.clearScreenDown, rl.close, rl.createInterface, rl.cursorTo, rl.emitKeypressEvents, rl.moveCursor, rl.pause, rl.prompt, rl.question, rl.resume, rl.setPrompt, rl.write, script.runInNewContext, script.runInThisContext, server.addContext, server.address, server.address, server.close, server.close, server.connections, server.getTicketKeys, server.listen, server.listen, server.setTicketKeys, server.setTimeout, server.setTimeout, server.timeout, server.timeout, setImmediate, setInterval, setTimeout, socket.addMembership, socket.address, socket.bind, socket.bind, socket.close, socket.dropMembership, socket.ref, socket.send, socket.setBroadcast, socket.setMulticastLoopback, socket.setMulticastTTL, socket.setTTL, socket.unref, stream.Readable, stringDecoder.end, stringDecoder.write, timeout.ref, timeout.unref, tls.connect, tls.createSecureContext, tls.createServer, tls.getCiphers, tlsSocket.address, tlsSocket.authorizationError, tlsSocket.authorized, tlsSocket.encrypted, tlsSocket.getCipher, tlsSocket.getEphemeralKeyInfo, tlsSocket.getPeerCertificate, tlsSocket.getProtocol, tlsSocket.getSession, tlsSocket.getTLSTicket, tlsSocket.localAddress, tlsSocket.localPort, tlsSocket.remoteAddress, tlsSocket.remoteFamily, tlsSocket.remotePort, tlsSocket.renegotiate, tlsSocket.setMaxSendFragment, transform._flush, transform._transform, util.debuglog, util.deprecate, util.format, util.inherits, util.inspect, v8.getHeapStatistics, v8.setFlagsFromString, vm.createContext, vm.isContext, vm.runInContext, vm.runInDebugContext, vm.runInNewContext, vm.runInThisContext, watcher.close, worker.disconnect, worker.exitedAfterDisconnect, worker.id, worker.isConnected, worker.isDead, worker.kill, worker.process, worker.send, worker.suicide, writable.cork, writable.end, writable.setDefaultEncoding, writable.write, writeStream.bytesWritten, writeStream.columns, writeStream.path, writeStream.rows, zlib, zlib.createGunzip, zlib.createGzip, zlib.createInflate, zlib.createInflateRaw, zlib.createUnzip, zlib.deflate, zlib.deflateRaw, zlib.deflateRawSync, zlib.deflateSync, zlib.gunzip, zlib.gunzipSync, zlib.gzip, zlib.gzipSync, zlib.inflate, zlib.inflateRaw, zlib.inflateRawSync, zlib.inflateSync, zlib.unzip, zlib.unzipSync, __dirname, __filename}, % Node.js keywords 52 | emph={[3] assert, assert.deepEqual, assert.deepStrictEqual, assert.doesNotThrow, assert.equal, assert.fail, assert.ifError, assert.notDeepEqual, assert.notDeepStrictEqual, assert.notEqual, assert.notStrictEqual, assert.ok, assert.strictEqual, assert.throws, describe, toBe, it, xdescribe, beforeEach, afterEach, beforeAll, afterAll, expect, it, xit, xdiscribe, pending, and.callThrough, and.returnValue, and.returnValues, and.callFake, and.throwError, and.stub, .not, .calls.any, .calls.count, .calls.argsFor, .calls.allArgs, .calls.all, .calls.mostRecent, .calls.first, .calls.reset, jasmine.createSpy, jasmine.createSpyObj, jasmine.any, jasmine.anything, jasmine.objectContaining, jasmine.arrayContaining, jasmine.stringMatching, asymmetricMatch, jasmine.clock, .not.toBeTruthy, .toBeTruthy, .not.toBeFalsy, .toBeFalsy, .not.toBeDefined .toBeDefined, .not.toBeNull .toBeNull, .not.toEqual .toEqual, .not.toBeCloseTo .toBeCloseTo, .not.toContain, .toContain, .not.toMatch, .toMatch, .not.toBeGreaterThan, .toBeGreaterThan, .not.toBeLessThan, .toBeLessThan, .toThrow, .not.toThrow, .toBeNull, .not.toBeNull, .toBeDefined, .not.toBeDefined}, % Node.js Assert, Jasmine, ... keywords 53 | } 54 | 55 | \lstset{ 56 | basicstyle=\normalsize\linespread{1.1}\footnotesize\ttfamily, 57 | language=JavaScript, 58 | frame=top,frame=bottom, 59 | breaklines=true, 60 | showstringspaces=false, 61 | tabsize=2, 62 | upquote = true, 63 | numbers=left, 64 | numberstyle=\tiny, 65 | stepnumber=1, 66 | numbersep=5pt, 67 | numberblanklines=false, 68 | xleftmargin=17pt, 69 | framexleftmargin=17pt, 70 | framexrightmargin=17pt, 71 | framexbottommargin=5pt, 72 | framextopmargin=5pt, 73 | alsoother={.}, 74 | captionpos=t, 75 | literate= 76 | *{\{}{{\textcolor{antiquefuchsia}{\{}}}{1}% punctuators 77 | {\}}{{\textcolor{antiquefuchsia}{\}}}}{1}% 78 | {(}{{\textcolor{antiquefuchsia}{(}}}1% 79 | {)}{{\textcolor{antiquefuchsia}{)}}}1% 80 | {[}{{\textcolor{antiquefuchsia}{[}}}1% 81 | {]}{{\textcolor{antiquefuchsia}{]}}}1% 82 | {...}{{\textcolor{ballblue}{...}}}1% 83 | {;}{{\textcolor{antiquefuchsia}{;}}}1% 84 | {,}{{\textcolor{antiquefuchsia}{,}}}1% 85 | {>}{{\textcolor{ballblue}{>}}}1% 86 | {<}{{\textcolor{ballblue}{<}}}1% 87 | {<=}{{\textcolor{ballblue}{<=}}}1% 88 | {>=}{{\textcolor{ballblue}{>=}}}1% 89 | {==}{{\textcolor{ballblue}{==}}}1% 90 | {!=}{{\textcolor{ballblue}{!=}}}1% 91 | {===}{{\textcolor{ballblue}{===}}}1% 92 | {!==}{{\textcolor{ballblue}{!==}}}1% 93 | {+}{{\textcolor{ballblue}{+}}}1% 94 | {-}{{\textcolor{ballblue}{-}}}1% 95 | {*}{{\textcolor{ballblue}{*}}}1% 96 | {\%}{{\textcolor{ballblue}{\%}}}1% 97 | {++}{{\textcolor{ballblue}{++}}}1% 98 | {--}{{\textcolor{ballblue}{--}}}1% 99 | {<<}{{\textcolor{ballblue}{<<}}}1% 100 | {>>}{{\textcolor{ballblue}{>>}}}1% 101 | {>>>}{{\textcolor{ballblue}{>>>}}}1% 102 | {=}{{\textcolor{ballblue}{=}}}1% 103 | {&}{{\textcolor{ballblue}{&}}}1% 104 | {|}{{\textcolor{ballblue}{|}}}1% 105 | {^}{{\textcolor{ballblue}{^}}}1% 106 | {!}{{\textcolor{ballblue}{!}}}1% 107 | {~}{{\textcolor{ballblue}{~}}}1% 108 | {&&}{{\textcolor{ballblue}{&&}}}1% 109 | {||}{{\textcolor{ballblue}{||}}}1% 110 | {?}{{\textcolor{ballblue}{?}}}1% 111 | {:}{{\textcolor{ballblue}{:}}}1% 112 | {=}{{\textcolor{ballblue}{=}}}1% 113 | {+=}{{\textcolor{ballblue}{+=}}}1% 114 | {-=}{{\textcolor{ballblue}{-=}}}1% 115 | {*=}{{\textcolor{ballblue}{*=}}}1% 116 | {\%=}{{\textcolor{ballblue}{\%=}}}1% 117 | {<<=}{{\textcolor{ballblue}{<<=}}}1% 118 | {>>=}{{\textcolor{ballblue}{>>=}}}1% 119 | {>>>=}{{\textcolor{ballblue}{>>>=}}}1% 120 | {&=}{{\textcolor{ballblue}{&=}}}1% 121 | {|=}{{\textcolor{ballblue}{|=}}}1% 122 | {^=}{{\textcolor{ballblue}{^=}}}1% 123 | {=>}{{\textcolor{ballblue}{=>}}}1% 124 | {\\b}{{\textcolor{ballblue}{\\b}}}1% escape sequences 125 | {\\t}{{\textcolor{apricot}{\\t}}}{1}% 126 | {\\n}{{\textcolor{apricot}{\\n}}}{1}% 127 | {\\v}{{\textcolor{apricot}{\\v}}}{1}% 128 | {\\f}{{\textcolor{apricot}{\\f}}}{1}% 129 | {\\r}{{\textcolor{apricot}{\\r}}}{1}% 130 | {\\"}{{\textcolor{apricot}{\\"}}}{1}% 131 | {\\'}{{\textcolor{apricot}{\\'}}}{1}% 132 | {\\}{{\textcolor{apricot}{\\}}}{1}% 133 | {0}{{\textcolor{apricot}{0}}}{1}% numbers 134 | {1}{{\textcolor{apricot}{1}}}{1}% 135 | {2}{{\textcolor{apricot}{2}}}{1}% 136 | {3}{{\textcolor{apricot}{3}}}{1}% 137 | {4}{{\textcolor{apricot}{4}}}{1}% 138 | {5}{{\textcolor{apricot}{5}}}{1}% 139 | {6}{{\textcolor{apricot}{6}}}{1}% 140 | {7}{{\textcolor{apricot}{7}}}{1}% 141 | {8}{{\textcolor{apricot}{8}}}{1}% 142 | {9}{{\textcolor{apricot}{9}}}{1}% 143 | {.0}{{\textcolor{apricot}{.0}}}{2}% 144 | {.1}{{\textcolor{apricot}{.1}}}{2}% 145 | {.2}{{\textcolor{apricot}{.2}}}{2}% 146 | {.3}{{\textcolor{apricot}{.3}}}{2}% 147 | {.4}{{\textcolor{apricot}{.4}}}{2}% 148 | {.5}{{\textcolor{apricot}{.5}}}{2}% 149 | {.6}{{\textcolor{apricot}{.6}}}{2}% 150 | {.7}{{\textcolor{apricot}{.7}}}{2}% 151 | {.8}{{\textcolor{apricot}{.8}}}{2}% 152 | {.9}{{\textcolor{apricot}{.9}}}{2},% 153 | emphstyle={\color{express}}, % express 154 | emphstyle={[2]\color{nodejs}}, % node.js 155 | emphstyle={[3]\color{testing}}, % jasmine ... 156 | numberstyle=\normalfont\tiny\textcolor{linenumber} % line number 157 | } 158 | -------------------------------------------------------------------------------- /main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xgirma/latex-javaScript/8e571f990629377a4ba71e5647e02dfeda07b769/main.pdf -------------------------------------------------------------------------------- /main.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \usepackage{listings} 4 | \usepackage{color} 5 | \usepackage[pdftex]{xcolor} 6 | \usepackage{textcomp} 7 | \usepackage[T1]{fontenc} 8 | \usepackage{caption} 9 | \usepackage{hyperref} 10 | \usepackage{jslistings} 11 | 12 | \begin{document} 13 | \pagenumbering{gobble} 14 | 15 | \clearpage 16 | \vspace*{\fill} 17 | \begin{center} 18 | \begin{minipage}{1\textwidth} 19 | \lstinputlisting[language=JavaScript, caption=Express.js]{code/express.js} 20 | \end{minipage} 21 | \end{center} 22 | \vfill 23 | \clearpage 24 | 25 | \clearpage 26 | \vspace*{\fill} 27 | \begin{center} 28 | \begin{minipage}{1\textwidth} 29 | \lstinputlisting[language=JavaScript, caption=JavaScript]{code/arrow.js} 30 | \end{minipage} 31 | \end{center} 32 | \vfill 33 | \clearpage 34 | 35 | \clearpage 36 | \vspace*{\fill} 37 | \begin{center} 38 | \begin{minipage}{1\textwidth} 39 | \lstinputlisting[language=JavaScript, caption=JavaScript]{code/number.js} 40 | \end{minipage} 41 | \end{center} 42 | \vfill 43 | \clearpage 44 | 45 | \clearpage 46 | \vspace*{\fill} 47 | \begin{center} 48 | \begin{minipage}{1\textwidth} 49 | \lstinputlisting[language=JavaScript, caption=Node.js]{code/request.js} 50 | \end{minipage} 51 | \end{center} 52 | \vfill 53 | \clearpage 54 | 55 | \clearpage 56 | \vspace*{\fill} 57 | \begin{center} 58 | \begin{minipage}{1\textwidth} 59 | \lstinputlisting[language=JavaScript, caption=Jasmine]{code/jasmine.js} 60 | \end{minipage} 61 | \end{center} 62 | \vfill 63 | \clearpage 64 | 65 | 66 | % example source code 67 | % https://raw.githubusercontent.com/gothinkster/node-express-realworld-example-app/master/app.js 68 | % https://github.com/lodash/lodash/blob/master/fromPairs.js 69 | % https://github.com/request/request/tree/master/examples 70 | % http://blog.bandzarewicz.com/blog/2012/03/08/jasmine-cheat-sheet/ 71 | 72 | % keywords source 73 | % https://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values 74 | % https://nodejs.org/dist/latest-v7.x/docs/api/ 75 | % https://expressjs.com/en/4x/api.html 76 | % https://github.com/jasmine/jasmine 77 | 78 | % color 79 | % http://latexcolor.com/ 80 | 81 | \end{document} 82 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "latex-javascript", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "latex-javascript", 3 | "version": "1.0.0", 4 | "description": "Typeset JavaScript codes in Latex", 5 | "main": "main.tex", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/xgirma/Latex-JavaScript.git" 9 | }, 10 | "keywords": [ 11 | "Latex", 12 | "JavaScript", 13 | "Typeset", 14 | "lstlisting" 15 | ], 16 | "author": "Girma Nigusse", 17 | "license": "MIT", 18 | "bugs": { 19 | "url": "https://github.com/xgirma/Latex-JavaScript/issues" 20 | }, 21 | "homepage": "https://github.com/xgirma/Latex-JavaScript#readme", 22 | "dependencies": {} 23 | } 24 | -------------------------------------------------------------------------------- /release_notes/1.0.0.md: -------------------------------------------------------------------------------- 1 | # Latex JavaScript 1.1.0 Release Notes 2 | 3 | ## Summary 4 | This version is the first release. 5 | 6 | ## Features 7 | 8 | * Typeset core JavaScript keywords 9 | * Typeset extended javaScript keywords 10 | * Typeset Node.js keywords 11 | * Typeset Express.js keywords 12 | * Typeset Jasmine keywords 13 | 14 | ## Fixes 15 | 16 | * none 17 | 18 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ], 5 | "automerge": true, 6 | "major": { 7 | "automerge": false 8 | } 9 | } 10 | --------------------------------------------------------------------------------