rolfedh-doc-utils 0.1.33__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.
Files changed (63) hide show
  1. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/PKG-INFO +1 -1
  2. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/callout_lib/converter_deflist.py +17 -4
  3. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/convert_callouts_to_deflist.py +27 -4
  4. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/version.py +1 -1
  5. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/pyproject.toml +1 -1
  6. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/PKG-INFO +1 -1
  7. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/LICENSE +0 -0
  8. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/README.md +0 -0
  9. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/archive_unused_files.py +0 -0
  10. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/archive_unused_images.py +0 -0
  11. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/callout_lib/__init__.py +0 -0
  12. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/callout_lib/converter_bullets.py +0 -0
  13. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/callout_lib/converter_comments.py +0 -0
  14. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/callout_lib/detector.py +0 -0
  15. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/callout_lib/table_parser.py +0 -0
  16. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/check_scannability.py +0 -0
  17. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/convert_callouts_interactive.py +0 -0
  18. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/__init__.py +0 -0
  19. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/extract_link_attributes.py +0 -0
  20. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/file_utils.py +0 -0
  21. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/format_asciidoc_spacing.py +0 -0
  22. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/replace_link_attributes.py +0 -0
  23. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/scannability.py +0 -0
  24. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/spinner.py +0 -0
  25. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/topic_map_parser.py +0 -0
  26. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/unused_adoc.py +0 -0
  27. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/unused_attributes.py +0 -0
  28. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/unused_images.py +0 -0
  29. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/validate_links.py +0 -0
  30. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/version_check.py +0 -0
  31. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils/warnings_report.py +0 -0
  32. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/doc_utils_cli.py +0 -0
  33. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/extract_link_attributes.py +0 -0
  34. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/find_unused_attributes.py +0 -0
  35. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/format_asciidoc_spacing.py +0 -0
  36. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/replace_link_attributes.py +0 -0
  37. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/SOURCES.txt +0 -0
  38. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/dependency_links.txt +0 -0
  39. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/entry_points.txt +0 -0
  40. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/requires.txt +0 -0
  41. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/rolfedh_doc_utils.egg-info/top_level.txt +0 -0
  42. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/setup.cfg +0 -0
  43. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/setup.py +0 -0
  44. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_archive_unused_files.py +0 -0
  45. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_archive_unused_images.py +0 -0
  46. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_auto_discovery.py +0 -0
  47. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_check_scannability.py +0 -0
  48. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_cli_entry_points.py +0 -0
  49. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_extract_link_attributes.py +0 -0
  50. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_file_utils.py +0 -0
  51. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_fixture_archive_unused_files.py +0 -0
  52. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_fixture_archive_unused_images.py +0 -0
  53. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_fixture_check_scannability.py +0 -0
  54. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_parse_exclude_list.py +0 -0
  55. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_replace_link_attributes.py +0 -0
  56. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_symlink_handling.py +0 -0
  57. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_table_callout_conversion.py +0 -0
  58. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_table_parser.py +0 -0
  59. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_topic_map_parser.py +0 -0
  60. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_unused_attributes.py +0 -0
  61. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_validate_links.py +0 -0
  62. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/tests/test_version_check.py +0 -0
  63. {rolfedh_doc_utils-0.1.33 → rolfedh_doc_utils-0.1.34}/validate_links.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rolfedh-doc-utils
3
- Version: 0.1.33
3
+ Version: 0.1.34
4
4
  Summary: CLI tools for AsciiDoc documentation projects
5
5
  Author: Rolfe Dlugy-Hegwer
6
6
  License: MIT License
@@ -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 = "") -> List[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
@@ -108,9 +110,20 @@ class DefListConverter:
108
110
  lines.append('+')
109
111
  need_continuation = False
110
112
 
111
- # Add the line
112
- if line_idx == 0 and explanation.is_optional:
113
- lines.append(f'Optional. {line}')
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)
114
127
  else:
115
128
  lines.append(line)
116
129
 
@@ -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
@@ -1,7 +1,7 @@
1
1
  """Version information for doc-utils."""
2
2
 
3
3
  # This should match the version in pyproject.toml
4
- __version__ = "0.1.33"
4
+ __version__ = "0.1.34"
5
5
 
6
6
  def get_version():
7
7
  """Return the current version string."""
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rolfedh-doc-utils"
7
- version = "0.1.33"
7
+ version = "0.1.34"
8
8
  description = "CLI tools for AsciiDoc documentation projects"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rolfedh-doc-utils
3
- Version: 0.1.33
3
+ Version: 0.1.34
4
4
  Summary: CLI tools for AsciiDoc documentation projects
5
5
  Author: Rolfe Dlugy-Hegwer
6
6
  License: MIT License