Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
!extensions/
!extensions/**
!README.md
!README.adoc
!CHANGELOG.md
!LICENSE
!package.json
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

## Unreleased

### Added

- **Antora docs** — `docs/antora.yml` and AsciiDoc pages under `docs/modules/ROOT/` for the Dev-Centr docs portal; changelog index with detail pages.
- **README.adoc** — primary readme with Docs | Dev-Centr badge; `README.md` retained for GitHub/npm rendering.

### Changed

- Repository transferred from `AMDphreak/code-lens` to [`dev-centr/code-lens`](https://github.com/dev-centr/code-lens). Live demo: [dev-centr.github.io/code-lens](https://dev-centr.github.io/code-lens/).
- Flat `docs/*.md` guides migrated to AsciiDoc; links in README and demo README point at `docs.devcentr.org/code-lens/`.

## [0.3.13] - 2026-05-29

Expand Down
114 changes: 114 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
ifndef::env-github[:icons: font]
:toc: preamble
:toclevels: 2
:sectanchors:

ifndef::env-github[]
image:https://img.shields.io/github/contributors/dev-centr/code-lens.svg?style=for-the-badge[Contributors,link=https://github.com/dev-centr/code-lens/graphs/contributors]
image:https://img.shields.io/github/forks/dev-centr/code-lens.svg?style=for-the-badge[Forks,link=https://github.com/dev-centr/code-lens/network/members]
image:https://img.shields.io/github/stars/dev-centr/code-lens.svg?style=for-the-badge[Stars,link=https://github.com/dev-centr/code-lens/stargazers]
image:https://img.shields.io/github/issues/dev-centr/code-lens.svg?style=for-the-badge[Issues,link=https://github.com/dev-centr/code-lens/issues]
image:https://img.shields.io/github/license/dev-centr/code-lens.svg?style=for-the-badge[License,link=https://github.com/dev-centr/code-lens/blob/main/LICENSE]
image:https://img.shields.io/badge/docs-Dev--Centr-22c55e[Docs,link=https://docs.devcentr.org/code-lens/]
image:https://github.com/dev-centr/code-lens/actions/workflows/pages.yml/badge.svg[Deploy GitHub Pages,link=https://github.com/dev-centr/code-lens/actions/workflows/pages.yml]
endif::[]

ifdef::env-github[]
image:https://img.shields.io/github/contributors/dev-centr/code-lens.svg?style=for-the-badge[Contributors]
image:https://img.shields.io/github/forks/dev-centr/code-lens.svg?style=for-the-badge[Forks]
image:https://img.shields.io/github/stars/dev-centr/code-lens.svg?style=for-the-badge[Stars]
image:https://img.shields.io/github/issues/dev-centr/code-lens.svg?style=for-the-badge[Issues]
image:https://img.shields.io/github/license/dev-centr/code-lens.svg?style=for-the-badge[License]
image:https://img.shields.io/badge/docs-Dev--Centr-22c55e[Docs | Dev-Centr]
image:https://github.com/dev-centr/code-lens/actions/workflows/pages.yml/badge.svg[Deploy GitHub Pages]
endif::[]

= code-lens

[.text-center]
One code snippet, multiple pedagogical lenses — portable JSON5 spec and `<code-lens>` web component with framework adapters.

link:https://dev-centr.github.io/code-lens/[Live demo] ·
link:https://docs.devcentr.org/code-lens/[Docs | Dev-Centr] ·
link:https://github.com/dev-centr/code-lens/issues[Report Bug] ·
link:https://github.com/dev-centr/code-lens/issues[Request Feature]

== About The Project

One snippet, multiple pedagogical naming conventions — the real lens for code examples (not a metaphor).

=== Delivery model

*In Solid/React/Next you install a component* — e.g. `import { CodeLens } from "@code-lens/solid"`.
Under the hood one shared engine powers every framework package.

[cols="1,1",options="header"]
|===
| Layer | Package
| Component (your import) | `@code-lens/solid`, `@code-lens/react`, …
| Skin | `@code-lens/css` or `@code-lens/tailwind` (planned)
| Engine | `@code-lens/vanilla` + `@code-lens/core` (pulled in automatically)
|===

→ link:https://docs.devcentr.org/code-lens/ecosystem.html[Delivery model docs]

== Installation

[source,bash]
----
pnpm install
pnpm dev # SolidJS + solid-ui demo (port 5174)
----

== Usage

[source,javascript]
----
import "@code-lens/css";
import { createCodeLens, registerCodeLens } from "@code-lens/vanilla";
import { parseLensBlock, parseThemes, parseUi } from "@code-lens/core";

registerCodeLens();
const el = createCodeLens({
document: parseLensBlock(blockJson5),
themes: parseThemes(themesJson5),
ui: parseUi(uiJson5),
}, "earth");
document.body.appendChild(el);
----

[source,html]
----
<code-lens theme="earth" appearance="auto"></code-lens>
----

`appearance`: `auto` | `light` | `dark` — independent of pedagogical color theme.

`slotHighlight`: `plain` | `box` — rounded highlight on changeable tokens (default `plain`).

=== Portable spec

[cols="1,2",options="header"]
|===
| File | Role
| link:https://github.com/dev-centr/code-lens/tree/main/spec/examples[`spec/examples/*.json5`] | Aligned token data per lens
| link:https://github.com/dev-centr/code-lens/blob/main/spec/themes.json5[`spec/themes.json5`] | Color schemes (light/dark per theme)
| link:https://github.com/dev-centr/code-lens/blob/main/spec/ui.json5[`spec/ui.json5`] | Interaction + animation
|===

* link:https://docs.devcentr.org/code-lens/ecosystem.html[Ecosystem / delivery model]
* link:https://docs.devcentr.org/code-lens/specification.html[Full specification]
* link:https://docs.devcentr.org/code-lens/ai-reproduction-spec.html[AI / LLM reproduction spec]
* link:https://docs.devcentr.org/code-lens/glass-lens-capabilities.html[Glass lens capabilities]
* link:https://github.com/dev-centr/code-lens/blob/main/implementations/REGISTRY.md[Implementation registry]

== License

MIT

== Contact

DevCentr.org — support@devcentr.org

* Project: https://github.com/dev-centr/code-lens
* Site: https://dev-centr.github.io/code-lens/
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![License][license-shield]][license-url]
[![Docs | Dev-Centr](https://img.shields.io/badge/docs-Dev--Centr-22c55e)](https://docs.devcentr.org/code-lens/)
[![Deploy GitHub Pages](https://github.com/dev-centr/code-lens/actions/workflows/pages.yml/badge.svg)](https://github.com/dev-centr/code-lens/actions/workflows/pages.yml)

<div align="center">
Expand All @@ -13,6 +14,8 @@
<p>
<a href="https://dev-centr.github.io/code-lens/">Live demo</a>
·
<a href="https://docs.devcentr.org/code-lens/">Docs | Dev-Centr</a>
·
<a href="https://github.com/dev-centr/code-lens/issues">Report Bug</a>
·
<a href="https://github.com/dev-centr/code-lens/issues">Request Feature</a>
Expand Down Expand Up @@ -44,7 +47,7 @@ One snippet, multiple pedagogical naming conventions — the real lens for code
| Skin | `@code-lens/css` or `@code-lens/tailwind` (planned) |
| Engine | `@code-lens/vanilla` + `@code-lens/core` (pulled in automatically) |

→ [docs/ecosystem.md](docs/ecosystem.md)
→ [Delivery model docs](https://docs.devcentr.org/code-lens/ecosystem.html)

## Installation

Expand Down Expand Up @@ -85,10 +88,10 @@ document.body.appendChild(el);
| [`spec/themes.json5`](spec/themes.json5) | Color schemes (light/dark per theme) |
| [`spec/ui.json5`](spec/ui.json5) | Interaction + animation |

- [Ecosystem / delivery model](docs/ecosystem.md)
- [Full specification](docs/specification.md)
- [AI / LLM reproduction spec](docs/ai-reproduction-spec.md) — normative porting detail
- [Glass lens capabilities](docs/glass-lens-capabilities.md)
- [Ecosystem / delivery model](https://docs.devcentr.org/code-lens/ecosystem.html)
- [Full specification](https://docs.devcentr.org/code-lens/specification.html)
- [AI / LLM reproduction spec](https://docs.devcentr.org/code-lens/ai-reproduction-spec.html) — normative porting detail
- [Glass lens capabilities](https://docs.devcentr.org/code-lens/glass-lens-capabilities.html)
- [Implementation registry](implementations/REGISTRY.md)

## License
Expand Down
3 changes: 2 additions & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pnpm dlx solidui-cli@latest add dialog tabs

## GitHub Pages URL

When published from the `code-lens` repository, the site is served at the repo Pages URL (e.g. `https://amdphreak.github.io/code-lens/`). The portfolio links to `https://dev-centr.github.io/code-lens/` when that custom domain is configured on the repo.
Published from the `dev-centr/code-lens` repository at **https://dev-centr.github.io/code-lens/**.
Product documentation lives on the Dev-Centr docs portal: **https://docs.devcentr.org/code-lens/**.

`vite.config.ts` uses `base: "./"` so asset paths work under a subdirectory.
4 changes: 2 additions & 2 deletions demo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function App() {
</ul>
<Button
as="a"
href="https://github.com/dev-centr/code-lens/blob/main/docs/specification.md"
href="https://docs.devcentr.org/code-lens/specification.html"
variant="link"
class="h-auto p-0 font-mono text-xs uppercase tracking-widest"
target="_blank"
Expand All @@ -108,7 +108,7 @@ export default function App() {
— see{" "}
<a
class="link-neutral"
href="https://github.com/dev-centr/code-lens/blob/main/docs/editor-integrations.md"
href="https://docs.devcentr.org/code-lens/editor-integrations.html"
>
editor feasibility
</a>
Expand Down
10 changes: 10 additions & 0 deletions docs/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
= code-lens documentation

Antora component for the Dev-Centr docs portal.

* Component descriptor: `antora.yml`
* Pages: `modules/ROOT/pages/`
* Navigation: `modules/ROOT/nav.adoc`

Build locally as part of the link:https://github.com/dev-centr/docs[dev-centr/docs] playbook.
Published URL (after playbook registration): link:https://docs.devcentr.org/code-lens/[docs.devcentr.org/code-lens/].
Loading