spreen-wiki 0.1.0 → 0.2.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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -7
  3. data/exe/spreen +2 -2
  4. data/lib/spreen-wiki.rb +2 -2
  5. data/lib/spreen_wiki/application.rb +149 -0
  6. data/lib/spreen_wiki/cli.rb +157 -0
  7. data/lib/spreen_wiki/configuration.rb +215 -0
  8. data/lib/spreen_wiki/home.rb +100 -0
  9. data/lib/spreen_wiki/sidebar.rb +48 -0
  10. data/lib/spreen_wiki/unknown_wiki_count_list_exporter.rb +59 -0
  11. data/lib/spreen_wiki/unknown_wiki_list_exporter_for_llm.rb +51 -0
  12. data/lib/{spreen/wiki → spreen_wiki}/version.rb +2 -4
  13. data/lib/spreen_wiki.rb +18 -0
  14. data/sig/generated/spreen_wiki/application.rbs +91 -0
  15. data/sig/generated/spreen_wiki/cli.rbs +68 -0
  16. data/sig/generated/spreen_wiki/configuration.rbs +148 -0
  17. data/sig/generated/spreen_wiki/home.rbs +52 -0
  18. data/sig/generated/spreen_wiki/sidebar.rbs +29 -0
  19. data/sig/generated/spreen_wiki/unknown_wiki_count_list_exporter.rbs +38 -0
  20. data/sig/generated/spreen_wiki/unknown_wiki_list_exporter_for_llm.rbs +35 -0
  21. data/sig/generated/spreen_wiki/version.rbs +5 -0
  22. data/sig/generated/spreen_wiki.rbs +8 -0
  23. metadata +23 -23
  24. data/lib/spreen/wiki/application.rb +0 -151
  25. data/lib/spreen/wiki/cli.rb +0 -159
  26. data/lib/spreen/wiki/configuration.rb +0 -217
  27. data/lib/spreen/wiki/home.rb +0 -102
  28. data/lib/spreen/wiki/sidebar.rb +0 -50
  29. data/lib/spreen/wiki/unknown_wiki_count_list_exporter.rb +0 -61
  30. data/lib/spreen/wiki/unknown_wiki_list_exporter_for_llm.rb +0 -53
  31. data/lib/spreen/wiki.rb +0 -20
  32. data/sig/generated/spreen/wiki/application.rbs +0 -93
  33. data/sig/generated/spreen/wiki/cli.rbs +0 -70
  34. data/sig/generated/spreen/wiki/configuration.rbs +0 -150
  35. data/sig/generated/spreen/wiki/home.rbs +0 -54
  36. data/sig/generated/spreen/wiki/sidebar.rbs +0 -31
  37. data/sig/generated/spreen/wiki/unknown_wiki_count_list_exporter.rbs +0 -40
  38. data/sig/generated/spreen/wiki/unknown_wiki_list_exporter_for_llm.rbs +0 -37
  39. data/sig/generated/spreen/wiki/version.rbs +0 -7
  40. data/sig/generated/spreen/wiki.rbs +0 -10
  41. /data/lib/{spreen/wiki → spreen_wiki}/templates/category/english.md +0 -0
  42. /data/lib/{spreen/wiki → spreen_wiki}/templates/category/japanese.md +0 -0
  43. /data/lib/{spreen/wiki → spreen_wiki}/templates/owner/english.md +0 -0
  44. /data/lib/{spreen/wiki → spreen_wiki}/templates/owner/japanese.md +0 -0
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+ # rbs_inline: enabled
3
+
4
+ require_relative 'application'
5
+
6
+ module SpreenWiki
7
+ # Generates the wiki _Sidebar.md as a nested list of owners/categories and
8
+ # their wiki pages.
9
+ class Sidebar < Application
10
+ # @rbs return: void
11
+ def run
12
+ update_wiki_list
13
+ File.write(path_to_sidebar, wiki_list.join)
14
+ end
15
+
16
+ private
17
+
18
+ # @rbs return: Array[String]
19
+ def wiki_list
20
+ @wiki_list ||= []
21
+ end
22
+
23
+ # @rbs return: void
24
+ def update_wiki_list
25
+ owned_wiki_maps.each { |namespace, wikis| append_section(namespace, wikis, owned: true) }
26
+ plain_wiki_maps.each { |namespace, wikis| append_section(namespace, wikis, owned: false) }
27
+ end
28
+
29
+ # @rbs namespace: String
30
+ # @rbs wikis: Array[String]
31
+ # @rbs owned: bool
32
+ # @rbs return: void
33
+ def append_section(namespace, wikis, owned:)
34
+ wiki_list << "#{section_heading(namespace, owned:)}\n"
35
+ wikis.each { |wiki| wiki_list << " - [[#{wiki.gsub('.md', '')}]]\n" }
36
+ end
37
+
38
+ # @rbs namespace: String
39
+ # @rbs owned: bool
40
+ # @rbs return: String
41
+ def section_heading(namespace, owned:)
42
+ owner_base_url = config.owner_base_url
43
+ return "- #{namespace}" unless owned && owner_base_url
44
+
45
+ "- [#{namespace}](#{owner_base_url + namespace.delete('@')})"
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+ # rbs_inline: enabled
3
+
4
+ require_relative 'application'
5
+
6
+ module SpreenWiki
7
+ # Writes a sorted text report of how many wikis exist under each of the
8
+ # configured "unknown owner/category" namespaces.
9
+ class UnknownWikiCountListExporter < Application
10
+ DEFAULT_OUTPUT_FILENAME = 'unknown_wiki_count_list_by_namespace.txt'
11
+
12
+ # @rbs base_path: String
13
+ # @rbs group_by: String
14
+ # @rbs language: String
15
+ # @rbs home_overflow: (bool | String)
16
+ # @rbs output: String?
17
+ # @rbs **options: untyped
18
+ # @rbs return: void
19
+ def initialize(base_path: Dir.pwd, group_by: 'Owner', language: 'English', home_overflow: 'false',
20
+ output: nil, **)
21
+ super(base_path:, group_by:, language:, home_overflow:, **)
22
+ @path_to_export = resolve_output_path(output || DEFAULT_OUTPUT_FILENAME)
23
+ end
24
+
25
+ # @rbs return: [Array[String], String]
26
+ def run
27
+ File.open(path_to_export, 'wb') { |f| f.puts(count_list_by_namespace) }
28
+ [count_list_by_namespace, path_to_export]
29
+ end
30
+
31
+ private
32
+
33
+ attr_reader :path_to_export #: String
34
+
35
+ # @rbs filename: String
36
+ # @rbs return: String
37
+ def resolve_output_path(filename)
38
+ File.absolute_path?(filename) ? filename : File.join(base_path, filename)
39
+ end
40
+
41
+ # @rbs return: Array[String]
42
+ def namespace_list
43
+ config.unknown_namespaces(group_by, language)
44
+ end
45
+
46
+ # @rbs return: Array[String]
47
+ def missing_count_list_by_namespace
48
+ (namespace_list - plain_wiki_maps.keys).map { |namespace| "#{namespace}: 0" }
49
+ end
50
+
51
+ # @rbs return: Array[String]
52
+ def count_list_by_namespace
53
+ @count_list_by_namespace ||= begin
54
+ counts = plain_wiki_maps.slice(*namespace_list).map { |namespace, wikis| "#{namespace}: #{wikis.length}" }
55
+ (counts + missing_count_list_by_namespace).sort
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+ # rbs_inline: enabled
3
+
4
+ require_relative 'application'
5
+
6
+ module SpreenWiki
7
+ # Writes a flat list of the wikis under the configured "unknown
8
+ # owner/category" namespace in a form suitable for feeding to an LLM.
9
+ class UnknownWikiListExporterForLLM < Application
10
+ DEFAULT_OUTPUT_FILENAME = 'unknown_wiki_list_for_llm.txt'
11
+
12
+ # @rbs base_path: String
13
+ # @rbs group_by: String
14
+ # @rbs language: String
15
+ # @rbs home_overflow: (bool | String)
16
+ # @rbs output: String?
17
+ # @rbs **options: untyped
18
+ # @rbs return: void
19
+ def initialize(base_path: Dir.pwd, group_by: 'Owner', language: 'English', home_overflow: 'false',
20
+ output: nil, **)
21
+ super(base_path:, group_by:, language:, home_overflow:, **)
22
+ @path_to_export = resolve_output_path(output || DEFAULT_OUTPUT_FILENAME)
23
+ end
24
+
25
+ # @rbs return: String
26
+ def run
27
+ File.open(path_to_export, 'wb') { |f| f.puts(unknown_wiki_list_for_llm) }
28
+ path_to_export
29
+ end
30
+
31
+ private
32
+
33
+ attr_reader :path_to_export #: String
34
+
35
+ # @rbs filename: String
36
+ # @rbs return: String
37
+ def resolve_output_path(filename)
38
+ File.absolute_path?(filename) ? filename : File.join(base_path, filename)
39
+ end
40
+
41
+ # @rbs return: String
42
+ def target_namespace
43
+ config.llm_target_namespace(group_by, language)
44
+ end
45
+
46
+ # @rbs return: Array[String]
47
+ def unknown_wiki_list_for_llm
48
+ @unknown_wiki_list_for_llm ||= plain_wiki_maps.slice(target_namespace).values.flatten
49
+ end
50
+ end
51
+ end
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  # rbs_inline: enabled
3
3
 
