Sha256: 3eea894b5c4c85b016adaffb57b5e98a114381e8e6628b69444f724be7fa2832
Contents?: true
Size: 492 Bytes
Versions: 21
Compression:
Stored size: 492 Bytes
Contents
#!/usr/bin/env ruby # -*- ruby -*- require 'scrapbox' PROJECT = "HelpLine" project = Scrapbox::Project.new(PROJECT) page = Scrapbox::Page.new(project,'Glossary') data = {} page.text.split(/\n/).each { |line| line.chomp! if line =~ /^(\S+):\s*(.*)$/ if $1 != 'code' # code: は除く data[$1] = $2 end end } defs = [] puts "var glossary = {" data.each { |key,val| defs << " '#{key}': '#{val}'" } puts defs.join(",\n") puts "}" puts "module.exports = glossary"
Version data entries
21 entries across 21 versions & 1 rubygems