Code Monkey home page Code Monkey logo

bie-api-changes's Introduction

API Diff generator

Automatically generates a diff of old and new JSON / other documents.

View the current generated documents at https://atlasoflivingaustralia.github.io/bie-api-changes.

JSON diffs are provided by jsondiffpatch JS library entirely on the client side, others by the diff command line tool thendiff2html on the client side.

JSON diffs try to be smart about arrays - if an array entry has a 'guid', '_id', 'id' or 'name' property, then that array elements 'identity' is tracked by that value. This means that if array entries have changed index it can be shown in the diff. Of course, if a GUID has changed then it appears like the whole object has changed (ie the entire array entry block will be in red and struck through with a replacement block that may or may not have different values for non-guid properties).

New and old BIE base URIs are currently hard coded for BIE in generate.groovy.

Individual services are configured in config.json. To add notes for a diff, create a file $NAME.notes.md where $NAME matches the name in config.json.

All $NAME.[new|old].[json|csv] files are downloaded from the respective service and saved to the file system.

All $NAME.html pages are generated from a corresponding details.$type.html.ftl FreeMarker template. The details HTML pages are missing the Atlas branding as it messes with the diff styling. $NAME.notes.html pages are just the $NAME.notes.md Markdown rendered to HTML with Atlas branding. The Markdown notes will also appear in the $NAME.html page if they exist.

To update pages

Run ./generate.groovy. Use --skip to avoid downloading any JSON/CSV that already exist on the filesystem. Use --watch to watch all templates and the config file for changes and then regenerate the pages. Eg ./generate.groovy --skip --watch

Use npm install -g http-server to install a simple local HTTP server then http-server in this directory to serve files locally on http://localhost:8080/.

When you are satisified with changes to your local pages, git add . && git commit -m "your message" && git push to deploy to the gh-pages branch and update the https://atlasoflivingaustralia.github.io/bie-api-changes content (which are one and the same).

bie-api-changes's People

Contributors

sbearcsiro avatar

Watchers

 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.