|
| 1 | +--- |
| 2 | +applyTo: ** |
| 3 | +description: This file describes the architecture and structure of the AniTrend support-markdown library project. |
| 4 | +--- |
| 5 | + |
| 6 | +# Support Markdown Library Overview |
| 7 | + |
| 8 | +The **support-markdown** library is an Android markdown parsing library that follows the [AniList markdown specification](https://files.kiniro.uk/anilist-flavored-markdown-v1.md) and is powered by [Markwon](https://noties.github.io/Markwon/). |
| 9 | + |
| 10 | +## Project Structure |
| 11 | + |
| 12 | +This is a multi-module Android library project with the following structure: |
| 13 | + |
| 14 | +### Core Modules |
| 15 | +- **`:app`** - Sample application demonstrating the library usage with UI components |
| 16 | +- **`:markdown`** - Core library module containing the markdown parsing logic and utilities |
| 17 | +- **`:buildSrc`** - Build configuration and shared build logic for all modules |
| 18 | + |
| 19 | +### Key Components |
| 20 | + |
| 21 | +#### Markdown Module (`:markdown`) |
| 22 | +The main library module that provides: |
| 23 | +- Markdown parsing functionality using Markwon |
| 24 | +- AniList-flavored markdown support |
| 25 | +- Integration with Android UI components |
| 26 | +- Image loading support via Coil |
| 27 | +- Link handling with BetterLinkMovementMethod |
| 28 | + |
| 29 | +#### App Module (`:app`) |
| 30 | +The sample application that demonstrates: |
| 31 | +- How to integrate the markdown library |
| 32 | +- Text rendering with markdown support |
| 33 | +- Image loading in markdown content |
| 34 | +- Link interaction handling |
| 35 | + |
| 36 | +#### BuildSrc Module (`:buildSrc`) |
| 37 | +Contains centralized build configuration: |
| 38 | +- Gradle plugin configurations |
| 39 | +- Dependency management strategies |
| 40 | +- Android build options and configurations |
| 41 | +- Publishing setup for JitPack distribution |
| 42 | + |
| 43 | +## Architecture Patterns |
| 44 | + |
| 45 | +The library follows standard Android library patterns: |
| 46 | +- **Modular design** - Separation between library code and sample app |
| 47 | +- **Gradle-based build system** - Using Kotlin DSL for build configuration |
| 48 | +- **Publishing support** - Configured for JitPack distribution |
| 49 | +- **Testing support** - Unit tests and Android instrumentation tests |
| 50 | + |
| 51 | +## Key Technologies |
| 52 | + |
| 53 | +- **Markwon** - Core markdown rendering engine |
| 54 | +- **Coil** - Image loading for markdown images |
| 55 | +- **BetterLinkMovementMethod** - Enhanced link handling |
| 56 | +- **Android SDK** - Target platform with minimum SDK 21 |
| 57 | +- **Kotlin** - Primary programming language |
| 58 | +- **Gradle** - Build system with Kotlin DSL |
| 59 | + |
| 60 | +## Distribution |
| 61 | + |
| 62 | +The library is distributed via JitPack, allowing easy integration: |
| 63 | +```gradle |
| 64 | +allprojects { |
| 65 | + repositories { |
| 66 | + maven { url 'https://www.jitpack.io' } |
| 67 | + } |
| 68 | +} |
| 69 | +
|
| 70 | +dependencies { |
| 71 | + implementation 'com.github.anitrend:support-markdown:{latest_version}' |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +## Documentation |
| 76 | + |
| 77 | +Full API documentation is available at: https://anitrend.github.io/support-markdown/ |
| 78 | + |
| 79 | +## Commit Conventions |
| 80 | + |
| 81 | +The project uses conventional commits with generic scopes: |
| 82 | +- `feat:` - New features |
| 83 | +- `fix:` - Bug fixes |
| 84 | +- `docs:` - Documentation changes |
| 85 | +- `style:` - Code style changes |
| 86 | +- `refactor:` - Code refactoring |
| 87 | +- `test:` - Test additions/changes |
| 88 | +- `chore:` - Build/tooling changes |
| 89 | + |
| 90 | +Scopes should be kept generic and focus on the type of change rather than specific modules. |
0 commit comments