rolfedh-doc-utils 0.1.18__tar.gz → 0.1.19__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.18/rolfedh_doc_utils.egg-info → rolfedh_doc_utils-0.1.19}/PKG-INFO +1 -1
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/format_asciidoc_spacing.py +55 -9
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/pyproject.toml +1 -1
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19/rolfedh_doc_utils.egg-info}/PKG-INFO +1 -1
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/LICENSE +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/README.md +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/archive_unused_files.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/archive_unused_images.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/check_scannability.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/__init__.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/extract_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/file_utils.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/replace_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/scannability.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/spinner.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/topic_map_parser.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/unused_adoc.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/unused_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/unused_images.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/validate_links.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/doc_utils/version_check.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/extract_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/find_unused_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/format_asciidoc_spacing.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/replace_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/rolfedh_doc_utils.egg-info/SOURCES.txt +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/rolfedh_doc_utils.egg-info/dependency_links.txt +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/rolfedh_doc_utils.egg-info/entry_points.txt +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/rolfedh_doc_utils.egg-info/requires.txt +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/rolfedh_doc_utils.egg-info/top_level.txt +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/setup.cfg +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/setup.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_archive_unused_files.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_archive_unused_images.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_auto_discovery.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_check_scannability.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_cli_entry_points.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_extract_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_file_utils.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_fixture_archive_unused_files.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_fixture_archive_unused_images.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_fixture_check_scannability.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_parse_exclude_list.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_replace_link_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_symlink_handling.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_topic_map_parser.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_unused_attributes.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_validate_links.py +0 -0
- {rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/validate_links.py +0 -0
|
@@ -39,6 +39,7 @@ def process_file(file_path: Path, dry_run: bool = False, verbose: bool = False)
|
|
|
39
39
|
changes_made = False
|
|
40
40
|
in_block = False # Track if we're inside a block (admonition, listing, etc.)
|
|
41
41
|
in_conditional = False # Track if we're inside a conditional block
|
|
42
|
+
in_comment_block = False # Track if we're inside a //// comment block
|
|
42
43
|
|
|
43
44
|
for i, current_line in enumerate(lines):
|
|
44
45
|
prev_line = lines[i-1] if i > 0 else ""
|
|
@@ -48,9 +49,11 @@ def process_file(file_path: Path, dry_run: bool = False, verbose: bool = False)
|
|
|
48
49
|
if re.match(r'^(ifdef::|ifndef::)', current_line):
|
|
49
50
|
in_conditional = True
|
|
50
51
|
# Add blank line before conditional if needed
|
|
52
|
+
# Don't add if previous line is a comment (they form a logical unit)
|
|
51
53
|
if (prev_line and
|
|
52
54
|
not re.match(r'^\s*$', prev_line) and
|
|
53
|
-
not re.match(r'^(ifdef::|ifndef::|endif::)', prev_line)
|
|
55
|
+
not re.match(r'^(ifdef::|ifndef::|endif::)', prev_line) and
|
|
56
|
+
not re.match(r'^//', prev_line)):
|
|
54
57
|
new_lines.append("")
|
|
55
58
|
changes_made = True
|
|
56
59
|
if verbose:
|
|
@@ -70,19 +73,55 @@ def process_file(file_path: Path, dry_run: bool = False, verbose: bool = False)
|
|
|
70
73
|
if verbose:
|
|
71
74
|
messages.append(" Added blank line after conditional block")
|
|
72
75
|
|
|
76
|
+
# Check for comment block delimiters (////)
|
|
77
|
+
elif re.match(r'^////+$', current_line):
|
|
78
|
+
in_comment_block = not in_comment_block # Toggle comment block state
|
|
79
|
+
new_lines.append(current_line)
|
|
80
|
+
|
|
81
|
+
# If we're closing a comment block, add blank line after if needed
|
|
82
|
+
if not in_comment_block:
|
|
83
|
+
if (next_line and
|
|
84
|
+
not re.match(r'^\s*$', next_line) and
|
|
85
|
+
not re.match(r'^////+$', next_line)):
|
|
86
|
+
new_lines.append("")
|
|
87
|
+
changes_made = True
|
|
88
|
+
if verbose:
|
|
89
|
+
messages.append(" Added blank line after comment block")
|
|
90
|
+
|
|
73
91
|
# Check for block delimiters (====, ----, ...., ____)
|
|
74
92
|
# These are used for admonitions, listing blocks, literal blocks, etc.
|
|
75
93
|
elif re.match(r'^(====+|----+|\.\.\.\.+|____+)$', current_line):
|
|
76
94
|
in_block = not in_block # Toggle block state
|
|
77
95
|
new_lines.append(current_line)
|
|
96
|
+
|
|
97
|
+
# Check for role blocks ([role="..."])
|
|
98
|
+
# Role blocks don't need special spacing - they're followed directly by content
|
|
99
|
+
elif not in_block and not in_comment_block and re.match(r'^\[role=', current_line):
|
|
100
|
+
new_lines.append(current_line)
|
|
101
|
+
|
|
102
|
+
# Check for block titles (.Title)
|
|
103
|
+
elif not in_block and not in_comment_block and re.match(r'^\.[A-Z]', current_line):
|
|
104
|
+
# Add blank line before block title if needed
|
|
105
|
+
if (prev_line and
|
|
106
|
+
not re.match(r'^\s*$', prev_line) and
|
|
107
|
+
not re.match(r'^=+\s+', prev_line) and
|
|
108
|
+
not re.match(r'^\[role=', prev_line)): # Don't add if previous is heading, empty, or role block
|
|
109
|
+
new_lines.append("")
|
|
110
|
+
changes_made = True
|
|
111
|
+
if verbose:
|
|
112
|
+
truncated = current_line[:50] + "..." if len(current_line) > 50 else current_line
|
|
113
|
+
messages.append(f" Added blank line before block title: {truncated}")
|
|
114
|
+
new_lines.append(current_line)
|
|
115
|
+
|
|
78
116
|
# Check if current line is a heading (but not if we're in a block)
|
|
79
117
|
elif not in_block and re.match(r'^=+\s+', current_line):
|
|
80
118
|
new_lines.append(current_line)
|
|
81
119
|
|
|
82
|
-
# Check if next line is not empty and not
|
|
120
|
+
# Check if next line is not empty, not another heading, and not a comment block
|
|
83
121
|
if (next_line and
|
|
84
122
|
not re.match(r'^=+\s+', next_line) and
|
|
85
|
-
not re.match(r'^\s*$', next_line)
|
|
123
|
+
not re.match(r'^\s*$', next_line) and
|
|
124
|
+
not re.match(r'^////+$', next_line)): # Don't add if next is comment block
|
|
86
125
|
new_lines.append("")
|
|
87
126
|
changes_made = True
|
|
88
127
|
if verbose:
|
|
@@ -98,15 +137,19 @@ def process_file(file_path: Path, dry_run: bool = False, verbose: bool = False)
|
|
|
98
137
|
# Check if next line is an include directive
|
|
99
138
|
if next_line and re.match(r'^include::', next_line):
|
|
100
139
|
# This comment belongs to the include, add blank line before comment if needed
|
|
140
|
+
# This includes when previous line is an include (to separate include blocks)
|
|
101
141
|
if (prev_line and
|
|
102
142
|
not re.match(r'^\s*$', prev_line) and
|
|
103
143
|
not re.match(r'^//', prev_line) and
|
|
104
|
-
not re.match(r'^:', prev_line)):
|
|
144
|
+
not re.match(r'^:', prev_line)):
|
|
105
145
|
new_lines.append("")
|
|
106
146
|
changes_made = True
|
|
107
147
|
if verbose:
|
|
108
148
|
messages.append(" Added blank line before comment above include")
|
|
109
|
-
|
|
149
|
+
new_lines.append(current_line)
|
|
150
|
+
else:
|
|
151
|
+
# Standalone comment, just add it
|
|
152
|
+
new_lines.append(current_line)
|
|
110
153
|
|
|
111
154
|
# Check if current line is an attribute (starts with :)
|
|
112
155
|
elif re.match(r'^:', current_line):
|
|
@@ -125,7 +168,10 @@ def process_file(file_path: Path, dry_run: bool = False, verbose: bool = False)
|
|
|
125
168
|
changes_made = True
|
|
126
169
|
if verbose:
|
|
127
170
|
messages.append(" Added blank line before attribute above include")
|
|
128
|
-
|
|
171
|
+
new_lines.append(current_line)
|
|
172
|
+
else:
|
|
173
|
+
# Standalone attribute, just add it
|
|
174
|
+
new_lines.append(current_line)
|
|
129
175
|
|
|
130
176
|
# Check if current line is an include directive
|
|
131
177
|
elif re.match(r'^include::', current_line):
|
|
@@ -155,10 +201,10 @@ def process_file(file_path: Path, dry_run: bool = False, verbose: bool = False)
|
|
|
155
201
|
if not (is_attribute_include and is_near_h1):
|
|
156
202
|
# Don't add blank line if there's a comment or attribute above (it was handled by the comment/attribute logic)
|
|
157
203
|
if not has_comment_above and not has_attribute_above:
|
|
158
|
-
# Add blank line before include if previous line is not empty
|
|
204
|
+
# Add blank line before include if previous line is not empty
|
|
205
|
+
# This includes adding blank lines between consecutive includes
|
|
159
206
|
if (prev_line and
|
|
160
|
-
not re.match(r'^\s*$', prev_line)
|
|
161
|
-
not re.match(r'^include::', prev_line)):
|
|
207
|
+
not re.match(r'^\s*$', prev_line)):
|
|
162
208
|
new_lines.append("")
|
|
163
209
|
changes_made = True
|
|
164
210
|
if verbose:
|
|
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.18 → rolfedh_doc_utils-0.1.19}/rolfedh_doc_utils.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/rolfedh_doc_utils.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/rolfedh_doc_utils.egg-info/requires.txt
RENAMED
|
File without changes
|
{rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/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.18 → rolfedh_doc_utils-0.1.19}/tests/test_fixture_archive_unused_files.py
RENAMED
|
File without changes
|
{rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_fixture_archive_unused_images.py
RENAMED
|
File without changes
|
{rolfedh_doc_utils-0.1.18 → rolfedh_doc_utils-0.1.19}/tests/test_fixture_check_scannability.py
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
|