ctrl-kd 1.3.0__tar.gz → 3.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: ctrl-kd
3
- Version: 1.3.0
3
+ Version: 3.0.0
4
4
  Summary: Convert WordStar 4-7 documents and print-to-disk files to text, Markdown, HTML, RTF, or PDF. ^KD: save and done.
5
5
  Author: Jon Michaels
6
6
  License: MIT
@@ -77,10 +77,13 @@ against surviving period printouts of the same documents. Its rules are empirica
77
77
  Paragraph styles become headings, and 82/86 convert with zero mojibake.
78
78
  More WS5–7 corpora still welcome.
79
79
  * **Page geometry** from the file's own `.pl`/`.po`/`.mt`/`.mb`/`.hm`/`.fm`/
80
- `.lh`/`.ls`, so `--mode printed` paginates with WordStar's own vertical model
81
- — `.pl − .mt − .mb` at the `.lh` line height, 55 text lines for WordStar's
82
- defaults, not a guessed 1-inch margin — and `--diagnose` says whether each
83
- figure came from the file or from the default.
80
+ `.lh`/`.ls`/`.cw`, so `--mode printed` reproduces WordStar's own page: the
81
+ vertical model (`.pl − .mt − .mb` at the `.lh` line height — 55 text lines
82
+ for WordStar's defaults, not a guessed 1-inch margin), the horizontal one
83
+ (`.po` page offset at the `.cw` character pitch), and WordStar's own line
84
+ breaks — a soft return is where the line broke on paper, so printed output
85
+ keeps it (and reflowed Modern output still joins it). `--diagnose` says
86
+ whether each figure came from the file or from the default.
84
87
  In `printed` mode footnotes are laid out the way WordStar laid them out: at
85
88
  the foot of the page that references them, behind a twenty-dash separator,
86
89
  split across pages with `...Continued...` when they do not fit.
@@ -92,6 +95,10 @@ against surviving period printouts of the same documents. Its rules are empirica
92
95
  * `--mode printed`: every line as laid out, fixed-width, `.pa`/form-feed page
93
96
  breaks honored — how it came off the printer.
94
97
 
98
+ Version coverage, known limitations (WordStar 6's bare `.pl`, WordStar 3
99
+ status), and how behaviour gets verified: **[FAQ.md](FAQ.md)**, with the
100
+ technical account in **[ERAS.md](ERAS.md)**.
101
+
95
102
  ## Install
96
103
 
97
104
  ```console
@@ -58,10 +58,13 @@ against surviving period printouts of the same documents. Its rules are empirica
58
58
  Paragraph styles become headings, and 82/86 convert with zero mojibake.
59
59
  More WS5–7 corpora still welcome.
60
60
  * **Page geometry** from the file's own `.pl`/`.po`/`.mt`/`.mb`/`.hm`/`.fm`/
61
- `.lh`/`.ls`, so `--mode printed` paginates with WordStar's own vertical model
62
- — `.pl − .mt − .mb` at the `.lh` line height, 55 text lines for WordStar's
63
- defaults, not a guessed 1-inch margin — and `--diagnose` says whether each
64
- figure came from the file or from the default.
61
+ `.lh`/`.ls`/`.cw`, so `--mode printed` reproduces WordStar's own page: the
62
+ vertical model (`.pl − .mt − .mb` at the `.lh` line height — 55 text lines
63
+ for WordStar's defaults, not a guessed 1-inch margin), the horizontal one
64
+ (`.po` page offset at the `.cw` character pitch), and WordStar's own line
65
+ breaks — a soft return is where the line broke on paper, so printed output
66
+ keeps it (and reflowed Modern output still joins it). `--diagnose` says
67
+ whether each figure came from the file or from the default.
65
68
  In `printed` mode footnotes are laid out the way WordStar laid them out: at
66
69
  the foot of the page that references them, behind a twenty-dash separator,
67
70
  split across pages with `...Continued...` when they do not fit.
@@ -73,6 +76,10 @@ against surviving period printouts of the same documents. Its rules are empirica
73
76
  * `--mode printed`: every line as laid out, fixed-width, `.pa`/form-feed page
74
77
  breaks honored — how it came off the printer.
75
78
 
79
+ Version coverage, known limitations (WordStar 6's bare `.pl`, WordStar 3
80
+ status), and how behaviour gets verified: **[FAQ.md](FAQ.md)**, with the
81
+ technical account in **[ERAS.md](ERAS.md)**.
82
+
76
83
  ## Install
77
84
 
78
85
  ```console
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ctrl-kd"
7
- version = "1.3.0"
7
+ version = "3.0.0"
8
8
  description = "Convert WordStar 4-7 documents and print-to-disk files to text, Markdown, HTML, RTF, or PDF. ^KD: save and done."
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ctrl-kd
3
- Version: 1.3.0
3
+ Version: 3.0.0
4
4
  Summary: Convert WordStar 4-7 documents and print-to-disk files to text, Markdown, HTML, RTF, or PDF. ^KD: save and done.
5
5
  Author: Jon Michaels
6
6
  License: MIT
@@ -77,10 +77,13 @@ against surviving period printouts of the same documents. Its rules are empirica
77
77
  Paragraph styles become headings, and 82/86 convert with zero mojibake.
78
78
  More WS5–7 corpora still welcome.
79
79
  * **Page geometry** from the file's own `.pl`/`.po`/`.mt`/`.mb`/`.hm`/`.fm`/
80
- `.lh`/`.ls`, so `--mode printed` paginates with WordStar's own vertical model
81
- — `.pl − .mt − .mb` at the `.lh` line height, 55 text lines for WordStar's
82
- defaults, not a guessed 1-inch margin — and `--diagnose` says whether each
83
- figure came from the file or from the default.
80
+ `.lh`/`.ls`/`.cw`, so `--mode printed` reproduces WordStar's own page: the
81
+ vertical model (`.pl − .mt − .mb` at the `.lh` line height — 55 text lines
82
+ for WordStar's defaults, not a guessed 1-inch margin), the horizontal one
83
+ (`.po` page offset at the `.cw` character pitch), and WordStar's own line
84
+ breaks — a soft return is where the line broke on paper, so printed output
85
+ keeps it (and reflowed Modern output still joins it). `--diagnose` says
86
+ whether each figure came from the file or from the default.
84
87
  In `printed` mode footnotes are laid out the way WordStar laid them out: at
85
88
  the foot of the page that references them, behind a twenty-dash separator,
86
89
  split across pages with `...Continued...` when they do not fit.
@@ -92,6 +95,10 @@ against surviving period printouts of the same documents. Its rules are empirica
92
95
  * `--mode printed`: every line as laid out, fixed-width, `.pa`/form-feed page
93
96
  breaks honored — how it came off the printer.
94
97
 
98
+ Version coverage, known limitations (WordStar 6's bare `.pl`, WordStar 3
99
+ status), and how behaviour gets verified: **[FAQ.md](FAQ.md)**, with the
100
+ technical account in **[ERAS.md](ERAS.md)**.
101
+
95
102
  ## Install
96
103
 
97
104
  ```console
@@ -12,4 +12,5 @@ src/ctrlkd/convert.py
12
12
  src/ctrlkd/core.py
13
13
  src/ctrlkd/emit.py
14
14
  src/ctrlkd/pdf.py
15
+ src/ctrlkd/typestyles.py
15
16
  tests/test_ctrlkd.py
@@ -1,8 +1,9 @@
1
1
  """ctrl-kd — convert WordStar-era files to modern formats. ^KD: save and done."""
2
- from .core import detect, parse, parse_ws, parse_printstream, Document, Block, Line, Span
2
+ from .core import (detect, parse, parse_ws, parse_printstream, merged_lines,
3
+ Document, Block, Line, Span)
3
4
  from .emit import (emit_text, emit_markdown, emit_html, emit_rtf,
4
5
  emitter, get_emitter, formats, load_plugins)
5
6
  from .pdf import emit_pdf # registers the 'pdf' format
6
7
  from .convert import convert, select_notes, DEFAULT_NOTE_KINDS, ALL_NOTE_KINDS
7
8
 
8
- __version__ = '1.3.0'
9
+ __version__ = '3.0.0'
@@ -57,14 +57,18 @@ def main(argv=None):
57
57
  help='output format (repeatable; default: markdown)')
58
58
  ap.add_argument('-o', '--output', help='output file (single input only)')
59
59
  ap.add_argument('-d', '--outdir', help='output directory for batch conversion')
60
- ap.add_argument('--mode', choices=('modern', 'printed'), default='modern',
61
- help='modern: reflowed paragraphs. printed: line-for-line, '
62
- 'fixed-width, as it printed in 1990 (default: modern; '
63
- 'print streams and ruler-line documents always render printed)')
60
+ ap.add_argument('--mode', choices=('modern', 'printed'), default='printed',
61
+ help='printed: line-for-line, fixed-width, as it printed in '
62
+ '1990 (DEFAULT). modern: reflowed paragraphs for '
63
+ 'reading. Print streams and ruler-line documents '
64
+ 'always render printed regardless.')
64
65
  ap.add_argument('--variant', choices=('ws4', 'ws5+', 'printstream', 'text'),
65
66
  help='override detection')
66
67
  ap.add_argument('--encoding', default='cp437',
67
68
  help='byte encoding of the source (default: cp437)')
69
+ ap.add_argument('--no-styles', action='store_true',
70
+ help='omit paragraph-style pass-through (HTML classes + '
71
+ 'generated CSS, RTF stylesheet) from the output')
68
72
  ap.add_argument('--no-notes', action='store_true',
69
73
  help='omit footnotes, endnotes and annotations from the output')
70
74
  ap.add_argument('--comments', action='store_true',
@@ -103,7 +107,8 @@ def main(argv=None):
103
107
  base = os.path.splitext(os.path.basename(path))[0]
104
108
  for fmt in formats:
105
109
  reg = emit.get_emitter(fmt)
106
- out = reg['fn'](doc, a.mode, title=base, notes=notes)
110
+ out = reg['fn'](doc, a.mode, title=base, notes=notes,
111
+ styles=not a.no_styles)
107
112
  if a.output:
108
113
  dest = a.output
109
114
  else:
@@ -117,7 +122,12 @@ def main(argv=None):
117
122
  else:
118
123
  with open(dest, 'w', encoding='utf-8', newline='\n') as f:
119
124
  f.write(out)
120
- print(f'{path} -> {dest}')
125
+ # Status goes to STDERR: with `-o /dev/stdout` (or a pipe) a
126
+ # status line on stdout lands INSIDE the converted document --
127
+ # found 2026-08-04 when a Python-vs-Swift archive comparison
128
+ # flagged all 81 convertible documents as differing by exactly
129
+ # this line. Both CLIs carried the defect; both fixed together.
130
+ print(f'{path} -> {dest}', file=sys.stderr)
121
131
  return status
122
132
 
123
133
  if __name__ == '__main__':