Skip to content

Commit 75a773e

Browse files
committed
fix: whitespace in chat + clarify integration docs
- Fix extra whitespace: set white-space:normal on markdown bubbles (pre-wrap + marked.js paragraph margins caused double spacing) - README: document both integration paths — Maven Central dependency (recommended) and JavaClaw subproject (build from source) - Add Maven Central badge
1 parent 7e85164 commit 75a773e

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![CI](https://github.com/Atmosphere/javaclaw-atmosphere/actions/workflows/ci.yml/badge.svg)](https://github.com/Atmosphere/javaclaw-atmosphere/actions/workflows/ci.yml)
44
[![Release](https://img.shields.io/github/v/release/Atmosphere/javaclaw-atmosphere?label=release)](https://github.com/Atmosphere/javaclaw-atmosphere/releases)
5+
[![Maven Central](https://img.shields.io/maven-central/v/org.atmosphere/javaclaw-atmosphere)](https://central.sonatype.com/artifact/org.atmosphere/javaclaw-atmosphere)
56
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
67

78
Drop-in replacement for [JavaClaw](https://github.com/jobrunr/JavaClaw)'s Spring WebSocket chat with [Atmosphere](https://github.com/Atmosphere/atmosphere).
@@ -55,7 +56,40 @@ JavaClaw needs [this 6-line PR](https://github.com/jobrunr/JavaClaw/pull/15) mer
5556

5657
### Step 2: Add the Atmosphere plugin
5758

58-
Copy `plugins/atmosphere/` into the JavaClaw repo, or add as a dependency:
59+
**Option A: Maven dependency (recommended)**
60+
61+
Add to JavaClaw's `app/build.gradle`:
62+
63+
```gradle
64+
dependencies {
65+
implementation 'org.atmosphere:javaclaw-atmosphere:0.1.0'
66+
}
67+
```
68+
69+
That's it — the JAR is on [Maven Central](https://central.sonatype.com/artifact/org.atmosphere/javaclaw-atmosphere). The `ai.javaclaw:base` classes are provided by JavaClaw's own classpath at runtime.
70+
71+
**Option B: As a JavaClaw subproject**
72+
73+
If you prefer to build from source, clone this repo into `plugins/atmosphere/` and create a minimal `build.gradle`:
74+
75+
```gradle
76+
// plugins/atmosphere/build.gradle
77+
plugins {
78+
id 'java-library'
79+
}
80+
81+
dependencies {
82+
implementation project(':base')
83+
api 'org.atmosphere:atmosphere-spring-boot-starter:4.0.21'
84+
implementation 'org.springframework.boot:spring-boot-autoconfigure'
85+
implementation 'org.springframework:spring-web'
86+
implementation 'org.springframework.ai:spring-ai-client-chat'
87+
implementation 'tools.jackson.core:jackson-databind'
88+
compileOnly 'jakarta.servlet:jakarta.servlet-api'
89+
}
90+
```
91+
92+
Then register it:
5993

6094
```gradle
6195
// settings.gradle
@@ -65,6 +99,8 @@ include 'plugins:atmosphere'
6599
implementation project(':plugins:atmosphere')
66100
```
67101

102+
> **Note:** The `build.gradle` in this repo is for standalone CI/publishing. When using as a JavaClaw subproject, use the simplified version above — it inherits repositories, BOMs, and toolchain config from JavaClaw's root project.
103+
68104
### Step 3: Configure
69105

70106
In `application.yaml`:

src/main/resources/templates/chat.html.peb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
}
142142

143143
/* Markdown rendering in agent bubbles */
144+
.ar-msg__bubble--markdown { white-space: normal; }
144145
.ar-msg__bubble--markdown p { margin: 0 0 .5em; }
145146
.ar-msg__bubble--markdown p:last-child { margin-bottom: 0; }
146147
.ar-msg__bubble--markdown pre {

0 commit comments

Comments
 (0)