mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 02:07:50 +08:00
26 lines
546 B
Ruby
26 lines
546 B
Ruby
require 'rexml/xpath'
|
|
require_relative './lic/markdown'
|
|
|
|
module Docs
|
|
class SummaryChecker
|
|
def self.check(path)
|
|
xml = Docs::Utils.md2xml(path)
|
|
dir = File.dirname(path)
|
|
is_ok = true
|
|
missing_files = []
|
|
|
|
xml.elements.each("//a") do |link|
|
|
href = link.attribute('href').to_s
|
|
path = "#{dir}/#{href.gsub(/\.html$/, '.md')}"
|
|
|
|
if !File.file?(path)
|
|
is_ok = false unless is_ok
|
|
missing_files.push href
|
|
break
|
|
end
|
|
end
|
|
|
|
missing_files
|
|
end
|
|
end
|
|
end |