First release
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 142 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
File.open("../objc-zen-book.md", 'r') do |f|
|
||||||
|
f.each_line do |line|
|
||||||
|
forbidden_words = [
|
||||||
|
'Table of contents',
|
||||||
|
'define',
|
||||||
|
'pragma',
|
||||||
|
'Zen and the Art of the Objective-C Craftsmanship']
|
||||||
|
|
||||||
|
next if !line.start_with?("#") || forbidden_words.any? { |w| line =~ /#{w}/ }
|
||||||
|
|
||||||
|
title = line.gsub("#", "").strip
|
||||||
|
href = title.gsub(" ", "-").downcase
|
||||||
|
puts " " * (line.count("#")-1) + "* [#{title}](\##{href})"
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user