diff options
author | pdp8 <pdp8@pdp8.info> | 2023-07-30 15:07:28 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-07-30 15:07:28 +0200 |
commit | 3a8be7b1606885b3b94bc22a6d775a6527e1c07d (patch) | |
tree | 3aed49446c69d4a0c66e5f2eb6fca7ca181ef80e /helpers.rb | |
parent | fbd4fccc70622e664e2f795315c848d68aed365e (diff) |
note parsing, tag links
Diffstat (limited to 'helpers.rb')
-rw-r--r-- | helpers.rb | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -135,4 +135,10 @@ helpers do type = extensions.find { |_k, v| v.include? ext } "#{type[0]}/#{ext}" end + + def find_file(id) + Dir[File.join('*', 'object', '*', '*.json')].find do |f| + JSON.parse(File.read(f))['id'] == id + end + end end |