Giter Site home page Giter Site logo

ghwiki's Introduction

Wiki Workflow

Build Status

This package sets up a lab notebook on a GitHub wiki by running a series of R scripts and knitr documents, collecting figures and updating a wiki. It has grown out of a set of scripts, but is currently used across many of my (not-yet-open) research projects.

The wiki for rodeint is updated using ghwiki. This page was generated from this script and can be recomputed and updated by running a single command.

ghwiki needs to be used within a project that is a git repository. The git repository must have a github remote, and the first remote that has a github url will be used. The remote must already have a wiki.

Install with (from R)

devtools::install_github("richfitz/ghwiki")

Initialise with

Rscript -e "ghwiki::init()"

This will also clone the github wiki into a directory 'wiki' in the project root. If the command failed (e.g., the wiki was not initialised yet), pull down the project wiki manually with:

make wiki_clone

Add names of R or Rmd scripts to the file .wiki_scripts. A template is generated by running the command above. Blank lines and lines beginning with "#" are ignored, and whitespace is trimmed. If .md files are added, they will be copied to the wiki, along with any figures named following the same conventions we convince knitr to follow. At the moment, any file not ending with .R, .Rmd or .md is simply ignored.

Run

make

to run all the scripts listed in .wiki_scripts, generating md files, figures etc. A bunch of knit tweaks are applied to normalise figure paths, improve default settings, etc.

Run

make wiki_update

to update the local copy of the wiki repo, and

make wiki_publish

to push it up. You're on your own with resolving conflicts. Other make targets:

  • make clean -- clean up generated .md and .Rmd files.
  • make wiki_rollback -- undo a commit in the wiki repo
  • make wiki_reset -- destructively clean up an unclean state in the wiki repo

Other commands can be run via ./.ghwiki:

  • ./.ghwiki reset_to <SHA> -- move the wiki to a particular SHA (can undo a rollback this way)
  • ./.ghwiki git [commands] -- run git commands in the wiki repo (e.g., ./.ghwiki git log)

And yet more commands via ./.ghwiki scripts

  • ./.ghwiki scripts list -- list of scripts that we know about
  • ./.ghwiki scripts base -- basename of the scripts (without extension)
  • ./.ghwiki scripts generated_Rmd -- Rmd files that are candidates for deletion during cleanup
  • ./.ghwiki scripts targets -- list of md files that will be generated by make.

If you get fed up with typing ./.ghwiki (which gets tedious) run

Rscript -e "ghwiki:::install_scripts('~/bin')"

which will install the scripts ghwiki into "~/bin" (assuming that it exists!). If that is in your $PATH then you can run ghwiki git log and things like that. Note that these scripts just redirect to the true scripts within the package, so can be left in place through package upgrades -- the scripts that are run are those in the package.

ghwiki's People

Contributors

richfitz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ghwiki's Issues

Equation support

pandoc with --mimetex, then use http://www.forkosh.com/mimetex.html and do rewriting?

Local rendering

See grip, which looks really nice for locally rendering things.

Might need a small amount of tweaking to really work on an wiki, but that could be as simple as generating a README.md file with the current contents.

Installing on OSX had some issues with permissions (had to sudo chown -R <user> /Library/Python/2.7/var/grip.server-instance to allow css to work, and only root could open in general).

Enable "prefix" within a directory

Wikis don't really have nice directory structures, but we can kind of enforce one with prefixes. It would be nice to have some file (perhaps a little config file) that sets options including a prefix that is added to each name before copying to the wiki. Doesn't need to change anything else though.

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.