devcenter-parser 2.3.0 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b85742cc924ff6d0f7e6fe0bcfa49a2eb43277806ea4c0519d0de22a063d0a1
4
- data.tar.gz: 9fa98501c58e7e0de8f37362255310ef4bd69fc51474f286408b3de011c85d48
3
+ metadata.gz: a6be89b82bc3dd6e4a40c3b7f1e3871fca55e301c4ff09f934457d84f01dc00b
4
+ data.tar.gz: 686278e2a9a08bacd5f17124adaaa0d6a3e728a5701814dc9ef15cedecd8a430
5
5
  SHA512:
6
- metadata.gz: a77a54bbc08a84bd8564223f018be4a289dbc00430afec9af0c2b02fcd910d9ce7ed9dde8e90b41aba420352d3f4a405c996f1789d4f71ae7cc3add127860cdb
7
- data.tar.gz: f9240f4cd342028a8ee388bae3ef4913623cbaf1c5e1c75ff27eb9fc0cb6e7e86ca9a01f62aaf9b69500caa7ccff867cb3088e172a9585d878853d62ca7cb97d
6
+ metadata.gz: 1d2cb1e536549ba20c82e76cee60a42d5394872232a815d4ecb0b10fcb29b3d726ec19cc76862e68df78fbd5763173ed6feaa7a3dc4804883f67d78c486b3e32
7
+ data.tar.gz: c3d69be0dedf80b7db4d70c5a0a188e82717207f65d2bd799ba1264a009b2d9c0e25c3ba73d993331927f43b7f64fb35decc85ab33ea65fbb6bb1f46f0108841
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "bundler"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
@@ -0,0 +1,25 @@
1
+ name: "Send data to Components Inventory"
2
+ on:
3
+ workflow_dispatch:
4
+ push:
5
+ branches:
6
+ - "main"
7
+ paths:
8
+ - ".heroku/components-inventory/*.json"
9
+ pull_request:
10
+ types:
11
+ - opened
12
+ - synchronize
13
+ paths:
14
+ - ".heroku/components-inventory/*.json"
15
+ jobs:
16
+ action:
17
+ runs-on: sfdc-hk-ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - name: Send data to Components Inventory
21
+ uses: heroku/components-action@main
22
+ with:
23
+ COMPONENTS_GHA_APP_ID: ${{ secrets.COMPONENTS_GHA_APP_ID}}
24
+ COMPONENTS_GHA_APP_PRIVATE_KEY: ${{ secrets.COMPONENTS_GHA_APP_PRIVATE_KEY}}
25
+ COMPONENTS_GHA_JSON_TOKEN: ${{ secrets.COMPONENTS_GHA_JSON_TOKEN}}
@@ -0,0 +1,32 @@
1
+ {
2
+ "slug": "devcenter-parser",
3
+ "name": "DevCenter Parser",
4
+ "description": "Markdown parser used on Heroku Dev Center",
5
+ "language": "Ruby",
6
+ "lifecycle_status": "Production",
7
+ "pipeline_uuid": null,
8
+ "repository_url": "https://github.com/heroku/devcenter-parser",
9
+ "stack": "Platform",
10
+ "stack_type": "Service",
11
+ "documentation_url": "https://github.com/heroku/devcenter-parser",
12
+ "metrics_url": null,
13
+ "sox": false,
14
+ "soc2": false,
15
+ "customer_facing": false,
16
+ "pager_duty_service_code": null,
17
+ "component_tier": "4",
18
+ "github_actions": true,
19
+ "github_release": false,
20
+ "github_actions_ci_workflow": null,
21
+ "authentication": null,
22
+ "platform": null,
23
+ "team_name": "Marketing Web Ops",
24
+ "planned_maintenance_severity": null,
25
+ "gus_team": "https://gus.lightning.force.com/lightning/r/ADM_Scrum_Team__c/a00B000000Bbl1zIAB/view",
26
+ "pci_tier": "TBD",
27
+ "consumer_type": "N/A",
28
+ "content_cacheable": "N/A",
29
+ "blast_radius": "Internal",
30
+ "audit_findings_url": null,
31
+ "last_audit": null
32
+ }
data/CODEOWNERS ADDED
@@ -0,0 +1,6 @@
1
+ # Lines starting with '#' are comments.
2
+ # Each line is a file pattern followed by one or more owners.
3
+
4
+ # These owners will be the default owners for everything in the repo.
5
+ * @heroku/marketing-web-ops
6
+ * @heroku/front-end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devcenter-parser (2.3.0)
4
+ devcenter-parser (2.4.0)
5
5
  nokogiri (>= 1.13.10)
