Coder Social home page Coder Social logo

diffwita's Introduction

This is a proof of concept.

Diffwita

A (WIP) tool to turn a git tree into a tutorial. It's like a simple form of literate programming.

The way it works is you simply include markdown in your commit messages that describes the changes in that particular commit. Diffwita then turns it into a lovely document.

example image

Why?

  • It's kind of silly.
  • Lets tutorials include a single source of truth for both the text of a tutorial and the project the tutorial is building.
  • The audience can be sure that if they follow your tutorial, it will build because you can't make a mistake or leave something out when the diff itself constitutes the tutorial.
  • Readers can browse the change-log and directly relate the change with the relevant section of the tutorial since the commit message includes the tutorial.

To do:

  • automatically build a table of contents, linkify headings, separate into multiple pages.
  • create a markdown block that lets you specify where a particular file will appear in the markdown.
  • use libgit2 instead of calling out to the system's git install.
  • probably should rewrite a bunch of it to take advantage of the templating library I used instead of messing around so much with the markdown processor.
  • make links to commit SHAs actually resolve properly.
  • syntax highlighting.

Notes:

  • You almost certainly want to configure the repository with:
    git config --local commit.cleanup scissors
    which prevents git from removing your headings; # is a comment to git by default, and gets removed from your commit messages.
  • If you want to create a section in your document with only text but no code changes, the command you need is:
    git commit --allow-empty

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.