Commit c8b0bc57 authored by Michael Witrant's avatar Michael Witrant

script de finition de conversion net neutrality

parent 528ad570
This diff is collapsed.
This diff is collapsed.
require 'rubygems'
require 'active_support/all'
include ActiveSupport::Inflector
data = File.read('base.mediawiki')
data.gsub! %r((Amendement \d+\n<br/>\n.+\n<br/>\n)(.+)(\n<br/>[-+]*\n)) do |match|
prefix, names, suffix = $1, $2, $3
new_names = names.split(", ").map do |name|
page = transliterate(name.split(/\s+|-/).map(&:capitalize).reject { |part| part == "A." }.join)
"[[#{page}|#{name}]]"
end.join(", ")
prefix + new_names + suffix
end
data.gsub! %r(\|-\n\|width="50%"\|\n('''Or. '''<Original>'''\{..\}..'''|'''.'''|)</Original>\n\|width="50%"\|\n(<Original>)?</Original>\n), ''
File.open("result.mediawiki", "w") do |f|
f.write data
end
data.scan(/=== Amendment .+?\n\|\}/m).each do |amendment|
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment