markdocx 7.0.0__tar.gz → 9.0.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdocx
3
- Version: 7.0.0
3
+ Version: 9.0.0
4
4
  Summary: Convert AI-generated Markdown textbooks to polished DOCX with native math equations and syntax-highlighted code
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "markdocx"
3
- version = "7.0.0"
3
+ version = "9.0.0"
4
4
  description = "Convert AI-generated Markdown textbooks to polished DOCX with native math equations and syntax-highlighted code"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -7,5 +7,5 @@ with native math equations and syntax-highlighted code.
7
7
 
8
8
  from markdocx.core import convert_file, convert_directory
9
9
 
10
- __version__ = "7.0.0"
10
+ __version__ = "9.0.0"
11
11
  __all__ = ["convert_file", "convert_directory"]
@@ -214,12 +214,12 @@ def _render_matrix(code: str):
214
214
  for i, row in enumerate(data):
215
215
  for j, val in enumerate(row):
216
216
  ax.text(j, i, str(val), ha="center", va="center",
217
- fontsize=14, fontfamily="serif")
217
+ fontsize=20, fontfamily="serif")
218
218
 
219
219
  # Add matrix name
220
220
  if name:
221
221
  ax.text(bracket_x_left - 0.4, (rows - 1) / 2, f"{name} =",
222
- ha="right", va="center", fontsize=16, fontfamily="serif",
222
+ ha="right", va="center", fontsize=22, fontfamily="serif",
223
223
  fontstyle="italic")
224
224
 
225
225
  plt.tight_layout(pad=0.5)
@@ -356,10 +356,10 @@ def _render_chart(code: str):
356
356
  wedges, texts, autotexts = ax.pie(
357
357
  values, labels=labels, autopct="%1.1f%%",
358
358
  colors=colors, startangle=90,
359
- textprops={"fontsize": 10}
359
+ textprops={"fontsize": 14}
360
360
  )
361
361
  for autotext in autotexts:
362
- autotext.set_fontsize(9)
362
+ autotext.set_fontsize(13)
363
363
  autotext.set_color("white")
364
364
  autotext.set_fontweight("bold")
365
365
 
@@ -372,8 +372,8 @@ def _render_chart(code: str):
372
372
  color=color, s=60, zorder=3)
373
373
  if labels:
374
374
  ax.set_xticks(range(len(labels)))
375
- ax.set_xticklabels(labels, fontsize=9)
376
- ax.legend(fontsize=9)
375
+ ax.set_xticklabels(labels, fontsize=13)
376
+ ax.legend(fontsize=13)
377
377
  ax.grid(True, alpha=0.3)
378
378
 
379
379
  elif chart_type == "line":
@@ -385,8 +385,8 @@ def _render_chart(code: str):
385
385
  color=color, marker="o", linewidth=2, markersize=5)
386
386
  if labels:
387
387
  ax.set_xticks(range(len(labels)))
388
- ax.set_xticklabels(labels, fontsize=9)
389
- ax.legend(fontsize=9)
388
+ ax.set_xticklabels(labels, fontsize=13)
389
+ ax.legend(fontsize=13)
390
390
  ax.grid(True, alpha=0.3)
391
391
 
392
392
  else: # bar (default)
@@ -403,7 +403,7 @@ def _render_chart(code: str):
403
403
  for bar_item in bars:
404
404
  height = bar_item.get_height()
405
405
  ax.text(bar_item.get_x() + bar_item.get_width() / 2., height,
406
- f"{height:g}", ha="center", va="bottom", fontsize=9)
406
+ f"{height:g}", ha="center", va="bottom", fontsize=13)
407
407
  else:
408
408
  bar_width = 0.8 / n_datasets
409
409
  for idx, ds in enumerate(datasets):
@@ -413,18 +413,18 @@ def _render_chart(code: str):
413
413
  color = PALETTE[idx % len(PALETTE)]
414
414
  ax.bar(x_positions, values, bar_width,
415
415
  label=ds.get("label", f"Series {idx+1}"), color=color)
416
- ax.legend(fontsize=9)
416
+ ax.legend(fontsize=13)
417
417
 
418
418
  ax.set_xticks(range(len(labels)))
