obsidian-parser 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/obsidian/parser/version.rb +1 -1
- data/lib/obsidian/parser.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 347ae1e2c1152ccae4ae2ad6a19c4477ae07a8dca77dcfd73d1e31da823cf5f6
|
4
|
+
data.tar.gz: 4d2257fd34be583429baf260e3136ca6cdf6cdb4d66fbd592abc396e81a32dfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99cfb58610e351574d4ca83faa28b90117ae63a2d219151f005d87e365ee80704d44759c2610cd6bf9b8301fec0ffeb4245d112231fa9ace90202283ad094758
|
7
|
+
data.tar.gz: a032cb2063e781db38c5ecafbe13f047d36e16cb5d71cf4c6b8558e40a6867d20b510a25aabbfe2201f5ce45a80a0ca7c729f1c5bd3e78f8030f01be812f61ac
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/obsidian/parser.rb
CHANGED
@@ -23,12 +23,13 @@ module Obsidian
|
|
23
23
|
end
|
24
24
|
|
25
25
|
class Note
|
26
|
-
def initialize(title, slug, last_modified, content: nil)
|
26
|
+
def initialize(title, slug, last_modified, content: nil, parent: nil)
|
27
27
|
# TODO: check frontmatter for titles as well
|
28
28
|
@title = title
|
29
29
|
@slug = slug
|
30
30
|
@last_modified = last_modified
|
31
31
|
@content = content
|
32
|
+
@parent = parent
|
32
33
|
end
|
33
34
|
|
34
35
|
def inspect
|
@@ -39,6 +40,7 @@ module Obsidian
|
|
39
40
|
attr_reader :slug
|
40
41
|
attr_reader :last_modified
|
41
42
|
attr_reader :content
|
43
|
+
attr_reader :parent
|
42
44
|
end
|
43
45
|
|
44
46
|
class Index
|
@@ -58,9 +60,11 @@ module Obsidian
|
|
58
60
|
def add_note(title, parent_slug, last_modified, content: nil)
|
59
61
|
slug = Obsidian.build_slug(title, parent_slug)
|
60
62
|
directory = nested_directory(parent_slug.split("/"))
|
61
|
-
note = Note.new(title, slug, last_modified, content: content)
|
63
|
+
note = Note.new(title, slug, last_modified, content: content, parent: directory)
|
62
64
|
|
63
65
|
directory.notes << note
|
66
|
+
|
67
|
+
note
|
64
68
|
end
|
65
69
|
|
66
70
|
def inspect
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: obsidian-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|