spreen-wiki 0.1.0 → 0.3.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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +0 -0
  3. data/README.md +12 -11
  4. data/exe/{spreen → wiki-organise} +2 -2
  5. data/lib/spreen-wiki.rb +2 -2
  6. data/lib/spreen_wiki/application.rb +149 -0
  7. data/lib/spreen_wiki/cli.rb +157 -0
  8. data/lib/spreen_wiki/configuration.rb +215 -0
  9. data/lib/spreen_wiki/home.rb +100 -0
  10. data/lib/spreen_wiki/sidebar.rb +48 -0
  11. data/lib/{spreen/wiki → spreen_wiki}/templates/category/english.md +0 -0
  12. data/lib/{spreen/wiki → spreen_wiki}/templates/category/japanese.md +0 -0
  13. data/lib/{spreen/wiki → spreen_wiki}/templates/owner/english.md +0 -0
  14. data/lib/{spreen/wiki → spreen_wiki}/templates/owner/japanese.md +0 -0
  15. data/lib/spreen_wiki/unknown_wiki_count_list_exporter.rb +59 -0
  16. data/lib/spreen_wiki/unknown_wiki_list_exporter_for_llm.rb +51 -0
  17. data/lib/{spreen/wiki → spreen_wiki}/version.rb +2 -4
  18. data/lib/spreen_wiki.rb +18 -0
  19. data/sig/generated/spreen-wiki.rbs +0 -0
  20. data/sig/generated/spreen_wiki/application.rbs +91 -0
  21. data/sig/generated/spreen_wiki/cli.rbs +68 -0
  22. data/sig/generated/spreen_wiki/configuration.rbs +148 -0
  23. data/sig/generated/spreen_wiki/home.rbs +52 -0
  24. data/sig/generated/spreen_wiki/sidebar.rbs +29 -0
  25. data/sig/generated/spreen_wiki/unknown_wiki_count_list_exporter.rbs +38 -0
  26. data/sig/generated/spreen_wiki/unknown_wiki_list_exporter_for_llm.rbs +35 -0
  27. data/sig/generated/spreen_wiki/version.rbs +5 -0
  28. data/sig/generated/spreen_wiki.rbs +8 -0
  29. data/sig/generated/test/application_test.rbs +0 -0
  30. data/sig/generated/test/configuration_test.rbs +0 -0
  31. data/sig/generated/test/home_test.rbs +0 -0
  32. data/sig/generated/test/sidebar_test.rbs +0 -0
  33. data/sig/generated/test/unknown_wiki_count_list_exporter_test.rbs +0 -0
  34. data/sig/generated/test/unknown_wiki_list_exporter_for_llm_test.rbs +0 -0
  35. metadata +25 -25
  36. data/lib/spreen/wiki/application.rb +0 -151
  37. data/lib/spreen/wiki/cli.rb +0 -159
  38. data/lib/spreen/wiki/configuration.rb +0 -217
  39. data/lib/spreen/wiki/home.rb +0 -102
  40. data/lib/spreen/wiki/sidebar.rb +0 -50
  41. data/lib/spreen/wiki/unknown_wiki_count_list_exporter.rb +0 -61
  42. data/lib/spreen/wiki/unknown_wiki_list_exporter_for_llm.rb +0 -53
  43. data/lib/spreen/wiki.rb +0 -20
  44. data/sig/generated/spreen/wiki/application.rbs +0 -93
  45. data/sig/generated/spreen/wiki/cli.rbs +0 -70
  46. data/sig/generated/spreen/wiki/configuration.rbs +0 -150
  47. data/sig/generated/spreen/wiki/home.rbs +0 -54
  48. data/sig/generated/spreen/wiki/sidebar.rbs +0 -31
  49. data/sig/generated/spreen/wiki/unknown_wiki_count_list_exporter.rbs +0 -40
  50. data/sig/generated/spreen/wiki/unknown_wiki_list_exporter_for_llm.rbs +0 -37
  51. data/sig/generated/spreen/wiki/version.rbs +0 -7
  52. data/sig/generated/spreen/wiki.rbs +0 -10