6
6
  redcarpet (= 3.6.0)
7
7
  sanitize (~> 6.0.2)
@@ -10,12 +10,12 @@ GEM
10
10
  remote: http://rubygems.org/
11
11
  specs:
12
12
  crass (1.0.6)
13
- mini_portile2 (2.8.4)
13
+ mini_portile2 (2.8.5)
14
14
  minitest (5.19.0)
15
- nokogiri (1.15.4)
15
+ nokogiri (1.15.5)
16
16
  mini_portile2 (~> 2.8.2)
17
17
  racc (~> 1.4)
18
- racc (1.7.1)
18
+ racc (1.7.3)
19
19
  rake (13.0.6)
20
20
  redcarpet (3.6.0)
21
21
  sanitize (6.0.2)
@@ -31,4 +31,4 @@ DEPENDENCIES
31
31
  rake
32
32
 
33
33
  BUNDLED WITH
34
- 2.1.4
34
+ 2.2.33
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # devcenter-parser
1
+ # DevCenter Parser
2
2
 
3
3
  Markdown parser used by [Heroku Dev Center](https://devcenter.heroku.com).
4
4
 
@@ -47,11 +47,13 @@ module GitHubParser
47
47
 
48
48
  def self.special_blocks(doc)
49
49
  doc.css('blockquote>p:first').each do |node|
50
- if match = node.inner_html.match(/\A\W*(callout|warning|note)\W/)
50
+ if match = node.inner_html.match(/\A\W*(callout|warning|note)\W|\[\!(callout|warning|note)\]\W/i)
51
51
  node.parent.name = 'div'
52
- node.parent['class'] = match[1]
52
+ node.parent['class'] = match[1].downcase
53
53
 
54
- new_html = node.inner_html.gsub(/\A\W*(callout|warning|note)\W/, '')
54
+ # This expression is slightly different because we want to remove the newline (\n) in this swap, compared to the
55
+ # match above that doesn't care about the newline.
56
+ new_html = node.inner_html.gsub(/\A\s*(callout|warning|note)\s*|\[\!(callout|warning|note)\]\s*/i, '')
55
57
 
56
58
  # Assigning inner_html directly causes encoding issues in old libxml versions,
57
59
  # workaround from https://github.com/sparklemotion/nokogiri/issues/458#issuecomment-3136620
@@ -1,3 +1,3 @@
1
1
  module DevcenterParser
2
- VERSION = '2.3.0'.freeze
2
+ VERSION = '2.4.0'.freeze
3
3
  end
@@ -408,6 +408,35 @@ HTML
408
408
  assert_parsing_result md, html
409
409
  end
410
410
 
411
+ it 'generates blockquotes for GitHub-style callouts in uppercase format' do
412
+ md = <<-MARKDOWN
413
+ > [!WARNING]
414
+ > This is a warning
415
+ MARKDOWN
416
+
417
+ expected = <<-HTML
418
+ <div class="warning">
419
+ <p>This is a warning</p>
420
+ </div>
421
+ HTML
422
+
423
+ assert_parsing_result md, expected
424
+ end
425
+
426
+ it 'generates blockquotes for GitHub-style callouts in lowercase format' do
427
+ md = <<-MARKDOWN
428
+ > [!warning]
429
+ > This is a warning
430
+ MARKDOWN
431
+
432
+ expected = <<-HTML
433
+ <div class="warning">
434
+ <p>This is a warning</p>
435
+ </div>
436
+ HTML
437
+
438
+ assert_parsing_result md, expected
439
+ end
411
440
 
412
441
  it 'generates separate blockquotes from blockquotes separated by empty lines' do
413
442
  md = <<-MARKDOWN
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devcenter-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heroku
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-16 00:00:00.000000000 Z
11
+ date: 2024-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -87,7 +87,11 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".github/dependabot.yml"
91
+ - ".github/workflows/sync_component_metadata.yml"
90
92
  - ".gitignore"
93
+ - ".heroku/components-inventory/devcenter-parser.json"
94
+ - CODEOWNERS
91
95
  - Gemfile
92
96
  - Gemfile.lock
93
97
  - LICENSE
@@ -118,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
122
  - !ruby/object:Gem::Version
119
123
  version: '0'
120
124
  requirements: []
121
- rubygems_version: 3.4.18
125
+ rubygems_version: 3.4.10
122
126
  signing_key:
123
127
  specification_version: 4
124
128
  summary: Parser for Heroku Dev Center's content