4
- module Spreen
5
- module Wiki
6
- VERSION = '0.1.0'
7
- end
4
+ module SpreenWiki
5
+ VERSION = '0.2.0'
8
6
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+ # rbs_inline: enabled
3
+
4
+ require_relative 'spreen_wiki/version'
5
+ require_relative 'spreen_wiki/configuration'
6
+ require_relative 'spreen_wiki/application'
7
+ require_relative 'spreen_wiki/home'
8
+ require_relative 'spreen_wiki/sidebar'
9
+ require_relative 'spreen_wiki/unknown_wiki_count_list_exporter'
10
+ require_relative 'spreen_wiki/unknown_wiki_list_exporter_for_llm'
11
+ require_relative 'spreen_wiki/cli'
12
+
13
+ # Spreens a GitHub wiki — the falcon's stoop, then the preen: generates
14
+ # Home.md and _Sidebar.md grouped by the Owner/Category declared on the
15
+ # first line of each page, and exports reports of the pages whose owner
16
+ # or category is unknown.
17
+ module SpreenWiki
18
+ end
@@ -0,0 +1,91 @@
1
+ # Generated from lib/spreen_wiki/application.rb with RBS::Inline
2
+
3
+ module SpreenWiki
4
+ # Base class for the wiki-organising commands. Loads the wiki tree under
5
+ # base_path, groups it by Owner or Category in either English or Japanese,
6
+ # and exposes the resulting maps to its subclasses. Grouping criteria,
7
+ # languages and labels are resolved through Configuration and can be
8
+ # extended via a `.spreen.yml` file.
9
+ class Application
10
+ class NotImplementedError < StandardError
11
+ end
12
+
13
+ # @rbs base_path: String
14
+ # @rbs group_by: String
15
+ # @rbs language: String
16
+ # @rbs home_overflow: (bool | String)
17
+ # @rbs **options: untyped
18
+ # @rbs return: untyped
19
+ def self.run: (?base_path: String, ?group_by: String, ?language: String, ?home_overflow: bool | String, **untyped) -> untyped
20
+
21
+ # @rbs base_path: String
22
+ # @rbs group_by: String
23
+ # @rbs language: String
24
+ # @rbs home_overflow: (bool | String)
25
+ # @rbs config: Configuration?
26
+ # @rbs **options: untyped
27
+ # @rbs return: void
28
+ def initialize: (?base_path: String, ?group_by: String, ?language: String, ?home_overflow: bool | String, ?config: Configuration?, **untyped) -> void
29
+
30
+ # @rbs return: void
31
+ def validate!: () -> void
32
+
33
+ # @rbs return: untyped
34
+ def run: () -> untyped
35
+
36
+ private
37
+
38
+ attr_reader base_path: untyped
39
+
40
+ attr_reader group_by: untyped
41
+
42
+ attr_reader language: untyped
43
+
44
+ attr_reader home_overflow: untyped
45
+
46
+ attr_reader config: untyped
47
+
48
+ attr_reader path_to_home: untyped
49
+
50
+ attr_reader path_to_sidebar: untyped
51
+
52
+ attr_reader paths_to_wikis: untyped
53
+
54
+ attr_reader excluded_paths: untyped
55
+
56
+ # @rbs return: void
57
+ def validate_home_overflow!: () -> void
58
+
59
+ # @rbs raw: (bool | String)
60
+ # @rbs return: (bool | String)
61
+ def parse_home_overflow: (bool | String raw) -> (bool | String)
62
+
63
+ # @rbs return: Array[String]
64
+ def target_paths: () -> Array[String]
65
+
66
+ # @rbs return: Regexp
67
+ def target_regexp: () -> Regexp
68
+
69
+ # @rbs return: String
70
+ def no_declaration: () -> String
71
+
72
+ # @rbs return: Hash[String, Array[String]]
73
+ def wiki_maps_with_namespace: () -> Hash[String, Array[String]]
74
+
75
+ # @rbs target_path: String
76
+ # @rbs named: Hash[String, Array[String]]
77
+ # @rbs undeclared: Hash[String, Array[String]]
78
+ # @rbs return: void
79
+ def populate_namespace: (String target_path, Hash[String, Array[String]] named, Hash[String, Array[String]] undeclared) -> void
80
+
81
+ # @rbs target_path: String
82
+ # @rbs return: String
83
+ def namespace_for: (String target_path) -> String
84
+
85
+ # @rbs return: Hash[String, Array[String]]
86
+ def owned_wiki_maps: () -> Hash[String, Array[String]]
87
+
88
+ # @rbs return: Hash[String, Array[String]]
89
+ def plain_wiki_maps: () -> Hash[String, Array[String]]
90
+ end
91
+ end
@@ -0,0 +1,68 @@
1
+ # Generated from lib/spreen_wiki/cli.rb with RBS::Inline
2
+
3
+ module SpreenWiki
4
+ # Command line interface behind the `spreen` executable:
5
+ # `spreen <update|count-report|llm-export> [options]`.
6
+ class CLI
7
+ HELP: ::String
8
+
9
+ # Flags shared by every command, mapped to the keyword arguments of the
10
+ # underlying classes. --exclude and the per-command flags are wired up
11
+ # separately because they need a type or a fixed value.
12
+ COMMON_OPTIONS: untyped
13
+
14
+ # @rbs argv: Array[String]
15
+ # @rbs return: Integer
16
+ def self.start: (?Array[String] argv) -> Integer
17
+
18
+ # @rbs argv: Array[String]
19
+ # @rbs return: void
20
+ def initialize: (Array[String] argv) -> void
21
+
22
+ # @rbs return: Integer
23
+ def run: () -> Integer
24
+
25
+ private
26
+
27
+ attr_reader argv: untyped
28
+
29
+ attr_reader options: untyped
30
+
31
+ # @rbs command: String
32
+ # @rbs return: Integer
33
+ def execute: (String command) -> Integer
34
+
35
+ # @rbs return: Integer
36
+ def print_version: () -> Integer
37
+
38
+ # @rbs command: String?
39
+ # @rbs return: Integer
40
+ def print_help: (String? command) -> Integer
41
+
42
+ # @rbs command: String
43
+ # @rbs return: Integer
44
+ def unknown_command: (String command) -> Integer
45
+
46
+ # @rbs return: void
47
+ def update: () -> void
48
+
49
+ # @rbs return: void
50
+ def count_report: () -> void
51
+
52
+ # @rbs return: void
53
+ def llm_export: () -> void
54
+
55
+ # @rbs command: String
56
+ # @rbs return: OptionParser
57
+ def parser: (String command) -> OptionParser
58
+
59
+ # @rbs opt: OptionParser
60
+ # @rbs return: void
61
+ def add_common_options: (OptionParser opt) -> void
62
+
63
+ # @rbs opt: OptionParser
64
+ # @rbs command: String
65
+ # @rbs return: void
66
+ def add_command_options: (OptionParser opt, String command) -> void
67
+ end
68
+ end
@@ -0,0 +1,148 @@
1
+ # Generated from lib/spreen_wiki/configuration.rb with RBS::Inline
2
+
3
+ module SpreenWiki
4
+ # Resolves the runtime configuration for a wiki checkout. Every value is
5
+ # looked up with the same precedence: explicit keyword argument, then the
6
+ # `.spreen.yml` file under base_path (or config_path), then the
7
+ # ORGANISATION_NAME environment variable (organisation only), then the
8
+ # built-in defaults.
9
+ class Configuration
10
+ CONFIG_FILENAME: ::String
11
+
12
+ EMPTY_HASH: Hash[String, untyped]
13
+
14
+ DEFAULT_TEMPLATE_DIR: untyped
15
+
16
+ DEFAULT_EXCLUDED_DIRS: untyped
17
+
18
+ # Built-in labels: how the first line of a wiki page is parsed (regexp),
19
+ # which namespace collects pages without a declaration (no_declaration),
20
+ # which namespaces the count report covers (unknown_namespaces) and which
21
+ # namespace the LLM export targets (llm_target_namespace). A config file
22
+ # can override any of these, add languages or add group_by criteria.
23
+ DEFAULT_LABELS: untyped
24
+
25
+ attr_reader organisation: untyped
26
+
27
+ attr_reader repository: untyped
28
+
29
+ attr_reader wiki_url: untyped
30
+
31
+ attr_reader owner_base_url: untyped
32
+
33
+ attr_reader excluded_dirs: untyped
34
+
35
+ attr_reader template_dir: untyped
36
+
37
+ @organisation: String?
38
+
39
+ @repository: String?
40
+
41
+ @wiki_url: String?
42
+
43
+ @owner_base_url: String?
44
+
45
+ @excluded_dirs: Array[String]
46
+
47
+ @template_dir: String
48
+
49
+ @file: Hash[String, untyped]
50
+
51
+ @labels: Hash[String, untyped]
52
+
53
+ # @rbs base_path: String
54
+ # @rbs config_path: String?
55
+ # @rbs organisation: String?
56
+ # @rbs repository: String?
57
+ # @rbs wiki_url: String?
58
+ # @rbs owner_base_url: String?
59
+ # @rbs excluded_dirs: Array[String]?
60
+ # @rbs template_dir: String?
61
+ # @rbs return: void
62
+ def initialize: (base_path: String, ?config_path: String?, ?organisation: String?, ?repository: String?, ?wiki_url: String?, ?owner_base_url: String?, ?excluded_dirs: Array[String]?, ?template_dir: String?) -> void
63
+
64
+ # @rbs return: Array[String]
65
+ def group_bys: () -> Array[String]
66
+
67
+ # @rbs group_by: String
68
+ # @rbs return: Array[String]
69
+ def languages: (String group_by) -> Array[String]
70
+
71
+ # @rbs group_by: String
72
+ # @rbs return: Regexp
73
+ def target_regexp: (String group_by) -> Regexp
74
+
75
+ # @rbs group_by: String
76
+ # @rbs language: String
77
+ # @rbs return: String
78
+ def no_declaration: (String group_by, String language) -> String
79
+
80
+ # @rbs group_by: String
81
+ # @rbs language: String
82
+ # @rbs return: Array[String]
83
+ def unknown_namespaces: (String group_by, String language) -> Array[String]
84
+
85
+ # @rbs group_by: String
86
+ # @rbs language: String
87
+ # @rbs return: String
88
+ def llm_target_namespace: (String group_by, String language) -> String
89
+
90
+ # @rbs group_by: String
91
+ # @rbs language: String
92
+ # @rbs return: String
93
+ def path_to_template: (String group_by, String language) -> String
94
+
95
+ private
96
+
97
+ attr_reader file: untyped
98
+
99
+ attr_reader labels: untyped
100
+
101
+ # Treats empty strings the same as nil so that callers can pass values
102
+ # straight from optional environment variables or CLI flags.
103
+ # @rbs value: String?
104
+ # @rbs return: String?
105
+ def presence: (String? value) -> String?
106
+
107
+ # @rbs explicit: String?
108
+ # @rbs key: String
109
+ # @rbs return: String?
110
+ def resolve: (String? explicit, String key) -> String?
111
+
112
+ # @rbs explicit: String?
113
+ # @rbs return: String?
114
+ def resolve_organisation: (String? explicit) -> String?
115
+
116
+ # @rbs explicit: String?
117
+ # @rbs return: String?
118
+ def resolve_wiki_url: (String? explicit) -> String?
119
+
120
+ # @rbs explicit: String?
121
+ # @rbs return: String?
122
+ def resolve_owner_base_url: (String? explicit) -> String?
123
+
124
+ # @rbs path: String
125
+ # @rbs return: Hash[String, untyped]
126
+ def load_file: (String path) -> Hash[String, untyped]
127
+
128
+ # @rbs group_by: String
129
+ # @rbs return: Hash[String, untyped]
130
+ def label_for: (String group_by) -> Hash[String, untyped]
131
+
132
+ # @rbs group_by: String
133
+ # @rbs language: String
134
+ # @rbs return: Hash[String, untyped]
135
+ def language_labels: (String group_by, String language) -> Hash[String, untyped]
136
+
137
+ # @rbs return: String?
138
+ def default_wiki_url: () -> String?
139
+
140
+ # @rbs return: String?
141
+ def default_owner_base_url: () -> String?
142
+
143
+ # @rbs base: Hash[String, untyped]
144
+ # @rbs override: Hash[String, untyped]
145
+ # @rbs return: Hash[String, untyped]
146
+ def deep_merge: (Hash[String, untyped] base, Hash[String, untyped] override) -> Hash[String, untyped]
147
+ end
148
+ end
@@ -0,0 +1,52 @@
1
+ # Generated from lib/spreen_wiki/home.rb with RBS::Inline
2
+
3
+ module SpreenWiki
4
+ # Generates the wiki Home page, optionally splitting per-owner content out
5
+ # into `wikis-by-owner/<owner>.md` when home_overflow is enabled. Returns
6
+ # the configured wiki URL (if any) so callers can point at the result.
7
+ class Home < Application
8
+ # @rbs return: String?
9
+ def run: () -> String?
10
+
11
+ private
12
+
13
+ # @rbs return: String
14
+ def path_to_wikis_by_owner: () -> String
15
+
16
+ # @rbs return: String
17
+ def path_to_home_template: () -> String
18
+
19
+ # @rbs return: Array[String]
20
+ def home_passage: () -> Array[String]
21
+
22
+ # @rbs return: void
23
+ def write_home_passage: () -> void
24
+
25
+ # @rbs return: void
26
+ def write_concise_home_passage: () -> void
27
+
28
+ # @rbs return: void
29
+ def write_per_namespace_files: () -> void
30
+
31
+ # @rbs return: void
32
+ def write_home_table_of_contents: () -> void
33
+
34
+ # @rbs passage: Array[String]
35
+ # @rbs namespace: String
36
+ # @rbs wikis: Array[String]
37
+ # @rbs owned: bool
38
+ # @rbs return: void
39
+ def append_block: (Array[String] passage, String namespace, Array[String] wikis, owned: bool) -> void
40
+
41
+ # @rbs namespace: String
42
+ # @rbs wikis: Array[String]
43
+ # @rbs owned: bool
44
+ # @rbs return: void
45
+ def write_overflow_block: (String namespace, Array[String] wikis, owned: bool) -> void
46
+
47
+ # @rbs namespace: String
48
+ # @rbs owned: bool
49
+ # @rbs return: String
50
+ def heading_for: (String namespace, owned: bool) -> String
51
+ end
52
+ end
@@ -0,0 +1,29 @@
1
+ # Generated from lib/spreen_wiki/sidebar.rb with RBS::Inline
2
+
3
+ module SpreenWiki
4
+ # Generates the wiki _Sidebar.md as a nested list of owners/categories and
5
+ # their wiki pages.
6
+ class Sidebar < Application
7
+ # @rbs return: void
8
+ def run: () -> void
9
+
10
+ private
11
+
12
+ # @rbs return: Array[String]
13
+ def wiki_list: () -> Array[String]
14
+
15
+ # @rbs return: void
16
+ def update_wiki_list: () -> void
17
+
18
+ # @rbs namespace: String
19
+ # @rbs wikis: Array[String]
20
+ # @rbs owned: bool
21
+ # @rbs return: void
22
+ def append_section: (String namespace, Array[String] wikis, owned: bool) -> void
23
+
24
+ # @rbs namespace: String
25
+ # @rbs owned: bool
26
+ # @rbs return: String
27
+ def section_heading: (String namespace, owned: bool) -> String
28
+ end
29
+ end
@@ -0,0 +1,38 @@
1
+ # Generated from lib/spreen_wiki/unknown_wiki_count_list_exporter.rb with RBS::Inline
2
+
3
+ module SpreenWiki
4
+ # Writes a sorted text report of how many wikis exist under each of the
5
+ # configured "unknown owner/category" namespaces.
6
+ class UnknownWikiCountListExporter < Application
7
+ DEFAULT_OUTPUT_FILENAME: ::String
8
+
9
+ # @rbs base_path: String
10
+ # @rbs group_by: String
11
+ # @rbs language: String
12
+ # @rbs home_overflow: (bool | String)
13
+ # @rbs output: String?
14
+ # @rbs **options: untyped
15
+ # @rbs return: void
16
+ def initialize: (?base_path: String, ?group_by: String, ?language: String, ?home_overflow: bool | String, ?output: String?, **untyped) -> void
17
+
18
+ # @rbs return: [Array[String], String]
19
+ def run: () -> [ Array[String], String ]
20
+
21
+ private
22
+
23
+ attr_reader path_to_export: String
24
+
25
+ # @rbs filename: String
26
+ # @rbs return: String
27
+ def resolve_output_path: (String filename) -> String
28
+
29
+ # @rbs return: Array[String]
30
+ def namespace_list: () -> Array[String]
31
+
32
+ # @rbs return: Array[String]
33
+ def missing_count_list_by_namespace: () -> Array[String]
34
+
35
+ # @rbs return: Array[String]
36
+ def count_list_by_namespace: () -> Array[String]
37
+ end
38
+ end
@@ -0,0 +1,35 @@
1
+ # Generated from lib/spreen_wiki/unknown_wiki_list_exporter_for_llm.rb with RBS::Inline
2
+
3
+ module SpreenWiki
4
+ # Writes a flat list of the wikis under the configured "unknown
5
+ # owner/category" namespace in a form suitable for feeding to an LLM.
6
+ class UnknownWikiListExporterForLLM < Application
7
+ DEFAULT_OUTPUT_FILENAME: ::String
8
+
9
+ # @rbs base_path: String
10
+ # @rbs group_by: String
11
+ # @rbs language: String
12
+ # @rbs home_overflow: (bool | String)
13
+ # @rbs output: String?
14
+ # @rbs **options: untyped
15
+ # @rbs return: void
16
+ def initialize: (?base_path: String, ?group_by: String, ?language: String, ?home_overflow: bool | String, ?output: String?, **untyped) -> void
17
+
18
+ # @rbs return: String
19
+ def run: () -> String
20
+
21
+ private
22
+
23
+ attr_reader path_to_export: String
24
+
25
+ # @rbs filename: String
26
+ # @rbs return: String
27
+ def resolve_output_path: (String filename) -> String
28
+
29
+ # @rbs return: String
30
+ def target_namespace: () -> String
31
+
32
+ # @rbs return: Array[String]
33
+ def unknown_wiki_list_for_llm: () -> Array[String]
34
+ end
35
+ end
@@ -0,0 +1,5 @@
1
+ # Generated from lib/spreen_wiki/version.rb with RBS::Inline
2
+
3
+ module SpreenWiki
4
+ VERSION: ::String
5
+ end
@@ -0,0 +1,8 @@
1
+ # Generated from lib/spreen_wiki.rb with RBS::Inline
2
+
3
+ # Spreens a GitHub wiki — the falcon's stoop, then the preen: generates
4
+ # Home.md and _Sidebar.md grouped by the Owner/Category declared on the
5
+ # first line of each page, and exports reports of the pages whose owner
6
+ # or category is unknown.
7
+ module SpreenWiki
8
+ end