Permalink
Browse files

Ruby script to access the github api and pull out issues on given rep…

…o, formatting for html notebook
  • Loading branch information...
1 parent 81dcfdb commit ae5d88a2974978af98aebe94c1be83f7d4af9ad2 @cboettig committed Aug 1, 2012
Showing with 46 additions and 0 deletions.
  1. +19 −0 issues.rb
  2. +27 −0 minted-highlights.tex
View
@@ -0,0 +1,19 @@
+require 'octokit'
+@address = "cboettig/pdg_control"
+ repo = Octokit.issues(@address) # grab the data. Can this go in "initialize?"
+
+ # Generate a list of all open issues, linking to github issue page.
+ out = "<ul>"
+ for i in 0 ... repo.size
+ lab = ""
+ if repo[i].labels[0].class == Hashie::Mash # Get labels for issues, with color, where applicable
+ lab = " (<font color=\"#" + repo[i].labels[0].color +
+ "\">" + repo[i].labels[0].name + "</font>)"
+ end
+ if repo[i].state == "open" # Print only open issues (not necessary? Done by default?)
+ out = out + "<li> <a href=\"" + repo[i].html_url + "\">" + repo[i].title + "</a> " + lab + "</li>"
+ end
+ end
+ out = out + "</ul>"
+ out
+
View
@@ -0,0 +1,27 @@
+\documentclass[a4paper]{article}
+
+\usepackage{fontspec}
+\usepackage{minted}
+
+%\setsansfont{Calibri}
+%\setmonofont{Consolas}
+
+\begin{document}
+\renewcommand{\theFancyVerbLine}{
+ \sffamily\textcolor[rgb]{0.5,0.5,0.5}{\scriptsize\arabic{FancyVerbLine}}}
+
+\begin{minted}[mathescape,
+ linenos,
+ numbersep=5pt,
+ gobble=2,
+ frame=lines,
+ framesep=2mm]{csharp}
+ string title = "This is a Unicode π in the sky"
+ /*
+ Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the perimeter
+ of an $n$-sided regular polygon circumscribing a
+ circle of diameter $d$.
+ */
+ const double pi = 3.1415926535
+\end{minted}
+\end{document}

0 comments on commit ae5d88a

Please sign in to comment.