Skip to content

Commit 883352c

Browse files
committed
Upgrade to lates version of commonmarker. Output links so that they can be rendered as markdown in a GitHub issue.
1 parent 38b3211 commit 883352c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

meta/scripts/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ source "https://rubygems.org"
44

55
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
66

7+
# gem 'commonmarker' , '0.14.2'
78
gem 'commonmarker'

meta/scripts/find_upgradeable_patterns.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ def count_known_instances(file)
3434

3535
def collect_section_nodes(file, section_title)
3636
markdown = open(file).readlines().join
37-
doc = CommonMarker.render_doc(markdown)
37+
doc = Commonmarker.parse(markdown)
3838

3939
title_found = false
4040
section_nodes = []
4141

4242
doc.walk do |node|
43-
if node.type == :header
43+
if node.type == :heading
4444
if title_found == false
4545
node.each do |subnode|
4646
if subnode.type == :text and subnode.string_content == section_title
@@ -70,7 +70,10 @@ def collect_section_nodes(file, section_title)
7070

7171
l1_patterns.each do |file|
7272
known_instances_count = count_known_instances(file)
73-
puts "#{known_instances_count} | #{file}" if known_instances_count >= 1
73+
file_display = file.gsub("../../patterns/1-initial/","")
74+
file_link = file.gsub("../../","https://github.com/InnerSourceCommons/InnerSourcePatterns/blob/main/")
75+
76+
puts "#{known_instances_count} | [#{file_display}](#{file_link})"
7477
end
7578

7679
puts "\n"
@@ -80,5 +83,8 @@ def collect_section_nodes(file, section_title)
8083

8184
l2_patterns.each do |file|
8285
known_instances_count = count_known_instances(file)
83-
puts "#{known_instances_count} | #{file}" if known_instances_count >= 3
86+
file_display = file.gsub("../../patterns/2-structured/","")
87+
file_link = file.gsub("../../","https://github.com/InnerSourceCommons/InnerSourcePatterns/blob/main/")
88+
89+
puts "#{known_instances_count} | [#{file_display}](#{file_link})"
8490
end

0 commit comments

Comments
 (0)