419
- ax.set_xticklabels(labels, fontsize=9)
419
+ ax.set_xticklabels(labels, fontsize=13)
420
420
  ax.grid(True, axis="y", alpha=0.3)
421
421
 
422
422
  if title:
423
- ax.set_title(title, fontsize=14, fontweight="bold", pad=12)
423
+ ax.set_title(title, fontsize=18, fontweight="bold", pad=12)
424
424
  if xlabel:
425
- ax.set_xlabel(xlabel, fontsize=11)
425
+ ax.set_xlabel(xlabel, fontsize=15)
426
426
  if ylabel:
427
- ax.set_ylabel(ylabel, fontsize=11)
427
+ ax.set_ylabel(ylabel, fontsize=15)
428
428
 
429
429
  plt.tight_layout()
430
430
  img_bytes = _fig_to_bytes(fig)
@@ -575,10 +575,10 @@ def _render_graph(code: str):
575
575
  # Draw nodes
576
576
  node_colors = [PALETTE[i % len(PALETTE)] for i in range(len(G.nodes))]
577
577
  nx.draw_networkx_nodes(G, pos, ax=ax, node_color=node_colors,
578
- node_size=800, alpha=0.9)
578
+ node_size=1200, alpha=0.9)
579
579
 
580
580
  # Draw labels
581
- nx.draw_networkx_labels(G, pos, ax=ax, font_size=11,
581
+ nx.draw_networkx_labels(G, pos, ax=ax, font_size=15,
582
582
  font_weight="bold", font_color="white")
583
583
 
584
584
  # Draw edges
@@ -594,13 +594,13 @@ def _render_graph(code: str):
594
594
  # Draw edge labels
595
595
  if edge_labels:
596
596
  nx.draw_networkx_edge_labels(G, pos, edge_labels, ax=ax,
597
- font_size=10, font_color="#CC0000",
597
+ font_size=14, font_color="#CC0000",
598
598
  bbox=dict(boxstyle="round,pad=0.2",
599
599
  facecolor="white",
600
600
  edgecolor="none", alpha=0.8))
601
601
 
602
602
  if title:
603
- ax.set_title(title, fontsize=14, fontweight="bold", pad=12)
603
+ ax.set_title(title, fontsize=18, fontweight="bold", pad=12)
604
604
 
605
605
  ax.axis("off")
606
606
  plt.tight_layout()
@@ -758,10 +758,10 @@ def _render_workflow(code: str):
758
758
  # Vertical: boxes can be wide
759
759
  max_chars_per_line = 30
760
760
  box_w = max(3.0, min(6.0, max_text_len * 0.18 + 1.0))
761
- box_h = 0.9
762
- fontsize_normal = 12
763
- fontsize_decision = 11
764
- spacing_y = 1.8 # center-to-center vertical distance
761
+ box_h = 1.1
762
+ fontsize_normal = 18
763
+ fontsize_decision = 16
764
+ spacing_y = 2.2 # center-to-center vertical distance
765
765
 
766
766
  fig_w = max(6, box_w + 3.0)
767
767
  fig_h = max(4, n * spacing_y + 2.0)
@@ -775,11 +775,11 @@ def _render_workflow(code: str):
775
775
 
776
776
  max_chars_per_line = 16
777
777
  box_w = max(3.2, min(5.0, max_text_len * 0.18 + 1.5))
778
- box_h = 1.4
779
- fontsize_normal = 16
780
- fontsize_decision = 15
778
+ box_h = 1.6
779
+ fontsize_normal = 24
780
+ fontsize_decision = 22
781
781
  spacing_x = box_w + 1.5 # horizontal gap between boxes
782
- spacing_y = 3.0 # vertical gap between rows
782
+ spacing_y = 3.5 # vertical gap between rows
783
783
 
784
784
  num_rows = (n + cols_per_row - 1) // cols_per_row
785
785
  fig_w = max(10, cols_per_row * spacing_x + 2.5)
@@ -951,7 +951,7 @@ def _render_workflow(code: str):
951
951
  zorder=2)
952
952
 
953
953
  if title:
954
- ax.set_title(title, fontsize=14, fontweight="bold", pad=12)
954
+ ax.set_title(title, fontsize=28, fontweight="bold", pad=20)
955
955
 
956
956
  plt.tight_layout()
957
957
  img_bytes = _fig_to_bytes(fig)
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