@@ -1,150 +0,0 @@
1
- # Generated from lib/spreen/wiki/configuration.rb with RBS::Inline
2
-
3
- module Spreen
4
- module Wiki
5
- # Resolves the runtime configuration for a wiki checkout. Every value is
6
- # looked up with the same precedence: explicit keyword argument, then the
7
- # `.spreen.yml` file under base_path (or config_path), then the
8
- # ORGANISATION_NAME environment variable (organisation only), then the
9
- # built-in defaults.
10
- class Configuration
11
- CONFIG_FILENAME: ::String
12
-
13
- EMPTY_HASH: Hash[String, untyped]
14
-
15
- DEFAULT_TEMPLATE_DIR: untyped
16
-
17
- DEFAULT_EXCLUDED_DIRS: untyped
18
-
19
- # Built-in labels: how the first line of a wiki page is parsed (regexp),
20
- # which namespace collects pages without a declaration (no_declaration),
21
- # which namespaces the count report covers (unknown_namespaces) and which
22
- # namespace the LLM export targets (llm_target_namespace). A config file
23
- # can override any of these, add languages or add group_by criteria.
24
- DEFAULT_LABELS: untyped
25
-
26
- attr_reader organisation: untyped
27
-
28
- attr_reader repository: untyped
29
-
30
- attr_reader wiki_url: untyped
31
-
32
- attr_reader owner_base_url: untyped
33
-
34
- attr_reader excluded_dirs: untyped
35
-
36
- attr_reader template_dir: untyped
37
-
38
- @organisation: String?
39
-
40
- @repository: String?
41
-
42
- @wiki_url: String?
43
-
44
- @owner_base_url: String?
45
-
46
- @excluded_dirs: Array[String]
47
-
48
- @template_dir: String
49
-
50
- @file: Hash[String, untyped]
51
-
52
- @labels: Hash[String, untyped]
53
-
54
- # @rbs base_path: String
55
- # @rbs config_path: String?
56
- # @rbs organisation: String?
57
- # @rbs repository: String?
58
- # @rbs wiki_url: String?
59
- # @rbs owner_base_url: String?
60
- # @rbs excluded_dirs: Array[String]?
61
- # @rbs template_dir: String?
62
- # @rbs return: void
63
- 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
64
-
65
- # @rbs return: Array[String]
66
- def group_bys: () -> Array[String]
67
-
68
- # @rbs group_by: String
69
- # @rbs return: Array[String]
70
- def languages: (String group_by) -> Array[String]
71
-
72
- # @rbs group_by: String
73
- # @rbs return: Regexp
74
- def target_regexp: (String group_by) -> Regexp
75
-
76
- # @rbs group_by: String
77
- # @rbs language: String
78
- # @rbs return: String
79
- def no_declaration: (String group_by, String language) -> String
80
-
81
- # @rbs group_by: String
82
- # @rbs language: String
83
- # @rbs return: Array[String]
84
- def unknown_namespaces: (String group_by, String language) -> Array[String]
85
-
86
- # @rbs group_by: String
87
- # @rbs language: String
88
- # @rbs return: String
89
- def llm_target_namespace: (String group_by, String language) -> String
90
-
91
- # @rbs group_by: String
92
- # @rbs language: String
93
- # @rbs return: String
94
- def path_to_template: (String group_by, String language) -> String
95
-
96
- private
97
-
98
- attr_reader file: untyped
99
-
100
- attr_reader labels: untyped
101
-
102
- # Treats empty strings the same as nil so that callers can pass values
103
- # straight from optional environment variables or CLI flags.
104
- # @rbs value: String?
105
- # @rbs return: String?
106
- def presence: (String? value) -> String?
107
-
108
- # @rbs explicit: String?
109
- # @rbs key: String
110
- # @rbs return: String?
111
- def resolve: (String? explicit, String key) -> String?
112
-
113
- # @rbs explicit: String?
114
- # @rbs return: String?
115
- def resolve_organisation: (String? explicit) -> String?
116
-
117
- # @rbs explicit: String?
118
- # @rbs return: String?
119
- def resolve_wiki_url: (String? explicit) -> String?
120
-
121
- # @rbs explicit: String?
122
- # @rbs return: String?
123
- def resolve_owner_base_url: (String? explicit) -> String?
124
-
125
- # @rbs path: String
126
- # @rbs return: Hash[String, untyped]
127
- def load_file: (String path) -> Hash[String, untyped]
128
-
129
- # @rbs group_by: String
130
- # @rbs return: Hash[String, untyped]
131
- def label_for: (String group_by) -> Hash[String, untyped]
132
-
133
- # @rbs group_by: String
134
- # @rbs language: String
135
- # @rbs return: Hash[String, untyped]
136
- def language_labels: (String group_by, String language) -> Hash[String, untyped]
137
-
138
- # @rbs return: String?
139
- def default_wiki_url: () -> String?
140
-
141
- # @rbs return: String?
142
- def default_owner_base_url: () -> String?
143
-
144
- # @rbs base: Hash[String, untyped]
145
- # @rbs override: Hash[String, untyped]
146
- # @rbs return: Hash[String, untyped]
147
- def deep_merge: (Hash[String, untyped] base, Hash[String, untyped] override) -> Hash[String, untyped]
148
- end
149
- end
150
- end
@@ -1,54 +0,0 @@
1
- # Generated from lib/spreen/wiki/home.rb with RBS::Inline
2
-
3
- module Spreen
4
- module Wiki
5
- # Generates the wiki Home page, optionally splitting per-owner content out
6
- # into `wikis-by-owner/<owner>.md` when home_overflow is enabled. Returns
7
- # the configured wiki URL (if any) so callers can point at the result.
8
- class Home < Application
9
- # @rbs return: String?
10
- def run: () -> String?
11
-
12
- private
13
-
14
- # @rbs return: String
15
- def path_to_wikis_by_owner: () -> String
16
-
17
- # @rbs return: String
18
- def path_to_home_template: () -> String
19
-
20
- # @rbs return: Array[String]
21
- def home_passage: () -> Array[String]
22
-
23
- # @rbs return: void
24
- def write_home_passage: () -> void
25
-
26
- # @rbs return: void
27
- def write_concise_home_passage: () -> void
28
-
29
- # @rbs return: void
30
- def write_per_namespace_files: () -> void
31
-
32
- # @rbs return: void
33
- def write_home_table_of_contents: () -> void
34
-
35
- # @rbs passage: Array[String]
36
- # @rbs namespace: String
37
- # @rbs wikis: Array[String]
38
- # @rbs owned: bool
39
- # @rbs return: void
40
- def append_block: (Array[String] passage, String namespace, Array[String] wikis, owned: bool) -> void
41
-
42
- # @rbs namespace: String
43
- # @rbs wikis: Array[String]
44
- # @rbs owned: bool
45
- # @rbs return: void
46
- def write_overflow_block: (String namespace, Array[String] wikis, owned: bool) -> void
47
-
48
- # @rbs namespace: String
49
- # @rbs owned: bool
50
- # @rbs return: String
51
- def heading_for: (String namespace, owned: bool) -> String
52
- end
53
- end
54
- end
@@ -1,31 +0,0 @@
1
- # Generated from lib/spreen/wiki/sidebar.rb with RBS::Inline
2
-
3
- module Spreen
4
- module Wiki
5
- # Generates the wiki _Sidebar.md as a nested list of owners/categories and
6
- # their wiki pages.
7
- class Sidebar < Application
8
- # @rbs return: void
9
- def run: () -> void
10
-
11
- private
12
-
13
- # @rbs return: Array[String]
14
- def wiki_list: () -> Array[String]
15
-
16
- # @rbs return: void
17
- def update_wiki_list: () -> void
18
-
19
- # @rbs namespace: String
20
- # @rbs wikis: Array[String]
21
- # @rbs owned: bool
22
- # @rbs return: void
23
- def append_section: (String namespace, Array[String] wikis, owned: bool) -> void
24
-
25
- # @rbs namespace: String
26
- # @rbs owned: bool
27
- # @rbs return: String
28
- def section_heading: (String namespace, owned: bool) -> String
29
- end
30
- end
31
- end
@@ -1,40 +0,0 @@
1
- # Generated from lib/spreen/wiki/unknown_wiki_count_list_exporter.rb with RBS::Inline
2
-
3
- module Spreen
4
- module Wiki
5
- # Writes a sorted text report of how many wikis exist under each of the
6
- # configured "unknown owner/category" namespaces.
7
- class UnknownWikiCountListExporter < Application
8
- DEFAULT_OUTPUT_FILENAME: ::String
9
-
10
- # @rbs base_path: String
11
- # @rbs group_by: String
12
- # @rbs language: String
13
- # @rbs home_overflow: (bool | String)
14
- # @rbs output: String?
15
- # @rbs **options: untyped
16
- # @rbs return: void
17
- def initialize: (?base_path: String, ?group_by: String, ?language: String, ?home_overflow: bool | String, ?output: String?, **untyped) -> void
18
-
19
- # @rbs return: [Array[String], String]
20
- def run: () -> [ Array[String], String ]
21
-
22
- private
23
-
24
- attr_reader path_to_export: String
25
-
26
- # @rbs filename: String
27
- # @rbs return: String
28
- def resolve_output_path: (String filename) -> String
29
-
30
- # @rbs return: Array[String]
31
- def namespace_list: () -> Array[String]
32
-
33
- # @rbs return: Array[String]
34
- def missing_count_list_by_namespace: () -> Array[String]
35
-
36
- # @rbs return: Array[String]
37
- def count_list_by_namespace: () -> Array[String]
38
- end
39
- end
40
- end
@@ -1,37 +0,0 @@
1
- # Generated from lib/spreen/wiki/unknown_wiki_list_exporter_for_llm.rb with RBS::Inline
2
-
3
- module Spreen
4
- module Wiki
5
- # Writes a flat list of the wikis under the configured "unknown
6
- # owner/category" namespace in a form suitable for feeding to an LLM.
7
- class UnknownWikiListExporterForLLM < Application
8
- DEFAULT_OUTPUT_FILENAME: ::String
9
-
10
- # @rbs base_path: String
11
- # @rbs group_by: String
12
- # @rbs language: String
13
- # @rbs home_overflow: (bool | String)
14
- # @rbs output: String?
15
- # @rbs **options: untyped
16
- # @rbs return: void
17
- def initialize: (?base_path: String, ?group_by: String, ?language: String, ?home_overflow: bool | String, ?output: String?, **untyped) -> void
18
-
19
- # @rbs return: String
20
- def run: () -> String
21
-
22
- private
23
-
24
- attr_reader path_to_export: String
25
-
26
- # @rbs filename: String
27
- # @rbs return: String
28
- def resolve_output_path: (String filename) -> String
29
-
30
- # @rbs return: String
31
- def target_namespace: () -> String
32
-
33
- # @rbs return: Array[String]
34
- def unknown_wiki_list_for_llm: () -> Array[String]
35
- end
36
- end
37
- end
@@ -1,7 +0,0 @@
1
- # Generated from lib/spreen/wiki/version.rb with RBS::Inline
2
-
3
- module Spreen
4
- module Wiki
5
- VERSION: ::String
6
- end
7
- end
@@ -1,10 +0,0 @@
1
- # Generated from lib/spreen/wiki.rb with RBS::Inline
2
-
3
- module Spreen
4
- # Spreens a GitHub wiki — the falcon's stoop, then the preen: generates
5
- # Home.md and _Sidebar.md grouped by the Owner/Category declared on the
6
- # first line of each page, and exports reports of the pages whose owner
7
- # or category is unknown.
8
- module Wiki
9
- end
10
- end