raindown 0.12.0 → 0.14.0

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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elements.rb +12 -25
  3. data/lib/lexemes/node_lexeme.rb +37 -0
  4. data/lib/nodes/list_node.rb +22 -25
  5. data/lib/nodes/write_in_node.rb +95 -0
  6. data/lib/raindown/bare_directives.rb +11 -17
  7. data/lib/raindown/chart/chart.rb +1 -1
  8. data/lib/raindown/code_blocks.rb +23 -15
  9. data/lib/raindown/context.rb +19 -0
  10. data/lib/raindown/directives.rb +1 -1
  11. data/lib/raindown/document.rb +9 -9
  12. data/lib/raindown/endpoint/endpoint_runner.rb +15 -24
  13. data/lib/raindown/fragments.rb +6 -1
  14. data/lib/raindown/js/host.mjs +2 -2
  15. data/lib/raindown/js/js_nodes.rb +4 -4
  16. data/lib/raindown/list.rb +31 -0
  17. data/lib/raindown/markdown_nodes.rb +3 -2
  18. data/lib/raindown/node.rb +10 -2
  19. data/lib/raindown/node_blocks.rb +28 -27
  20. data/lib/raindown/node_injector.rb +7 -1
  21. data/lib/raindown/nodes.rb +61 -21
  22. data/lib/raindown/pages.rb +14 -8
  23. data/lib/raindown/pre_renderer.rb +13 -10
  24. data/lib/raindown/stat.rb +1 -1
  25. data/lib/raindown/table/markdown_table.rb +35 -0
  26. data/lib/raindown/table/table.rb +87 -0
  27. data/lib/raindown/toc.rb +2 -2
  28. data/lib/raindown/tui/cloud.rb +154 -0
  29. data/lib/raindown/tui/feelings/celebration/celebration_renderer.rb +22 -0
  30. data/lib/raindown/tui/feelings/feelings_renderer.rb +3 -16
  31. data/lib/raindown/tui/layout.rb +8 -1
  32. data/lib/raindown/tui/project.rb +23 -11
  33. data/lib/raindown/tui/renderers/endpoint_renderer.rb +4 -3
  34. data/lib/raindown/tui/terminal/loading.rb +34 -0
  35. data/lib/raindown/tui/terminal/screen.rb +6 -5
  36. data/lib/raindown/tui/terminal/styles.rb +13 -1
  37. data/lib/raindown/tui/views/endpoint_view.rb +5 -4
  38. data/lib/raindown/tui.rb +10 -6
  39. data/lib/raindown/wiki_links.rb +1 -1
  40. data/lib/raindown.rb +9 -14
  41. data/lib/version.rb +1 -1
  42. metadata +11 -5
  43. data/lib/lexemes/list_lexeme.rb +0 -32
  44. data/lib/nodes/component_nodes.rb +0 -38
  45. data/lib/raindown/files.rb +0 -22
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raindown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - maedi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-11-04 00:00:00.000000000 Z
10
+ date: 2026-11-06 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: antlers
@@ -204,10 +204,10 @@ files:
204
204
  - bin/raindown
205
205
  - lib/elements.rb
206
206
  - lib/lexemes/endpoint_lexeme.rb
207
- - lib/lexemes/list_lexeme.rb
208
- - lib/nodes/component_nodes.rb
207
+ - lib/lexemes/node_lexeme.rb
209
208
  - lib/nodes/endpoint_node.rb
210
209
  - lib/nodes/list_node.rb
210
+ - lib/nodes/write_in_node.rb
211
211
  - lib/raindown.rb
212
212
  - lib/raindown/actions.rb
213
213
  - lib/raindown/bare_directives.rb
@@ -223,6 +223,7 @@ files:
223
223
  - lib/raindown/code.rb
224
224
  - lib/raindown/code_blocks.rb
225
225
  - lib/raindown/config.rb
226
+ - lib/raindown/context.rb
226
227
  - lib/raindown/directives.rb
227
228
  - lib/raindown/document.rb
228
229
  - lib/raindown/editing.rb
@@ -232,13 +233,13 @@ files:
232
233
  - lib/raindown/endpoint/endpoint_runner.rb
233
234
  - lib/raindown/endpoint/endpoint_variables.rb
234
235
  - lib/raindown/endpoint/schema_block.rb
235
- - lib/raindown/files.rb
236
236
  - lib/raindown/fragments.rb
237
237
  - lib/raindown/front_matter.rb
238
238
  - lib/raindown/gitignore.rb
239
239
  - lib/raindown/heading_ids.rb
240
240
  - lib/raindown/js/host.mjs
241
241
  - lib/raindown/js/js_nodes.rb
242
+ - lib/raindown/list.rb
242
243
  - lib/raindown/markdown_nodes.rb
243
244
  - lib/raindown/node.rb
244
245
  - lib/raindown/node_blocks.rb
@@ -251,6 +252,8 @@ files:
251
252
  - lib/raindown/rewriter.rb
252
253
  - lib/raindown/server.rb
253
254
  - lib/raindown/stat.rb
