obsidian-parser 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10a282bce512c7d763d89eed0aedff250e6721cad6e0849af3821dd897e8d819
4
- data.tar.gz: d3271c30ab0f7094b6273b0e8f86b33ec2280729fe757958b61459cc0bca5447
3
+ metadata.gz: 4b8337e7963b9236dcf2e06bcdbe81c44002546ca23b5c30451c3b9b218c7da4
4
+ data.tar.gz: a69df6022fe82cfd016c56a1445c1b5fb23acca02ecd0521c6b455df58df3679
5
5
  SHA512:
6
- metadata.gz: 69cdd0c2c4c6ceb085c9e861d18be91ce3f6b237445f26720bf1787da8448c7ab459c24b4a717d51d1001c7ab9f09b143cb296d28dfee075a869dad9aed10467
7
- data.tar.gz: 9511deca5d2844548218b5a7841912b89469b036db63ad3c879c0e246453bf527cb37c732fc3df4e22dfcba4ea5f24e53340dc8572ac0c9372146ee14fb95805
6
+ metadata.gz: 2b898a0bfabe2aea32d357452b513078bb768be34f5607f07d1c4cbe05d5f9513b8a7c0cdc978995706621964cea01adbe88faf3213c4ff53bb2512b9f42927c
7
+ data.tar.gz: 63697c74da15ee1b4c5897706fdaf6e0ed4b87cea7dfcf1ecc97d2e9c0317d06ed8f6ed821debf6ea23a5f2ca33ccbee3e02271f2328f67c68f121cc86d9292a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.5.2] - 2023-07-30
4
+ - Fix handling of `index.md` at the root level.
5
+
3
6
  ## [0.5.0] - 2023-07-30
4
7
  - Fix ordering of `Page#children` so that index pages come first.
5
8
  - Fix handling of `index.md` documents so that the slug reflects the directory path.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- obsidian-parser (0.5.0)
4
+ obsidian-parser (0.5.2)
5
5
  kramdown (~> 2.4)
6
6
  kramdown-parser-gfm (~> 1.1)
7
7
 
@@ -47,7 +47,11 @@ module Obsidian
47
47
  # are added before their descendents.
48
48
  def add_page(slug, last_modified: nil, content: nil)
49
49
  path_components = slug.split("/")
50
- raise ArgumentError, "Expecting non-empty slug" if path_components.empty?
50
+
51
+ if path_components.empty?
52
+ update_content(content: content, last_modified: last_modified)
53
+ return
54
+ end
51
55
 
52
56
  title = path_components.pop
53
57
 
@@ -88,8 +92,9 @@ module Obsidian
88
92
  end
89
93
 
90
94
  def walk_tree(&block)
95
+ block.call(self)
96
+
91
97
  children.each do |page|
92
- block.call(page)
93
98
  page.walk_tree(&block)
94
99
  end
95
100
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Obsidian
4
4
  class Parser
5
- VERSION = "0.5.0"
5
+ VERSION = "0.5.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obsidian-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat Moore