mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
readme: verify all non-README links with asciidoctor/extract-header-ids and git grep
Fix all the ~30 failures it found!
This commit is contained in:
28
asciidoctor/extract-header-ids
Executable file
28
asciidoctor/extract-header-ids
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require 'asciidoctor'
|
||||
require 'asciidoctor/extensions'
|
||||
require 'pry'
|
||||
|
||||
class Main < Asciidoctor::Extensions::TreeProcessor
|
||||
def process document
|
||||
return unless document.blocks?
|
||||
process_blocks document
|
||||
nil
|
||||
end
|
||||
|
||||
def process_blocks node
|
||||
node.blocks.each_with_index do |block, i|
|
||||
if block.context == :section
|
||||
puts block.id
|
||||
end
|
||||
process_blocks block if block.blocks?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Asciidoctor::Extensions.register do
|
||||
treeprocessor Main
|
||||
end
|
||||
|
||||
(Asciidoctor.load_file(ARGV[0])).convert
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
# https://github.com/cirosantilli/linux-kernel-module-cheat#asciidoctor-extract-links
|
||||
# https://github.com/cirosantilli/linux-kernel-module-cheat#asciidoctor-extract-link-targets
|
||||
|
||||
require 'asciidoctor'
|
||||
require 'asciidoctor/extensions'
|
||||
|
||||
Reference in New Issue
Block a user