summaryrefslogtreecommitdiff
path: root/spec2md.pl
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-01-03 22:33:08 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2015-01-03 22:33:08 -0800
commit6d39d67bc90e2a6e4cd22539be270f246069e64a (patch)
tree4de5a5d6585a7d0addccee3406af260ba7af0cfd /spec2md.pl
parent918867accab909c6efb2f762773b9f72c8f1014b (diff)
Rewrote spec2md in python.
Better to only require python, not python and perl.
Diffstat (limited to 'spec2md.pl')
-rw-r--r--spec2md.pl36
1 files changed, 0 insertions, 36 deletions
diff --git a/spec2md.pl b/spec2md.pl
deleted file mode 100644
index 313f86f..0000000
--- a/spec2md.pl
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-
-my $stage = 0;
-my $example = 0;
-my @match;
-my $section = "";
-
-while (<STDIN>) {
- if (/^\.$/) {
- if ($stage == 0) {
- $example++;
- print "\n<div class=\"example\" id=\"example-$example\" data-section=\"$section\">\n";
- print "<div class=\"examplenum\"><a href=\"#example-$example\">Example $example</a>&nbsp;&nbsp;<a class=\"dingus\" title=\"open in interactive dingus\">(interact)</a></div>\n\n";
- print "````````````````````````````````````````````````````````` markdown\n";
- } elsif ($stage == 1) {
- print "`````````````````````````````````````````````````````````\n\n";
- print "````````````````````````````````````````````````````````` html\n";
- } elsif ($stage == 2) {
- print "`````````````````````````````````````````````````````````\n\n";
- print "</div>\n\n";
- } else {
- die "Encountered unknown stage $stage";
- }
- $stage = ($stage + 1) % 3;
- } else {
- if ($stage == 0 && (@match = ($_ =~ /^#{1,6} *(.*)/))) {
- $section = $match[0];
- }
- if ($stage != 0) {
- $_ =~ s/ /␣/g;
- }
- print $_;
- }
-}