diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..fbd6ed5 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,54 @@ +name: Deploy Antora to GitHub Pages + +on: + push: + branches: [ main ] + paths: + - 'docs/**' + - 'antora-playbook.yml' + - '.github/workflows/docs.yml' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Build Antora site + run: | + npx -y -p @antora/cli@3.1 -p @antora/site-generator@3.1 antora -r @antora/site-generator antora-playbook.yml + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: build/site + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/README.md b/README.md index 4c9c145..9f861b6 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,23 @@ To check javadocs using the javadoc:javadoc ./mvnw javadoc:javadoc -Pjavadoc ``` +## Building the docs locally + +You can build and preview the Antora documentation locally without installing anything globally. + +Prerequisites: +- Node.js 18+ (20 recommended). + - Download from https://nodejs.org/ + +Build the site: + +```sh +npx -y -p @antora/cli@3.1 -p @antora/site-generator@3.1 antora -r @antora/site-generator antora-playbook.yml +``` + +Open the generated site: +- `build/site/index.html` + ## Contributing Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us. diff --git a/antora-playbook.yml b/antora-playbook.yml new file mode 100644 index 0000000..c5ea18e --- /dev/null +++ b/antora-playbook.yml @@ -0,0 +1,25 @@ +site: + title: JChunk Docs + start_page: jchunk::index.adoc + +content: + sources: + - url: . + start_path: docs + branches: HEAD + +ui: + bundle: + url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable + snapshot: false + supplemental_files: docs/ui + +asciidoc: + attributes: + page-pagination: '' + +runtime: + fetch: true + +output: + dir: build/site \ No newline at end of file diff --git a/docs/antora.yml b/docs/antora.yml index a54e8ae..9b61b65 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -1,4 +1,4 @@ -name: Jchunk +name: jchunk version: v(?+({0..9}).+({0..9}).+({0..9})): $ early-access: snapshot diff --git a/docs/ui/layouts/default.hbs b/docs/ui/layouts/default.hbs new file mode 100644 index 0000000..f7024dd --- /dev/null +++ b/docs/ui/layouts/default.hbs @@ -0,0 +1,28 @@ + + + + {{> head}} + + + + +
+ {{#if page.title}} +

{{page.title}}

+ {{/if}} +
+ {{{page.contents}}} +
+
+ +
+
+ {{> footer-content}} +
+
+ + diff --git a/docs/ui/layouts/home.hbs b/docs/ui/layouts/home.hbs new file mode 100644 index 0000000..5402539 --- /dev/null +++ b/docs/ui/layouts/home.hbs @@ -0,0 +1,28 @@ + + + + {{> head}} + + + + +
+ {{#if page.title}} +

{{page.title}}

+ {{/if}} +
+ {{{page.contents}}} +
+
+ +
+
+ {{> footer-content}} +
+
+ + diff --git a/docs/ui/partials/head.hbs b/docs/ui/partials/head.hbs new file mode 100644 index 0000000..dca5f9c --- /dev/null +++ b/docs/ui/partials/head.hbs @@ -0,0 +1,6 @@ + + + +{{#if page.title}}{{page.title}} | {{/if}}{{#if site.title}}{{site.title}}{{else}}Documentation{{/if}} + + diff --git a/docs/ui/partials/header-content.hbs b/docs/ui/partials/header-content.hbs new file mode 100644 index 0000000..ba8aea4 --- /dev/null +++ b/docs/ui/partials/header-content.hbs @@ -0,0 +1,9 @@ + diff --git a/jchunk-semantic/README.md b/jchunk-semantic/README.md index ed401ac..50dc5bd 100644 --- a/jchunk-semantic/README.md +++ b/jchunk-semantic/README.md @@ -1,7 +1,7 @@ # SemanticChunker Splits text into chunks based on **semantic similarity** using embeddings. -Instead of relying only on character counts or delimiters, it groups sentences into coherent chunks that better preserve meaning — useful for **RAG pipelines**, **semantic search**, and **embedding-based retrieval**. +Instead of relying only on character counts or delimiters, it groups sentences into coherent chunks that better preserve meaning, useful for **RAG pipelines**, **semantic search**, and **embedding-based retrieval**. ## Installing