Skip to content

Commit 7beabf8

Browse files
authored
Merge pull request #30 from thisisthepy/work/notebook-spellings
Docs: Record how the notebook's convenience spellings are written
2 parents d6c486f + 469dec3 commit 7beabf8

3 files changed

Lines changed: 21 additions & 9 deletions

File tree

‎PROJECT.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ python3 tools/check_guide.py # 가이드: HTML 파싱, 링
106106

107107
1. **`test/` 디렉터리** — 2023–2024 Kotlin Multiplatform 샘플. 유지 / 이동 / 삭제 중 무엇인지.
108108
결정 전까지 손대지 않는다.
109-
2. **노트북식 편의 표기** — 소문자 `modifier` 인스턴스, `DefaultIcons`, ARGB 정수 색,
110-
`Spacer(start=..., top=...)`.
109+
2. **코루틴 스코프** — 노트북이 import 하는 `DefaultCoroutineScope`·`MainCoroutineScope`.
111110
3. **`pythonx/compose/lite/release/`** 의 Windows 바이너리·jar 97 개와 빈 `material3/*.py` 28 개,
112111
서브모듈 `native` 의 처리.
113112
4. **`pythonx-map.toml` 의 이중 표기** — `pythonx.compose.layout` 과
@@ -124,6 +123,9 @@ python3 tools/check_guide.py # 가이드: HTML 파싱, 링
124123
- **`Column`·`Row`·`Spacer`** 는 `pythonx.compose.material3` 와 `pythonx.compose.layout` 양쪽에서
125124
import 된다.
126125
- **정렬 상수** 는 `Alignment.End` 와 `Alignment.Horizontal.End` 둘 다 지원한다.
126+
- 소문자 `modifier` 는 두지 않는다(`Modifier` 로 쓴다). ARGB 정수 색은 받지 않는다
127+
(`Color(0xFFFF0000)`). `Spacer(start=...)` 는 지원하지 않는다(`Modifier.padding`). `DefaultIcons` 는
128+
`Icons.Default` 의 alias(python-multiplatform #37 뒤). — `docs/INTENT.md` §5.4–5.7
127129
- 합성된 `pythonx` 를 전제한 테스트·독스트링은 #7 에서 정리했다.
128130

129131
## 8. 관련 저장소

‎docs/INTENT.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,8 @@ types — even though the runtime resolves bindings on demand.
123123

124124
These are recorded so that `docs/SPEC.md` does not settle them by accident.
125125

126-
1. **Convenience spellings** the notebook uses that Kotlin does not have: a module-level
127-
`modifier` instance, `DefaultIcons`, `DefaultCoroutineScope` / `MainCoroutineScope`, numeric
128-
ARGB colours (`color=0xFFFF0000`), and `Spacer(start=..., top=...)`.
126+
1. **Coroutine scopes** the notebook imports, `DefaultCoroutineScope` / `MainCoroutineScope`.
127+
(The other convenience spellings are decided, §5.4–5.7.)
129128
2. **The `test/` directory** — a 2023–2024 Kotlin Multiplatform sample (`pycomposeui`). Whether it
130129
is kept, moved, or removed is the maintainer's decision.
131130

@@ -153,4 +152,13 @@ them.
153152
3. **Alignment constants in both spellings:** Kotlin's flat `Alignment.End`, and the notebook's
154153
grouping by type, `Alignment.Horizontal.End` (in Kotlin `Alignment.End` *is* an
155154
`Alignment.Horizontal`).
156-
155+
4. **No lower-case `modifier`.** In Kotlin the empty modifier *is* `Modifier` (its companion); the
156+
lower-case instance was the 2024 implementation's second name, and the archived design already
157+
concluded to drop it. The notebook's `modifier=modifier` is written `modifier=Modifier`.
158+
5. **Colours are explicit.** A raw integer is not accepted for a `Color` parameter (`Color` packs
159+
several fields into one value, so a number would decode as something else). The notebook's
160+
`color=0xFFFF0000` is written `color=Color(0xFFFF0000)`, through Kotlin's own `Color` factory.
161+
6. **No parameters Kotlin does not have.** `Spacer(start=..., top=...)` is not supported; the
162+
intent is written `Spacer(modifier=Modifier.padding(...))`.
163+
7. **`DefaultIcons` is `Icons.Default`,** served by name once the binder walks
164+
`material-icons-core` (python-multiplatform #37).

‎docs/SPEC.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,11 @@ name)` (python-multiplatform #36; issue #9).
245245
| Name | Notebook use | Note |
246246
|---|---|---|
247247
| `remember_saveable` | imported from `pythonx.compose.runtime`; state read/written with `getValue()` / `setValue()` | INTENT §5.1: Pythonic attribute access instead of the accessors |
248-
| `DefaultCoroutineScope`, `MainCoroutineScope` | imported from `pythonx.compose.runtime` | |
249-
| `DefaultIcons` | `DefaultIcons.Add()` | needs `Icon` (S5.3) |
250-
| `modifier` | lower-case instance from `pythonx.compose.ui` | INTENT §4 open question 1 |
248+
| `DefaultCoroutineScope`, `MainCoroutineScope` | imported from `pythonx.compose.runtime` | INTENT §4.1, open |
249+
| `DefaultIcons` | `DefaultIcons.Add()` | INTENT §5.7: `Icons.Default` by alias, once python-multiplatform #37 binds `material-icons-core` |
250+
| `modifier` | lower-case instance from `pythonx.compose.ui` | INTENT §5.4: not provided; written `Modifier` |
251+
| `color=0xFFFF0000` | ARGB integer for a colour | INTENT §5.5: not accepted; written `Color(0xFFFF0000)` |
252+
| `Spacer(start=..., top=...)` | spacing parameters | INTENT §5.6: not supported; written `Spacer(modifier=Modifier.padding(...))` |
251253
| `Column`, `Row`, `Spacer` | imported from `pythonx.compose.material3` | INTENT §5.2: served from both, by the manifest's `[aliases]` (`tests/test_chain.py::ManifestAliases`); render proof pending (#9) |
252254
| `Card`, `Button`, `Text`, `TextField` | as above | S5.2 |
253255
| `main.App`, `App.update(...)` | live screen replacement from a cell | INTENT §5.1: a declared root that a redefinition replaces, no update function (issue #11) |

0 commit comments

Comments
 (0)