255
+ - lib/raindown/table/markdown_table.rb
256
+ - lib/raindown/table/table.rb
254
257
  - lib/raindown/table_formatter.rb
255
258
  - lib/raindown/toc.rb
256
259
  - lib/raindown/tui.rb
@@ -262,6 +265,7 @@ files:
262
265
  - lib/raindown/tui/blueprints/traced_code.rb
263
266
  - lib/raindown/tui/blueprints/tracing.rb
264
267
  - lib/raindown/tui/card.rb
268
+ - lib/raindown/tui/cloud.rb
265
269
  - lib/raindown/tui/code_box.rb
266
270
  - lib/raindown/tui/endpoint.rb
267
271
  - lib/raindown/tui/endpoints.rb
@@ -269,6 +273,7 @@ files:
269
273
  - lib/raindown/tui/feelings/batch.rb
270
274
  - lib/raindown/tui/feelings/bins.rb
271
275
  - lib/raindown/tui/feelings/celebration/celebration.rb
276
+ - lib/raindown/tui/feelings/celebration/celebration_renderer.rb
272
277
  - lib/raindown/tui/feelings/celebration/fireworks.rb
273
278
  - lib/raindown/tui/feelings/celebration/rain.rb
274
279
  - lib/raindown/tui/feelings/celebration/scene.rb
@@ -308,6 +313,7 @@ files:
308
313
  - lib/raindown/tui/saves.rb
309
314
  - lib/raindown/tui/search_box.rb
310
315
  - lib/raindown/tui/terminal/input.rb
316
+ - lib/raindown/tui/terminal/loading.rb
311
317
  - lib/raindown/tui/terminal/ncurses_shim.rb
312
318
  - lib/raindown/tui/terminal/quiet.rb
313
319
  - lib/raindown/tui/terminal/screen.rb
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'antlers/api'
4
-
5
- module Raindown
6
- module ListLexeme
7
- include Antlers::Lexeme
8
-
9
- module_function
10
-
11
- KEYWORDS = ['list:', 'folder:', 'order:', ':list'].freeze
12
-
13
- def match?(keywords:, **)
14
- KEYWORDS.include?(keywords.keys.first)
15
- end
16
-
17
- def lexeme(keywords:, **)
18
- if keywords['list:']
19
- *key, value = keywords['list:'].split(',').map(&:strip)
20
-
21
- list_def = { list_def: value, folder: keywords['folder:'] }
22
- list_def[:order] = keywords['order:'] if keywords['order:']
23
- list_def[:key] = key.first unless key.empty?
24
-
25
- return list_def
26
- end
27
-
28
- # TODO: Keep track of which list loop we're in to allow nested list loops.
29
- { list_end: 'level_1' }
30
- end
31
- end
32
- end
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'antlers/api'
4
- require 'nodes/html_node'
5
- require 'nodes/prop_node'
6
- require 'nodes/slot_node'
7
- require_relative '../raindown/fragments'
8
-
9
- module Raindown
10
- # <{ Card name=p.name }>, rendered by Antlers where it is in the template, so its props see loop variables.
11
- # Its HTML is kept as a fragment, so Commonmarker doesn't read it as Markdown.
12
- class PropComponentNode < Antlers::PropNode
13
- def render(**)
14
- Fragments.add(super)
15
- end
16
- end
17
-
18
- # <{ Card: }>...<{ :Card }>, whose slot is its own Markdown, rendered to HTML in its scope first.
19
- #
20
- # Markdown children -> rendered to a Markdown string -> Commonmarker -> HTML
21
- # -> wrapped as a single Antlers::HTMLNode (replaces @children for the super call)
22
- # -> Antlers::SlotNode#render's "without a template" branch -> slot: receives that HTML
23
- # -> Card#render(slot:, **props)
24
- #
25
- # This only reaches Card#render directly when Card has no class-level template (see SlotNode#render);
26
- # otherwise Antlers renders Card's own template instead, with this HTML passed to it as the slot_node.
27
- class SlotComponentNode < Antlers::SlotNode
28
- def render(current_binding: nil, parent_binding: nil, slot_node: nil, metadata: {})
29
- markdown = @children.map { |child| child.render(current_binding:, parent_binding:, slot_node:, metadata:) || '' }.join
30
- children = @children
31
- @children = [Antlers::HTMLNode.new(html: Raindown.commonmark(markdown))]
32
-
33
- Fragments.add(super)
34
- ensure
35
- @children = children if children
36
- end
37
- end
38
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'node'
4
-
5
- module Raindown
6
- # The node behind files:, a list of links to the files the metadata has for its props, like files: folder: 'notes'.
7
- # A project can change how files are listed with its own Files node in .raindown, like "class Files < Raindown::Files".
8
- class Files < Node
9
- def initialize(**tags)
10
- @tags = tags
11
- end
12
-
13
- # Each file has its front matter, its path and its content.
14
- def files(metadata: NoMetadata)
15
- metadata.list(**@tags)
16
- end
17
-
18
- def replace(metadata: NoMetadata)
19
- files(metadata:).map { |file| "- [#{file.title || file.path}](#{file.path})" }.join("\n")
20
- end
21
- end
22
- end