diff --git a/CHANGELOG.md b/CHANGELOG.md index efdd3ee..efd68d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -All notable changes to MarkdownEngine are documented in this file. +All notable changes to swift-markdown-engine are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). @@ -17,13 +17,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ```swift var config = MarkdownEditorConfiguration.default - config.contentInsets = ContentInsets(top: 55.4) + config.safeAreaInsets = SafeAreaInsets(top: 55.4) ``` ### Added -- `ContentInsets` struct exposing `top` / `leading` / `trailing` / `bottom` +- `SafeAreaInsets` struct exposing `top` / `leading` / `trailing` / `bottom` inset knobs for the editor's enclosing scroll view, configurable via - `MarkdownEditorConfiguration.contentInsets`. + `MarkdownEditorConfiguration.safeAreaInsets`. ### Fixed - `NativeTextViewWrapper` now applies its initial styling pass even when diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f3333b..c1b43ba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,9 +21,13 @@ documentation tweaks are welcome as PRs directly. ## Development Setup +Start by forking the repository on GitHub, then clone your fork locally: + ```bash -git clone https://github.com/luca-chen198/MarkdownEngine.git -cd MarkdownEngine +git clone https://github.com/YOUR-USERNAME/swift-markdown-engine.git +cd swift-markdown-engine +git remote add upstream https://github.com/nodes-app/swift-markdown-engine.git +git fetch upstream swift build swift test ``` @@ -31,6 +35,14 @@ swift test Open `Package.swift` in Xcode for a graphical environment, or use the command line — both work. +Before starting work, create a branch from the latest upstream `main`: + +```bash +git checkout main +git pull upstream main +git checkout -b your-change-name +``` + ### Generating documentation locally To preview the DocC catalog locally, add the swift-docc plugin to @@ -48,8 +60,8 @@ Then run: swift package --disable-sandbox preview-documentation --target MarkdownEngine ``` -The plugin is intentionally **not** a permanent dependency to keep the -shipped package's transitive deps at zero. +The plugin is intentionally **not** a permanent dependency. The core +`MarkdownEngine` product stays free of optional documentation tooling. ## Coding Conventions @@ -60,8 +72,9 @@ shipped package's transitive deps at zero. - Keep file headers minimal; the file path implies what it contains - Favor `internal` over `public` — the smaller the public surface, the easier the package is to evolve -- Avoid adding external dependencies. The engine ships with zero deps; that - is a design constraint, not an accident +- Avoid adding external dependencies to the core `MarkdownEngine` product; + keeping the editor itself dependency-light is a design constraint, not an + accident ## Tests @@ -72,7 +85,8 @@ shipped package's transitive deps at zero. ## Pull Requests -- Branch from `main` +- Fork the repository and open pull requests from a branch in your fork +- Branch from the latest upstream `main` - Keep the change focused — one logical change per PR - Include test coverage for new behavior - Update `CHANGELOG.md` under `[Unreleased]` with a one-line summary @@ -98,4 +112,4 @@ A short subject line, an empty line, then a paragraph (or two) explaining ## License By contributing, you agree that your contributions will be licensed under -the [MIT License](LICENSE). +the [Apache 2.0 License](LICENSE). diff --git a/LICENSE b/LICENSE index 261eeb9..678245a 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright [2026] [Luca Chen] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 4b11031..74d3491 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Swift 5.9](https://img.shields.io/badge/Swift-5.9+-F05138?logo=swift&logoColor=white)](https://swift.org) [![Platforms macOS 14+](https://img.shields.io/badge/Platforms-macOS%2014+-lightgrey)](https://developer.apple.com/macos/) -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) +[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-yellow.svg)](LICENSE) [![CI](https://github.com/nodes-app/swift-markdown-engine/actions/workflows/ci.yml/badge.svg)](https://github.com/nodes-app/swift-markdown-engine/actions/workflows/ci.yml) @@ -230,14 +230,16 @@ a local path, so any engine edit rebuilds into the demo on the next run. ## Documentation -Full API documentation is available via DocC: +Full API documentation is available via DocC. In Xcode, use +**Product → Build Documentation** (`⇧⌃⌘D`). + +For local CLI preview, temporarily add the Swift DocC plugin as described in +[CONTRIBUTING.md](CONTRIBUTING.md), then run: ```bash -swift package generate-documentation --target MarkdownEngine +swift package --disable-sandbox preview-documentation --target MarkdownEngine ``` -In Xcode: **Product → Build Documentation** (`⇧⌃⌘D`). - Once the package is hosted on Swift Package Index, the docs will live at `https://swiftpackageindex.com/nodes-app/swift-markdown-engine/documentation`. @@ -258,7 +260,7 @@ conventions, and PR process. ## License -MarkdownEngine is released under the MIT License. See [LICENSE](LICENSE) +MarkdownEngine is released under the Apache 2.0 License. See [LICENSE](LICENSE) for the full text. --- diff --git a/Sources/MarkdownEngine/MarkdownEngine.docc/MarkdownEngine.md b/Sources/MarkdownEngine/MarkdownEngine.docc/MarkdownEngine.md index 6e07cb4..73e2125 100644 --- a/Sources/MarkdownEngine/MarkdownEngine.docc/MarkdownEngine.md +++ b/Sources/MarkdownEngine/MarkdownEngine.docc/MarkdownEngine.md @@ -1,5 +1,4 @@ # ``MarkdownEngine`` -# ``MarkdownEngine`` A TextKit 2-backed Markdown editor view for macOS, bridged to SwiftUI.