Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add wiki maintenance scripts.

  • Loading branch information...
commit 93492bf6c2df47ce5df8288fdb34f8ac891994a4 1 parent 564a43a
Peter Powell authored May 28, 2012
12  Wiki-Scripts/find-missing-pages
... ...
@@ -0,0 +1,12 @@
  1
+#!/usr/bin/env ruby
  2
+require 'uri'
  3
+available_files = Dir.glob("**/*.md")
  4
+available_files.each do |file|
  5
+	uris = URI.extract(File.read(file))
  6
+	uris.each do |uri|
  7
+		next unless uri[0..44] == 'https://github.com/inspircd/wiki/blob/master/'
  8
+		path = uri[45..-1].split(')')[0]
  9
+		next if File.exists?(path)
  10
+		puts "MISSING PAGE: #{path} (linked from #{file})"
  11
+	end
  12
+end
15  Wiki-Scripts/find-orphaned-pages
... ...
@@ -0,0 +1,15 @@
  1
+#!/usr/bin/env ruby
  2
+require 'uri'
  3
+available_files = Dir.glob("**/*.md")
  4
+linked_files = []
  5
+available_files.each do |file|
  6
+	uris = URI.extract(File.read(file))
  7
+	uris.each do |uri|
  8
+		next unless uri[0..44] == 'https://github.com/inspircd/wiki/blob/master/'
  9
+		linked_files << uri[45..-1].split(')')[0]
  10
+	end
  11
+end
  12
+available_files.each do |file|
  13
+	next if linked_files.include?(file)
  14
+	puts "ORPHANED PAGE: #{file}"
  15
+end

0 notes on commit 93492bf

Please sign in to comment.
Something went wrong with that request. Please try again.