Git Product home page Git Product logo

this-vs-that's Introduction

This vs That

A Comparison application boilerplate to compare code samples, api changes, framework deprecations and many more.

Check out the deployed app!

Usage

1. Clone the repo

git clone [email protected]:rajasegar/this-vs-that.git

2. Set the conventions in this shell script.

Feel free to modify the parameters like INPUT, OUTPUT, EXT, etc.,

# File name convention for left column
# eg: this.html
INPUT="es5"

# File name convention for right column
# eg: that.html
OUTPUT="es6"

# File extension to identify which type of file
# eg: html, js, css, etc.,
EXT="js"

3. Create new folders/files under code/ to compare based on the conventions set. For example

code
| fat-arrow-functions
| | es5.js
| | es6.js

es5.js

// ---------- ES5 ----------
function calcCircleArea(radius) {
  return Math.PI * radius * radius;
}

es6.js

// ---------- ES6 ----------
const calcCircleArea = (radius) => Math.PI * radius * radius;

4. Finally update the index.html to reflect the changes using the shell script

$ ./update-doc.sh

You should get something like this: es5vses6

Running locally

This is a vanilla JavaScript application. You must serve the files locally in order for the JavaScript and CSS to load in the browser. For example:

npm install http-server -g
http-server .

Visit http://localhost:8080 to see the results. If you make changes, restart the server. You might have to clear the cache to see your changes. (In Chrome, open the dev tools, then right click on the browser's main refresh arrow and choose Empty Cache and Hard Reload, or configure your dev tools to not keep a cache in the first place.)

Updating the comparison list

Once you made changes to the comparison files under code/ you need to run the update-doc.sh script to reflect the latest changes.

./update-doc.sh

Contributing

Contributions are welcome! Simple examples can be added to this cheat sheet. Copy and paste a <section> block in index.html. Create the code sample files in the code directory, change the data tag of the <pre>, and you're done! Try to follow the same file naming scheme as is used elsewhere, and make sure to name any .html files

Deploying

This site is deployed to GitHub Pages automatically from the master branch.

Miscellaneous Info

This uses Prism code hightlighting with the file highlight plugin.

Inspired by YouMightNotNeedJQuery.

Example comparison websites

this-vs-that's People

Contributors

rajasegar avatar

Stargazers

mister. jones avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.