rolfedh-doc-utils 0.1.32__tar.gz → 0.1.34__tar.gz
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.
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/PKG-INFO +1 -1
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/callout_lib/converter_deflist.py +40 -20
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/callout_lib/detector.py +21 -13
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/convert_callouts_interactive.py +34 -22
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/convert_callouts_to_deflist.py +27 -4
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/version.py +1 -1
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/pyproject.toml +1 -1
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/PKG-INFO +1 -1
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/LICENSE +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/README.md +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/archive_unused_files.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/archive_unused_images.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/callout_lib/__init__.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/callout_lib/converter_bullets.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/callout_lib/converter_comments.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/callout_lib/table_parser.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/check_scannability.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/__init__.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/extract_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/file_utils.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/format_asciidoc_spacing.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/replace_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/scannability.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/spinner.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/topic_map_parser.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/unused_adoc.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/unused_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/unused_images.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/validate_links.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/version_check.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils/warnings_report.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/doc_utils_cli.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/extract_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/find_unused_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/format_asciidoc_spacing.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/replace_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/SOURCES.txt +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/dependency_links.txt +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/entry_points.txt +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/requires.txt +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/top_level.txt +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/setup.cfg +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/setup.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_archive_unused_files.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_archive_unused_images.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_auto_discovery.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_check_scannability.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_cli_entry_points.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_extract_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_file_utils.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_fixture_archive_unused_files.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_fixture_archive_unused_images.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_fixture_check_scannability.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_parse_exclude_list.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_replace_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_symlink_handling.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_table_callout_conversion.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_table_parser.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_topic_map_parser.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_unused_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_validate_links.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_version_check.py +0 -0
- {rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/validate_links.py +0 -0
|
@@ -16,7 +16,8 @@ class DefListConverter:
|
|
|
16
16
|
USER_VALUE_PATTERN = re.compile(r'(?<!<)<([a-zA-Z][^>]*)>')
|
|
17
17
|
|
|
18
18
|
@staticmethod
|
|
19
|
-
def convert(callout_groups: List[CalloutGroup], explanations: Dict[int, Callout], table_title: str = ""
|
|
19
|
+
def convert(callout_groups: List[CalloutGroup], explanations: Dict[int, Callout], table_title: str = "",
|
|
20
|
+
definition_prefix: str = "") -> List[str]:
|
|
20
21
|
"""
|
|
21
22
|
Create definition list from callout groups and explanations.
|
|
22
23
|
|
|
@@ -31,6 +32,7 @@ class DefListConverter:
|
|
|
31
32
|
explanations: Dict mapping callout numbers to Callout objects
|
|
32
33
|
table_title: Optional table title (e.g., ".Descriptions of delete event")
|
|
33
34
|
Will be converted to lead-in sentence (e.g., "Descriptions of delete event, where:")
|
|
35
|
+
definition_prefix: Optional prefix to add before each definition (e.g., "Specifies ")
|
|
34
36
|
|
|
35
37
|
Returns:
|
|
36
38
|
List of strings representing the definition list
|
|
@@ -48,22 +50,29 @@ class DefListConverter:
|
|
|
48
50
|
code_line = group.code_line
|
|
49
51
|
callout_nums = group.callout_numbers
|
|
50
52
|
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
# COMMENTED OUT: User-replaceable value detection causes false positives
|
|
54
|
+
# with Java generics (e.g., <MyEntity, Integer>) and other valid syntax
|
|
55
|
+
# that uses angle brackets. Always use the full code line as the term.
|
|
56
|
+
#
|
|
57
|
+
# # Check if this is a user-replaceable value (contains angle brackets but not heredoc)
|
|
58
|
+
# # User values are single words/phrases in angle brackets like <my-value>
|
|
59
|
+
# user_values = DefListConverter.USER_VALUE_PATTERN.findall(code_line)
|
|
60
|
+
#
|
|
61
|
+
# if user_values and len(user_values) == 1 and len(code_line) < 100:
|
|
62
|
+
# # This looks like a user-replaceable value placeholder
|
|
63
|
+
# # Format the value (ensure it has angle brackets)
|
|
64
|
+
# user_value = user_values[0]
|
|
65
|
+
# if not user_value.startswith('<'):
|
|
66
|
+
# user_value = f'<{user_value}>'
|
|
67
|
+
# if not user_value.endswith('>'):
|
|
68
|
+
# user_value = f'{user_value}>'
|
|
69
|
+
# term = f'`{user_value}`'
|
|
70
|
+
# else:
|
|
71
|
+
# # This is a code line - strip whitespace before wrapping in backticks
|
|
72
|
+
# term = f'`{code_line.strip()}`'
|
|
73
|
+
|
|
74
|
+
# Always use the full code line - strip whitespace before wrapping in backticks
|
|
75
|
+
term = f'`{code_line.strip()}`'
|
|
67
76
|
|
|
68
77
|
# Add blank line before each term
|
|
69
78
|
lines.append('')
|
|
@@ -101,9 +110,20 @@ class DefListConverter:
|
|
|
101
110
|
lines.append('+')
|
|
102
111
|
need_continuation = False
|
|
103
112
|
|
|
104
|
-
# Add the line
|
|
105
|
-
if line_idx == 0
|
|
106
|
-
|
|
113
|
+
# Add the line with optional prefix
|
|
114
|
+
if line_idx == 0:
|
|
115
|
+
# First line of definition
|
|
116
|
+
if explanation.is_optional:
|
|
117
|
+
# Optional marker takes precedence, then prefix
|
|
118
|
+
if definition_prefix:
|
|
119
|
+
lines.append(f'Optional. {definition_prefix}{line}')
|
|
120
|
+
else:
|
|
121
|
+
lines.append(f'Optional. {line}')
|
|
122
|
+
elif definition_prefix:
|
|
123
|
+
# Add prefix to first line
|
|
124
|
+
lines.append(f'{definition_prefix}{line}')
|
|
125
|
+
else:
|
|
126
|
+
lines.append(line)
|
|
107
127
|
else:
|
|
108
128
|
lines.append(line)
|
|
109
129
|
|
|
@@ -46,9 +46,10 @@ class CalloutDetector:
|
|
|
46
46
|
CALLOUT_IN_CODE = re.compile(r'<(\d+)>')
|
|
47
47
|
|
|
48
48
|
# Pattern for callout with optional preceding comment syntax
|
|
49
|
-
# Matches common comment styles: //, #, --,
|
|
50
|
-
#
|
|
51
|
-
|
|
49
|
+
# Matches common comment styles: //, #, --, followed by optional whitespace and <number>
|
|
50
|
+
# Note: Semicolon (;) removed because it's a statement terminator in Java/C/C++/JavaScript
|
|
51
|
+
# and causes false positives (e.g., "name; <1>" would incorrectly remove the semicolon)
|
|
52
|
+
CALLOUT_WITH_COMMENT = re.compile(r'\s*(?://|#|--)\s*<\d+>|\s*<\d+>')
|
|
52
53
|
|
|
53
54
|
# Pattern for callout explanation line: <1> Explanation text
|
|
54
55
|
CALLOUT_EXPLANATION = re.compile(r'^<(\d+)>\s+(.+)$')
|
|
@@ -141,16 +142,23 @@ class CalloutDetector:
|
|
|
141
142
|
# Use CALLOUT_WITH_COMMENT to remove both comment syntax and callout
|
|
142
143
|
line_without_callouts = self.CALLOUT_WITH_COMMENT.sub('', line).rstrip()
|
|
143
144
|
|
|
144
|
-
#
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
#
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
145
|
+
# COMMENTED OUT: User-replaceable value detection causes false positives
|
|
146
|
+
# with Java generics (e.g., <MyEntity, Integer>) and other valid syntax
|
|
147
|
+
# that uses angle brackets. Always use the full code line.
|
|
148
|
+
#
|
|
149
|
+
# # Find all angle-bracket enclosed values
|
|
150
|
+
# user_values = self.USER_VALUE_PATTERN.findall(line_without_callouts)
|
|
151
|
+
#
|
|
152
|
+
# # Determine what to use as the code line term
|
|
153
|
+
# if user_values:
|
|
154
|
+
# # Use the rightmost (closest to the callout) user value
|
|
155
|
+
# code_line = user_values[-1]
|
|
156
|
+
# else:
|
|
157
|
+
# # No angle-bracket value found - use the actual code line
|
|
158
|
+
# code_line = line_without_callouts
|
|
159
|
+
|
|
160
|
+
# Always use the full code line
|
|
161
|
+
code_line = line_without_callouts
|
|
154
162
|
|
|
155
163
|
# Collect all callout numbers on this line
|
|
156
164
|
callout_nums = [int(m.group(1)) for m in callout_matches]
|
|
@@ -127,24 +127,30 @@ class InteractiveCalloutConverter:
|
|
|
127
127
|
print(" [d] Use Definition list format instead")
|
|
128
128
|
print(" [b] Use Bulleted list format instead")
|
|
129
129
|
print(" [k] Skip this block")
|
|
130
|
-
print(" [q]
|
|
130
|
+
print(" [q] Skip current file")
|
|
131
|
+
print(" [Q] Quit script entirely (Ctrl+C)")
|
|
131
132
|
|
|
132
133
|
while True:
|
|
133
134
|
try:
|
|
134
|
-
choice = input("\nYour choice [s/d/b/k/q]: ").strip()
|
|
135
|
-
|
|
136
|
-
if choice in ['
|
|
135
|
+
choice = input("\nYour choice [s/d/b/k/q/Q]: ").strip()
|
|
136
|
+
|
|
137
|
+
if choice in ['Q', 'QUIT', 'EXIT']:
|
|
138
|
+
# Quit script entirely
|
|
139
|
+
print_colored("\nQuitting script...", Colors.YELLOW)
|
|
140
|
+
sys.exit(0)
|
|
141
|
+
elif choice.lower() in ['q', 'quit', 'exit']:
|
|
142
|
+
# Skip current file
|
|
137
143
|
return None
|
|
138
|
-
elif choice in ['s', 'shorten', 'short']:
|
|
144
|
+
elif choice.lower() in ['s', 'shorten', 'short']:
|
|
139
145
|
return 'shorten'
|
|
140
|
-
elif choice in ['d', 'deflist']:
|
|
146
|
+
elif choice.lower() in ['d', 'deflist']:
|
|
141
147
|
return 'deflist'
|
|
142
|
-
elif choice in ['b', 'bullets', 'bullet']:
|
|
148
|
+
elif choice.lower() in ['b', 'bullets', 'bullet']:
|
|
143
149
|
return 'bullets'
|
|
144
|
-
elif choice in ['k', 'skip']:
|
|
150
|
+
elif choice.lower() in ['k', 'skip']:
|
|
145
151
|
return 'skip'
|
|
146
152
|
else:
|
|
147
|
-
print_colored("Invalid choice. Please enter s, d, b, k, or
|
|
153
|
+
print_colored("Invalid choice. Please enter s, d, b, k, q, or Q.", Colors.RED)
|
|
148
154
|
|
|
149
155
|
except (KeyboardInterrupt, EOFError):
|
|
150
156
|
print()
|
|
@@ -168,23 +174,29 @@ class InteractiveCalloutConverter:
|
|
|
168
174
|
print(" [c] Inline comments")
|
|
169
175
|
print(" [s] Skip this block")
|
|
170
176
|
print(" [a] Apply choice to All remaining blocks")
|
|
171
|
-
print(" [q]
|
|
177
|
+
print(" [q] Skip current file")
|
|
178
|
+
print(" [Q] Quit script entirely (Ctrl+C)")
|
|
172
179
|
|
|
173
180
|
while True:
|
|
174
181
|
try:
|
|
175
|
-
choice = input("\nYour choice [d/b/c/s/a/q]: ").strip()
|
|
176
|
-
|
|
177
|
-
if choice in ['
|
|
182
|
+
choice = input("\nYour choice [d/b/c/s/a/q/Q]: ").strip()
|
|
183
|
+
|
|
184
|
+
if choice in ['Q', 'QUIT', 'EXIT']:
|
|
185
|
+
# Quit script entirely
|
|
186
|
+
print_colored("\nQuitting script...", Colors.YELLOW)
|
|
187
|
+
sys.exit(0)
|
|
188
|
+
elif choice.lower() in ['q', 'quit', 'exit']:
|
|
189
|
+
# Skip current file
|
|
178
190
|
return None
|
|
179
|
-
elif choice in ['s', 'skip']:
|
|
191
|
+
elif choice.lower() in ['s', 'skip']:
|
|
180
192
|
return 'skip'
|
|
181
|
-
elif choice in ['d', 'deflist']:
|
|
193
|
+
elif choice.lower() in ['d', 'deflist']:
|
|
182
194
|
return 'deflist'
|
|
183
|
-
elif choice in ['b', 'bullets', 'bullet']:
|
|
195
|
+
elif choice.lower() in ['b', 'bullets', 'bullet']:
|
|
184
196
|
return 'bullets'
|
|
185
|
-
elif choice in ['c', 'comments', 'comment']:
|
|
197
|
+
elif choice.lower() in ['c', 'comments', 'comment']:
|
|
186
198
|
return 'comments'
|
|
187
|
-
elif choice in ['a', 'all']:
|
|
199
|
+
elif choice.lower() in ['a', 'all']:
|
|
188
200
|
# Ask for the format to apply to all
|
|
189
201
|
print("\nWhat format should be applied to all remaining blocks?")
|
|
190
202
|
print(" [d] Definition list")
|
|
@@ -257,7 +269,7 @@ class InteractiveCalloutConverter:
|
|
|
257
269
|
choice = self.get_user_choice(idx, total_blocks)
|
|
258
270
|
|
|
259
271
|
if choice is None:
|
|
260
|
-
print_colored("\
|
|
272
|
+
print_colored("\nSkipping remaining blocks in this file.", Colors.YELLOW)
|
|
261
273
|
return 0, False
|
|
262
274
|
elif choice == 'skip':
|
|
263
275
|
print_colored("Skipping this block.\n", Colors.YELLOW)
|
|
@@ -279,7 +291,7 @@ class InteractiveCalloutConverter:
|
|
|
279
291
|
long_choice = self.get_user_choice_for_long_comments(block, long_warnings)
|
|
280
292
|
|
|
281
293
|
if long_choice is None:
|
|
282
|
-
print_colored("\
|
|
294
|
+
print_colored("\nSkipping remaining blocks in this file.", Colors.YELLOW)
|
|
283
295
|
return 0, False
|
|
284
296
|
elif long_choice == 'skip':
|
|
285
297
|
print_colored("Skipping this block.\n", Colors.YELLOW)
|
|
@@ -518,8 +530,8 @@ Examples:
|
|
|
518
530
|
total_conversions += conversions
|
|
519
531
|
|
|
520
532
|
except KeyboardInterrupt:
|
|
521
|
-
print_colored("\n\
|
|
522
|
-
|
|
533
|
+
print_colored("\n\nScript interrupted by user (Ctrl+C)", Colors.YELLOW)
|
|
534
|
+
sys.exit(0)
|
|
523
535
|
except Exception as e:
|
|
524
536
|
print_colored(f"\nUnexpected error processing {file_path}: {e}", Colors.RED)
|
|
525
537
|
import traceback
|
|
@@ -46,12 +46,13 @@ class CalloutConverter:
|
|
|
46
46
|
"""Converts callout-style documentation to various formats."""
|
|
47
47
|
|
|
48
48
|
def __init__(self, dry_run: bool = False, verbose: bool = False, output_format: str = 'deflist',
|
|
49
|
-
max_comment_length: int = 120, force: bool = False):
|
|
49
|
+
max_comment_length: int = 120, force: bool = False, definition_prefix: str = ""):
|
|
50
50
|
self.dry_run = dry_run
|
|
51
51
|
self.verbose = verbose
|
|
52
52
|
self.output_format = output_format # 'deflist', 'bullets', or 'comments'
|
|
53
53
|
self.max_comment_length = max_comment_length # Max length for inline comments
|
|
54
54
|
self.force = force # Force strip callouts even with warnings
|
|
55
|
+
self.definition_prefix = definition_prefix # Prefix to add before definitions (e.g., "Specifies ")
|
|
55
56
|
self.changes_made = 0
|
|
56
57
|
self.warnings = [] # Collect warnings for summary
|
|
57
58
|
self.long_comment_warnings = [] # Warnings for comments exceeding max length
|
|
@@ -195,7 +196,7 @@ class CalloutConverter:
|
|
|
195
196
|
# Fall back to definition list
|
|
196
197
|
self.log(f"Falling back to definition list for block at line {block.start_line + 1}")
|
|
197
198
|
converted_content = self.detector.remove_callouts_from_code(block.content)
|
|
198
|
-
output_list = DefListConverter.convert(callout_groups, explanations, self.detector.last_table_title)
|
|
199
|
+
output_list = DefListConverter.convert(callout_groups, explanations, self.detector.last_table_title, self.definition_prefix)
|
|
199
200
|
use_deflist_fallback = True
|
|
200
201
|
else:
|
|
201
202
|
output_list = [] # No separate list after code block for comments
|
|
@@ -206,7 +207,7 @@ class CalloutConverter:
|
|
|
206
207
|
if self.output_format == 'bullets':
|
|
207
208
|
output_list = BulletListConverter.convert(callout_groups, explanations, self.detector.last_table_title)
|
|
208
209
|
else: # default to 'deflist'
|
|
209
|
-
output_list = DefListConverter.convert(callout_groups, explanations, self.detector.last_table_title)
|
|
210
|
+
output_list = DefListConverter.convert(callout_groups, explanations, self.detector.last_table_title, self.definition_prefix)
|
|
210
211
|
|
|
211
212
|
# Replace in document
|
|
212
213
|
# Check if block has [source] prefix
|
|
@@ -474,6 +475,17 @@ Example transformation (deflist format):
|
|
|
474
475
|
action='store_true',
|
|
475
476
|
help='Force strip callouts from code blocks even with warnings (USE WITH CAUTION: only after reviewing and fixing callout issues)'
|
|
476
477
|
)
|
|
478
|
+
parser.add_argument(
|
|
479
|
+
'-s', '--specifies',
|
|
480
|
+
action='store_true',
|
|
481
|
+
help='Add "Specifies " prefix before each definition (only applies to deflist format)'
|
|
482
|
+
)
|
|
483
|
+
parser.add_argument(
|
|
484
|
+
'--prefix',
|
|
485
|
+
type=str,
|
|
486
|
+
default='',
|
|
487
|
+
help='Custom prefix to add before each definition (only applies to deflist format, e.g., "Indicates ")'
|
|
488
|
+
)
|
|
477
489
|
|
|
478
490
|
args = parser.parse_args()
|
|
479
491
|
|
|
@@ -526,9 +538,20 @@ Example transformation (deflist format):
|
|
|
526
538
|
sys.exit(0)
|
|
527
539
|
print()
|
|
528
540
|
|
|
541
|
+
# Determine definition prefix
|
|
542
|
+
definition_prefix = ""
|
|
543
|
+
if args.specifies:
|
|
544
|
+
definition_prefix = "Specifies "
|
|
545
|
+
elif args.prefix:
|
|
546
|
+
definition_prefix = args.prefix
|
|
547
|
+
# Add trailing space if user didn't include one
|
|
548
|
+
if definition_prefix and not definition_prefix.endswith(' '):
|
|
549
|
+
definition_prefix += ' '
|
|
550
|
+
|
|
529
551
|
# Create converter
|
|
530
552
|
converter = CalloutConverter(dry_run=args.dry_run, verbose=args.verbose, output_format=args.format,
|
|
531
|
-
max_comment_length=args.max_comment_length, force=args.force
|
|
553
|
+
max_comment_length=args.max_comment_length, force=args.force,
|
|
554
|
+
definition_prefix=definition_prefix)
|
|
532
555
|
|
|
533
556
|
# Process each file
|
|
534
557
|
files_processed = 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/requires.txt
RENAMED
|
File without changes
|
{rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_fixture_archive_unused_files.py
RENAMED
|
File without changes
|
{rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_fixture_archive_unused_images.py
RENAMED
|
File without changes
|
{rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_fixture_check_scannability.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rolfedh_doc_utils-0.1.32 → rolfedh_doc_utils-0.1.34}/tests/test_table_callout_conversion.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|