diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b997d48 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: / + schedule: + interval: weekly + groups: + npm: + patterns: ["*"] + + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + groups: + actions: + patterns: ["*"] diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..87afe01 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,45 @@ +name: Build and deploy + +on: + pull_request: + push: + branches: [master] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: pages-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build: + runs-on: ubuntu-latest + env: + ASTRO_TELEMETRY_DISABLED: 1 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .nvmrc + cache: npm + - run: npm ci + - run: npm run build + - uses: actions/upload-pages-artifact@v5 + with: + path: dist + + deploy: + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' + needs: build + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v5 diff --git a/.gitignore b/.gitignore index 45c1505..de35ccf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -_site -.sass-cache -.jekyll-metadata +node_modules/ +dist/ +.astro/ +.DS_Store diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..6f4247a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +26 diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 43f82f9..0000000 --- a/Gemfile +++ /dev/null @@ -1,24 +0,0 @@ -source "https://rubygems.org" -ruby RUBY_VERSION - -# Hello! This is where you manage which Jekyll version is used to run. -# When you want to use a different version, change it below, save the -# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: -# -# bundle exec jekyll serve -# -# This will help ensure the proper Jekyll version is running. -# Happy Jekylling! -#gem "jekyll", "3.2.1" - -# This is the default theme for new Jekyll sites. You may change this to anything you like. -gem "minima" - -# If you want to use GitHub Pages, remove the "gem "jekyll"" above and -# uncomment the line below. To upgrade, run `bundle update github-pages`. -gem "github-pages", group: :jekyll_plugins - -# If you have any plugins, put them here! -# group :jekyll_plugins do -# gem "jekyll-github-metadata", "~> 1.0" -# end diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index ab095f6..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,290 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - activesupport (6.0.4.4) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.11.1) - colorator (1.1.0) - commonmarker (0.17.13) - ruby-enum (~> 0.5) - concurrent-ruby (1.1.9) - dnsruby (1.61.9) - simpleidn (~> 0.1) - em-websocket (0.5.3) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0) - ethon (0.15.0) - ffi (>= 1.15.0) - eventmachine (1.2.7) - execjs (2.8.1) - faraday (1.9.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.3) - multipart-post (>= 1.2, < 3) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - ffi (1.15.5) - forwardable-extended (2.6.0) - gemoji (3.0.1) - github-pages (223) - github-pages-health-check (= 1.17.9) - jekyll (= 3.9.0) - jekyll-avatar (= 0.7.0) - jekyll-coffeescript (= 1.1.1) - jekyll-commonmark-ghpages (= 0.1.6) - jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.15.1) - jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.13.0) - jekyll-include-cache (= 0.2.1) - jekyll-mentions (= 1.6.0) - jekyll-optional-front-matter (= 0.3.2) - jekyll-paginate (= 1.1.0) - jekyll-readme-index (= 0.3.0) - jekyll-redirect-from (= 0.16.0) - jekyll-relative-links (= 0.6.1) - jekyll-remote-theme (= 0.4.3) - jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.7.1) - jekyll-sitemap (= 1.4.0) - jekyll-swiss (= 1.0.0) - jekyll-theme-architect (= 0.2.0) - jekyll-theme-cayman (= 0.2.0) - jekyll-theme-dinky (= 0.2.0) - jekyll-theme-hacker (= 0.2.0) - jekyll-theme-leap-day (= 0.2.0) - jekyll-theme-merlot (= 0.2.0) - jekyll-theme-midnight (= 0.2.0) - jekyll-theme-minimal (= 0.2.0) - jekyll-theme-modernist (= 0.2.0) - jekyll-theme-primer (= 0.6.0) - jekyll-theme-slate (= 0.2.0) - jekyll-theme-tactile (= 0.2.0) - jekyll-theme-time-machine (= 0.2.0) - jekyll-titles-from-headings (= 0.5.3) - jemoji (= 0.12.0) - kramdown (= 2.3.1) - kramdown-parser-gfm (= 1.1.0) - liquid (= 4.0.3) - mercenary (~> 0.3) - minima (= 2.5.1) - nokogiri (>= 1.12.5, < 2.0) - rouge (= 3.26.0) - terminal-table (~> 1.4) - github-pages-health-check (1.17.9) - addressable (~> 2.3) - dnsruby (~> 1.60) - octokit (~> 4.0) - public_suffix (>= 3.0, < 5.0) - typhoeus (~> 1.3) - html-pipeline (2.14.0) - activesupport (>= 2) - nokogiri (>= 1.4) - http_parser.rb (0.8.0) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - jekyll (3.9.0) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (~> 0.7) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 2.0) - kramdown (>= 1.17, < 3) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 4) - safe_yaml (~> 1.0) - jekyll-avatar (0.7.0) - jekyll (>= 3.0, < 5.0) - jekyll-coffeescript (1.1.1) - coffee-script (~> 2.2) - coffee-script-source (~> 1.11.1) - jekyll-commonmark (1.3.1) - commonmarker (~> 0.14) - jekyll (>= 3.7, < 5.0) - jekyll-commonmark-ghpages (0.1.6) - commonmarker (~> 0.17.6) - jekyll-commonmark (~> 1.2) - rouge (>= 2.0, < 4.0) - jekyll-default-layout (0.1.4) - jekyll (~> 3.0) - jekyll-feed (0.15.1) - jekyll (>= 3.7, < 5.0) - jekyll-gist (1.5.0) - octokit (~> 4.2) - jekyll-github-metadata (2.13.0) - jekyll (>= 3.4, < 5.0) - octokit (~> 4.0, != 4.4.0) - jekyll-include-cache (0.2.1) - jekyll (>= 3.7, < 5.0) - jekyll-mentions (1.6.0) - html-pipeline (~> 2.3) - jekyll (>= 3.7, < 5.0) - jekyll-optional-front-matter (0.3.2) - jekyll (>= 3.0, < 5.0) - jekyll-paginate (1.1.0) - jekyll-readme-index (0.3.0) - jekyll (>= 3.0, < 5.0) - jekyll-redirect-from (0.16.0) - jekyll (>= 3.3, < 5.0) - jekyll-relative-links (0.6.1) - jekyll (>= 3.3, < 5.0) - jekyll-remote-theme (0.4.3) - addressable (~> 2.0) - jekyll (>= 3.5, < 5.0) - jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) - rubyzip (>= 1.3.0, < 3.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-seo-tag (2.7.1) - jekyll (>= 3.8, < 5.0) - jekyll-sitemap (1.4.0) - jekyll (>= 3.7, < 5.0) - jekyll-swiss (1.0.0) - jekyll-theme-architect (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-cayman (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-dinky (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-hacker (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-leap-day (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-merlot (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-midnight (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-minimal (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-modernist (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-primer (0.6.0) - jekyll (> 3.5, < 5.0) - jekyll-github-metadata (~> 2.9) - jekyll-seo-tag (~> 2.0) - jekyll-theme-slate (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-tactile (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-time-machine (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-titles-from-headings (0.5.3) - jekyll (>= 3.3, < 5.0) - jekyll-watch (2.2.1) - listen (~> 3.0) - jemoji (0.12.0) - gemoji (~> 3.0) - html-pipeline (~> 2.2) - jekyll (>= 3.0, < 5.0) - kramdown (2.3.1) - rexml - kramdown-parser-gfm (1.1.0) - kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) - mini_portile2 (2.7.1) - minima (2.5.1) - jekyll (>= 3.5, < 5.0) - jekyll-feed (~> 0.9) - jekyll-seo-tag (~> 2.1) - minitest (5.15.0) - multipart-post (2.1.1) - nokogiri (1.13.1) - mini_portile2 (~> 2.7.0) - racc (~> 1.4) - octokit (4.22.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (4.0.6) - racc (1.6.0) - rb-fsevent (0.11.0) - rb-inotify (0.10.1) - ffi (~> 1.0) - rexml (3.2.5) - rouge (3.26.0) - ruby-enum (0.9.0) - i18n - ruby2_keywords (0.0.5) - rubyzip (2.3.2) - safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - simpleidn (0.2.1) - unf (~> 0.1.4) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) - typhoeus (1.4.0) - ethon (>= 0.9.0) - tzinfo (1.2.9) - thread_safe (~> 0.1) - unf (0.1.4) - unf_ext - unf_ext (0.0.8) - unicode-display_width (1.8.0) - zeitwerk (2.5.3) - -PLATFORMS - ruby - -DEPENDENCIES - github-pages - minima - -RUBY VERSION - ruby 2.6.3p62 - -BUNDLED WITH - 1.17.2 diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100755 index 62c75eb..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,26 +0,0 @@ -Theme is taken from the Opensource Team designed by Tim O’Brien - -Copyright for the team -— - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The MIT License (MIT) - -Copyright (c) 2014 Tim O'Brien (t413) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index ef8fd57..99f622f 100644 --- a/README.md +++ b/README.md @@ -1 +1,34 @@ -# jsondb.github.io \ No newline at end of file +# jsondb.github.io + +The source of the JsonDB website and documentation at https://jsondb.github.io. JsonDB itself lives in [Jsondb/jsondb-core](https://github.com/Jsondb/jsondb-core). + +The site is built with [Astro](https://astro.build) and [Starlight](https://starlight.astro.build). + +## Working on it locally + +You need Node.js. The version is in `.nvmrc`; with nvm, run `nvm use`. + +```sh +npm ci # install the exact dependency versions +npm run dev # live preview at http://localhost:4321 +npm run build # production build into dist/, including the link check +npm run preview # serve the production build +``` + +## Where things are + +| Path | What | +|---|---| +| `src/content/docs/` | The pages, in Markdown and MDX. The sidebar is in `astro.config.mjs`. | +| `src/styles/theme.css` | Colours (the indigo theme) and the landing-page styles. | +| `src/components/` | The header title and the landing page's code demo. | +| `src/assets/logo*.svg` | The logo: large, small (favicons and header), and monochrome. | +| `public/` | Favicons and the social card, generated from the logo. | + +After changing a logo SVG, run `npm run icons` to regenerate the files in `public/`, and commit them. + +## Deploying + +Every pull request runs the `build` workflow, which is the required check. Merging to `master` builds the site again and deploys it to GitHub Pages through the same workflow. There's no other deploy step. + +The documented API is the latest **released** version of jsondb-core. Update the docs when a release ships, not before. diff --git a/_config.yml b/_config.yml deleted file mode 100755 index 7adcce0..0000000 --- a/_config.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- - -port: 4000 -host: 0.0.0.0 -safe: false - - -### site serving configuration ### -exclude: [Gemfile, Gemfile.lock, CNAME, README.md, .gitignore] -permalink: /:title ## disables post output -timezone: null -lsi: false -markdown: kramdown - - -### content configuration ### -title: "Jsondb A Opensource, Java-based, In-Memory/Embedded, Securable database" -keywords: "Jsondb, Java-based, In-Memory, Embedded, Filebased, Database, Encryption-Support, XPATH based Query, Opensource, MIT License" -description: "JsonDB is a Opensource, Java-based, In-Memory/Embedded, Database that stores its data as Json Files, with encryption support." -source_link: "https://github.com/Jsondb/jsondb-core" -url: "http://jsondb.io" # the base hostname & protocol for your site -favicon: "img/favicon-database.ico" -touch_icon: "img/apple-touch-icon.png" -google_analytics_key: UA-86156909-1 ## put YOUR key here to enable tracking! (blank to disable) - - -### template colors, used site-wide via css ### -colors: - black: '#111111' - white: '#f8f8f8' - blue: '#49a7e9' - green: '#9bcf2f' - purple: '#c869bf' - orange: '#fab125' - turquoise: '#0fbfcf' - -kramdown: - auto_ids: false diff --git a/_includes/analytics.html b/_includes/analytics.html deleted file mode 100755 index 49f9671..0000000 --- a/_includes/analytics.html +++ /dev/null @@ -1,15 +0,0 @@ -{% if site.google_analytics_key %} - -{% endif %} \ No newline at end of file diff --git a/_includes/css/base.css b/_includes/css/base.css deleted file mode 100755 index c5496e1..0000000 --- a/_includes/css/base.css +++ /dev/null @@ -1,366 +0,0 @@ -/* -* Skeleton V1.2 -* Copyright 2011, Dave Gamache -* www.getskeleton.com -* Free to use under the MIT license. -* http://www.opensource.org/licenses/mit-license.php -* 6/20/2012 -*/ - - -/* Table of Content -================================================== - #Reset & Basics - #Basic Styles - #Site Styles - #Typography - #Links - #Lists - #Images - #Buttons - #Forms - #Misc */ - - -/* #Reset & Basics (Inspired by E. Meyers) -================================================== */ - html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; } - article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { - display: block; } - body { - line-height: 1; } - ol, ul { - list-style: none; } - blockquote, q { - quotes: none; } - blockquote:before, blockquote:after, - q:before, q:after { - content: ''; - content: none; } - table { - border-collapse: collapse; - border-spacing: 0; } - - -/* #Basic Styles -================================================== */ - body { - background: #fff; - font: 14px/21px "Raleway", "HelveticaNeue-Light", Arial, sans-serif; - color: #444; - -webkit-font-smoothing: antialiased; /* Fix for webkit rendering */ - -webkit-text-size-adjust: 100%; - } - - -/* #Typography -================================================== */ - h1, h2, h3, h4, h5, h6 { - font-weight: 300; } - h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-weight: inherit; } - h1 { font-size: 46px; line-height: 50px; margin-bottom: 14px;} - h2 { font-size: 35px; line-height: 40px; margin-bottom: 10px; } - h3 { font-size: 28px; line-height: 34px; margin-bottom: 8px; } - h4 { font-size: 21px; line-height: 30px; margin-bottom: 4px; } - h5 { font-size: 17px; line-height: 24px; } - h6 { font-size: 14px; line-height: 21px; } - .subheader { color: #777; } - - p { margin: 0 0 20px 0; } - p img { margin: 0; } - p.lead { font-size: 21px; line-height: 27px; color: #777; } - - em { font-style: italic; } - strong { font-weight: bold; } - small { font-size: 80%; } - -/* Blockquotes */ - blockquote, blockquote p { font-size: 17px; line-height: 24px; color: #777; font-style: italic; } - blockquote { margin: 0 0 20px; padding: 9px 20px 0 19px; border-left: 1px solid #ddd; } - blockquote cite { display: block; font-size: 12px; color: #555; } - blockquote cite:before { content: "\2014 \0020"; } - blockquote cite a, blockquote cite a:visited, blockquote cite a:visited { color: #555; } - - hr { border: solid #ddd; border-width: 1px 0 0; clear: both; margin: 10px 0 30px; height: 0; } - - -/* #Links -================================================== */ - a, a:visited { text-decoration: underline; outline: 0; } - a:hover, a:focus { } - p a, p a:visited { line-height: inherit; } - - -/* #Lists -================================================== */ - ul, ol { margin-bottom: 20px; } - ul { list-style: none outside; } - ol { list-style: decimal; } - ul, ul.square { list-style: square outside; } - ul ul, ul.circle { list-style: circle outside; } - ul ul ul, ul.disc { list-style: disc outside; } - ul ul li, ul ol li, - ol ol li, ol ul li { margin-bottom: 6px; } - li { line-height: 18px; margin-bottom: 12px; } - ul.large li { line-height: 21px; } - li p { line-height: 21px; } - -/* #Images -================================================== */ - - img.scale-with-grid { - max-width: 100%; - height: auto; } - - -/* #Buttons -================================================== */ - - .button, - button, - input[type="submit"], - input[type="reset"], - input[type="button"] { - background: #eee; /* Old browsers */ - background: #eee -moz-linear-gradient(top, rgba(255,255,255,.2) 0%, rgba(0,0,0,.2) 100%); /* FF3.6+ */ - background: #eee -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.2)), color-stop(100%,rgba(0,0,0,.2))); /* Chrome,Safari4+ */ - background: #eee -webkit-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* Chrome10+,Safari5.1+ */ - background: #eee -o-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* Opera11.10+ */ - background: #eee -ms-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* IE10+ */ - background: #eee linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* W3C */ - border: 1px solid #aaa; - border-top: 1px solid #ccc; - border-left: 1px solid #ccc; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - color: #444; - display: inline-block; - font-size: 11px; - font-weight: bold; - text-decoration: none; - text-shadow: 0 1px rgba(255, 255, 255, .75); - cursor: pointer; - margin-bottom: 20px; - line-height: normal; - padding: 8px 10px; - font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; } - - .button:hover, - button:hover, - input[type="submit"]:hover, - input[type="reset"]:hover, - input[type="button"]:hover { - color: #222; - background: #ddd; /* Old browsers */ - background: #ddd -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); /* FF3.6+ */ - background: #ddd -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.3)), color-stop(100%,rgba(0,0,0,.3))); /* Chrome,Safari4+ */ - background: #ddd -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* Chrome10+,Safari5.1+ */ - background: #ddd -o-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* Opera11.10+ */ - background: #ddd -ms-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* IE10+ */ - background: #ddd linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* W3C */ - border: 1px solid #888; - border-top: 1px solid #aaa; - border-left: 1px solid #aaa; } - - .button:active, - button:active, - input[type="submit"]:active, - input[type="reset"]:active, - input[type="button"]:active { - border: 1px solid #666; - background: #ccc; /* Old browsers */ - background: #ccc -moz-linear-gradient(top, rgba(255,255,255,.35) 0%, rgba(10,10,10,.4) 100%); /* FF3.6+ */ - background: #ccc -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.35)), color-stop(100%,rgba(10,10,10,.4))); /* Chrome,Safari4+ */ - background: #ccc -webkit-linear-gradient(top, rgba(255,255,255,.35) 0%,rgba(10,10,10,.4) 100%); /* Chrome10+,Safari5.1+ */ - background: #ccc -o-linear-gradient(top, rgba(255,255,255,.35) 0%,rgba(10,10,10,.4) 100%); /* Opera11.10+ */ - background: #ccc -ms-linear-gradient(top, rgba(255,255,255,.35) 0%,rgba(10,10,10,.4) 100%); /* IE10+ */ - background: #ccc linear-gradient(top, rgba(255,255,255,.35) 0%,rgba(10,10,10,.4) 100%); /* W3C */ } - - .button.full-width, - button.full-width, - input[type="submit"].full-width, - input[type="reset"].full-width, - input[type="button"].full-width { - width: 100%; - padding-left: 0 !important; - padding-right: 0 !important; - text-align: center; } - - /* Fix for odd Mozilla border & padding issues */ - button::-moz-focus-inner, - input::-moz-focus-inner { - border: 0; - padding: 0; - } - - -/* #Forms -================================================== */ - - form { - margin-bottom: 20px; } - fieldset { - margin-bottom: 20px; } - input[type="text"], - input[type="password"], - input[type="email"], - textarea, - select { - border: 1px solid #ccc; - padding: 6px 4px; - outline: none; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; - font: 13px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; - color: #777; - margin: 0; - width: 210px; - max-width: 100%; - display: block; - margin-bottom: 20px; - background: #fff; } - select { - padding: 0; } - input[type="text"]:focus, - input[type="password"]:focus, - input[type="email"]:focus, - textarea:focus { - border: 1px solid #aaa; - color: #444; - -moz-box-shadow: 0 0 3px rgba(0,0,0,.2); - -webkit-box-shadow: 0 0 3px rgba(0,0,0,.2); - box-shadow: 0 0 3px rgba(0,0,0,.2); } - textarea { - min-height: 60px; } - label, - legend { - display: block; - font-weight: bold; - font-size: 13px; } - select { - width: 220px; } - input[type="checkbox"] { - display: inline; } - label span, - legend span { - font-weight: normal; - font-size: 13px; - color: #444; } - -/* #Misc -================================================== */ - .remove-bottom { margin-bottom: 0 !important; } - .half-bottom { margin-bottom: 10px !important; } - .add-bottom { margin-bottom: 20px !important; } - - - - /* #Syntax highlighting - ================================================== */ - - -.highlight { - color: #f8f8f2; - table-layout: fixed; - white-space: nowrap; - width:90%; -} - -.highlight pre, .highlight code { display:block; margin:0; padding:0; background: none; overflow:auto; word-wrap: normal; } - -.highlight, .linenodiv { - display:block; - padding: 10px; - margin-bottom:20px; - background-color: #010101; -} -.gutter, .lineno { color: #ccc; } - -td.gl { width: 40px; } - -.gutter { - border-right: none; - padding: 10px; - text-align: right; -} -span.lineno { - display: block; - float: left; - width: 40px; - padding-right: 8px; - text-align: right; -} - - -.hll { background-color: #49483e } -.c { color: #75715e } /* Comment */ -.err { color: #960050; background-color: #1e0010 } /* Error */ -.k { color: #66d9ef } /* Keyword */ -.l { color: #ae81ff } /* Literal */ -.n { color: #f8f8f2 } /* Name */ -.o { color: #f92672 } /* Operator */ -.p { color: #f8f8f2 } /* Punctuation */ -.cm { color: #75715e } /* Comment.Multiline */ -.cp { color: #75715e } /* Comment.Preproc */ -.c1 { color: #75715e } /* Comment.Single */ -.cs { color: #75715e } /* Comment.Special */ -.ge { font-style: italic } /* Generic.Emph */ -.gs { font-weight: bold } /* Generic.Strong */ -.kc { color: #66d9ef } /* Keyword.Constant */ -.kd { color: #66d9ef } /* Keyword.Declaration */ -.kn { color: #f92672 } /* Keyword.Namespace */ -.kp { color: #66d9ef } /* Keyword.Pseudo */ -.kr { color: #66d9ef } /* Keyword.Reserved */ -.kt { color: #66d9ef } /* Keyword.Type */ -.ld { color: #e6db74 } /* Literal.Date */ -.m { color: #ae81ff } /* Literal.Number */ -.s { color: #e6db74 } /* Literal.String */ -.na { color: #a6e22e } /* Name.Attribute */ -.nb { color: #f8f8f2 } /* Name.Builtin */ -.nc { color: #a6e22e } /* Name.Class */ -.no { color: #66d9ef } /* Name.Constant */ -.nd { color: #a6e22e } /* Name.Decorator */ -.ni { color: #f8f8f2 } /* Name.Entity */ -.ne { color: #a6e22e } /* Name.Exception */ -.nf { color: #a6e22e } /* Name.Function */ -.nl { color: #f8f8f2 } /* Name.Label */ -.nn { color: #f8f8f2 } /* Name.Namespace */ -.nx { color: #a6e22e } /* Name.Other */ -.py { color: #f8f8f2 } /* Name.Property */ -.nt { color: #f92672 } /* Name.Tag */ -.nv { color: #f8f8f2 } /* Name.Variable */ -.ow { color: #f92672 } /* Operator.Word */ -.w { color: #f8f8f2 } /* Text.Whitespace */ -.mf { color: #ae81ff } /* Literal.Number.Float */ -.mh { color: #ae81ff } /* Literal.Number.Hex */ -.mi { color: #ae81ff } /* Literal.Number.Integer */ -.mo { color: #ae81ff } /* Literal.Number.Oct */ -.sb { color: #e6db74 } /* Literal.String.Backtick */ -.sc { color: #e6db74 } /* Literal.String.Char */ -.sd { color: #e6db74 } /* Literal.String.Doc */ -.s2 { color: #e6db74 } /* Literal.String.Double */ -.se { color: #ae81ff } /* Literal.String.Escape */ -.sh { color: #e6db74 } /* Literal.String.Heredoc */ -.si { color: #e6db74 } /* Literal.String.Interpol */ -.sx { color: #e6db74 } /* Literal.String.Other */ -.sr { color: #e6db74 } /* Literal.String.Regex */ -.s1 { color: #e6db74 } /* Literal.String.Single */ -.ss { color: #e6db74 } /* Literal.String.Symbol */ -.bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ -.vc { color: #f8f8f2 } /* Name.Variable.Class */ -.vg { color: #f8f8f2 } /* Name.Variable.Global */ -.vi { color: #f8f8f2 } /* Name.Variable.Instance */ -.il { color: #ae81ff } /* Literal.Number.Integer.Long */ - -.gh { } /* Generic Heading & Diff Header */ -.gu { color: #75715e; } /* Generic.Subheading & Diff Unified/Comment? */ -.gd { color: #f92672; } /* Generic.Deleted & Diff Deleted */ -.gi { color: #a6e22e; } /* Generic.Inserted & Diff Inserted */ diff --git a/_includes/css/main.css b/_includes/css/main.css deleted file mode 100755 index 56aca05..0000000 --- a/_includes/css/main.css +++ /dev/null @@ -1,357 +0,0 @@ -html { box-sizing: border-box; } -*, *:before, *:after { box-sizing: inherit; } - -/* ---------------------------*/ -/* ----- Special Styles ----- */ -/* ---------------------------*/ - -/* ----- colors (autogenerated from _config.yml)----- */ - -{% for c in site.colors %} -.border-{{c[0]}} { border-color: {{ c[1] }} !important; } -.text-{{c[0]}} { color: {{ c[1] }}; } -.text-{{c[0]}} a { color: {{ c[1] }}; } -.bg-{{c[0]}} { background-color: {{ c[1] }} !important; } -{% endfor %} - -/* ----- per-post colors! ----- */ -{% for node in site.posts %} - {% capture id %}{{ node.id | remove:'/' | downcase }}{% endcapture %} - {% capture bg %}{% if site.colors[node.bg] %}{{ site.colors[node.bg] }}{% else %}{{ node.bg }}{% endif %}{% endcapture %} - {% capture fg %}{% if site.colors[node.color] %}{{ site.colors[node.color] }}{% else %}{{ node.color }}{% endif %}{% endcapture %} - nav .p-{{id}} { border-color: {{ bg }}; } - #{{id}} { background-color: {{ bg }} !important; color: {{ fg }}; } - #{{id}} a { color: {{ fg }}; } - #{{id}} .sectiondivider { color: {{ bg }}; } -{% endfor %} - - -/* ----- code, syntax highlighting, etc ----- */ - -code, pre { font-family: Monaco, Menlo, Consolas, "Courier New", monospace; } - -/* spesifically inline code */ -code, pre { - background: rgba(255,255,255,0.2); - display: inline; - word-wrap: break-word; -} - -/* block code */ -pre code { background: none; display: block; } -pre { - display: block; - margin: 20px 5%; - padding: 4px 8px; - background: rgba(255,255,255,0.1); - word-wrap: break-word; -} - -.highlight { margin:20px 5%; } - - -/* ----- base elements ----- */ - -img { - max-width:100%!important; - height:auto; - vertical-align:middle; -} - -hr { - margin:60px auto; - width:50%; - border-color: {{ site.colors.black }}; -} - -.container { word-wrap: break-word; } -.center { text-align: center; } -.left, .container .left { text-align: left; } - -.container h1, .container h2, .container h3, .container h4 { - margin-bottom: 20px; - text-align: center; - padding: 0 4%; -} -.container p, .container ol, .container ul { - font-size: 17px; - padding: 0 5%; -} -.container ol, .container ul { padding: 0 8%; } -.container p:first-of-type { - margin-top: 40px; -} - -/* keep embedded videos fluid! */ -.icontain { - position: relative; - height: 0; - overflow: hidden; - padding-bottom: 56.25%; /* keep 16x9 Aspect Ratio */ -} -.i4x3 { padding-bottom: 75.00%; } /* keep 4x3 Aspect Ratio */ -.icontain iframe { - position: absolute; - top:0; - left: 0; - width: 100%; - height: 100%; -} - -.inlineblock { - display:-moz-inline-stack; - display:inline-block; - zoom:1; - *display:inline; -} - -/* ---------------------------*/ -/* ----- Main Structure ----- */ -/* ---------------------------*/ - -/* ----- top menu ----- */ - -{% assign navborder = 3 %} -{% assign navborder_active = 6 %} - -nav { - font-size:15px; - width:100%; - position:fixed; - z-index:100; - top:0; - left:0; - background:#2e2e2e; -} - -nav ul { - list-style:none; - text-align:center; - padding:0; - margin:0; - letter-spacing:-4px; -} - -nav ul li { - display:inline-block; - border-top:{{navborder}}px solid; - padding: {{navborder}}px; - *display:inline; - zoom:1; - line-height:normal; - letter-spacing:normal; - text-transform:uppercase; - min-width:110px; - line-height:60px; - margin:0; -} - -nav ul li a, nav ul li a:visited { - display:block; - color:#fff; - text-decoration:none; - font-weight:600; - opacity:.75; -} - -nav ul li a:hover { - opacity:1 -} -nav ul li:hover, nav ul li.active { - border-top-width: {{navborder_active}}px; - padding-top: 0; -} - - -/* ----- sections/articles ----- */ - -.section { - position:relative; - display:block; - width:100%; - min-height:300px; - padding:210px 0; - background:url(img/bgnoise.png); - /* generated noise from noisetexturegenerator.com */ -} - -.section:first-of-type { - padding-top: 140px; -} - - -#footer { - padding: 8px 0; - min-height:0; - text-align:center; - background-color:#2e2e2e; - background-image:none; -} -#footer .container p { font-size:13px; margin:0; } - -.subtlecircle { - text-align:center; - z-index:3; - border-radius:50%; - -moz-border-radius:50%; - -webkit-border-radius:50%; - box-shadow: 0px 1px 15px rgba(0,0,0,0.05); - background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAF0lEQVQIHWP8//+/MQMaYELjg7kUCgIASm8DOqGzfp8AAAAASUVORK5CYII=); -} - -.sectiondivider { - width:270px; - height:270px; - padding:15px; - position:absolute; - top:-135px; - left:50%; - margin-left:-135px; -} - -.sectiondivider img { - width:200px; - height:240px; - position: static; - margin-top: -20px; -} - -.sectiondivider .fa-stack { - font-size: 130px; - position: static; - margin-top: -8px; -} -.sectiondivider .fa-circle { color: #fff; } - -.sectiondivider h5 { - font-size:15px; - font-weight:700; - text-transform:uppercase; - position:absolute; - bottom:50px; - left:auto; - text-align:center; - display:block; - z-index:6; - width:240px; -} - -.sectiondivider.imaged { - text-shadow: 1px 1px 3px #333; -} - - -.columned { - -webkit-column-count: 3; - -moz-column-count: 3; - column-count: 3; - - -webkit-column-gap: 40px; - -moz-column-gap: 40px; - column-gap: 40px; - - -webkit-column-rule: 1px outset rgba(255,255,255,0.5); - -moz-column-rule: 1px outset rgba(255,255,255,0.5); - column-rule: 1px outset rgba(255,255,255,0.5); -} -.longlist { font-size: 14px !important; } -.longlist li { margin-bottom: 3px; } - - - -/* ----- fork on github banner ----- */ -#forkongithub a { - color:#fff; - text-decoration:none; - font-family:arial,sans-serif; - text-align:center; - font-weight:700; - font-size:1rem; - line-height:2rem; - position:relative; - transition:.5s; - padding:5px 40px; -} -#forkongithub a::before, #forkongithub a::after { - content:""; width:100%; display:block; position:absolute; - top:1px; left:0; height:1px; background:#fff; -} -#forkongithub a::after { bottom:1px; top:auto; } -@media screen and (min-width:800px) { - #forkongithub { - position:fixed; - display:block; - top:0; - right:0; - width:200px; - overflow:hidden; - height:200px; - z-index:9999; - } - #forkongithub a { - width:200px; - position:absolute; - top:60px; - right:-60px; - transform:rotate(45deg); - -webkit-transform:rotate(45deg); - -ms-transform:rotate(45deg); - -moz-transform:rotate(45deg); - -o-transform:rotate(45deg); - box-shadow:4px 4px 10px rgba(0,0,0,0.8); - box-sizing: content-box; - } -} - - - -/* mid size (tablets, landscapes) */ -@media only screen and (max-width: 679px) { - nav { font-size:11px; } - nav ul li { - min-width:60px; - line-height:40px; - } -} - -/* tiny size (phones) */ -@media only screen and (max-width: 380px) { - nav ul li { min-width:90px; line-height:20px; } -} - -/* anything not desktop */ -@media only screen and (max-width: 767px) { - .container h1 { font-size: 30px; } - .container h2 { font-size: 24px; } - .container h3 { font-size: 20px; } - .container h4 { font-size: 18px; } - - - .section { padding:130px 0; } - .sectiondivider { - width:200px; - height:200px; - padding:15px; - top:-100px; - margin-left:-100px; - } - .sectiondivider img { - width:150px; - height:180px; - } - .sectiondivider .fa-stack { - font-size: 100px; - margin-top: -14px; - } - .sectiondivider h5 { - font-size:15px; - bottom:30px; - width:170px - } - - .columned { - -webkit-column-count: 2; - -moz-column-count: 2; - column-count: 2; - } -} diff --git a/_includes/css/skeleton.css b/_includes/css/skeleton.css deleted file mode 100755 index b4e0a55..0000000 --- a/_includes/css/skeleton.css +++ /dev/null @@ -1,91 +0,0 @@ - -/* -----------------------------------*/ -/* ----- 960px wide fancy grid! ----- */ -/* -----------------------------------*/ - -/* by tim o'brien, t413.com - * based on getskeleton.com - */ - - -/* ----- base grid----- */ - -.container { position: relative; width: 960px; margin: 0 auto; padding: 0; } -.container .column { float: left; display: inline; margin-left: 10px; margin-right: 10px; } -.row { margin-bottom: 20px; } - -.container .small.column { width: 300px; } -.container .half.column { width: 460px; } -.container .big.column { width: 620px; } -.container .full.column { width: 940px; } - - -/* ----- Tablet (Portrait) -- 768px ----- */ - @media only screen and (min-width: 768px) and (max-width: 959px) { - .container { width: 768px; } - - .container .small.column { width: 236px; } - .container .half.column { width: 364px; } - .container .big.column { width: 488px; } - .container .full.column { width: 748px; } - } - - -/* ----- Mobile (Portrait) ----- */ - @media only screen and (max-width: 767px) { - .container { width: 96%; } - .container .column { margin: 1%; } - - .container .small.column { width: 48%; } - .container .half.column { width: 48%; } - .container .big.column { width: 98%; } - .container .full.column { width: 98%; } - } - - -/* ----- Mobile (Landscape) -- 480px ----- */ - @media only screen and (min-width: 480px) and (max-width: 767px) { - .container { width: 92%; } - .container .column { margin: 2%; } - - .container .small.column { width: 46%; } - .container .half.column { width: 46%; } - .container .big.column { width: 96%; } - .container .full.column { width: 96%; } - } - - - -/* ----- Clearing ----- */ - - /* Self Clearing Goodness */ - .container:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; } - - /* Use clearfix class on parent to clear nested columns, - or wrap each row of columns in a
*/ - .clearfix:before, - .clearfix:after, - .row:before, - .row:after { - content: '\0020'; - display: block; - overflow: hidden; - visibility: hidden; - width: 0; - height: 0; } - .row:after, - .clearfix:after { - clear: both; } - .row, - .clearfix { - zoom: 1; } - - /* You can also use a
to clear columns */ - .clear { - clear: both; - display: block; - overflow: hidden; - visibility: hidden; - width: 0; - height: 0; - } diff --git a/_includes/footer.md b/_includes/footer.md deleted file mode 100755 index 03c22ff..0000000 --- a/_includes/footer.md +++ /dev/null @@ -1,16 +0,0 @@ - - -Website based on theme designed by Tim O'Brien [t413.com](http://t413.com/) -— -[SinglePaged theme](https://github.com/t413/SinglePaged) - - - - - - - - - - - diff --git a/_posts/2000-01-01-intro.md b/_posts/2000-01-01-intro.md deleted file mode 100755 index 05cf9f6..0000000 --- a/_posts/2000-01-01-intro.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: "home" -bg: white -color: black -style: center ---- - -# *JsonDB: a Opensource, Java-based, Database* -{: .text-purple} - - - - - - -## stores its data as .json files -{: .text-purple} - -Small memory footprint, runs embedded within your Java program, - -Provides APIs that are very similar in names and semantics to those of Spring Data for MongoDB, - -Supports encryption of data, XPath based search/find queries. - - - - Checkout on GitHub - - - - - - - - - - - - diff --git a/_posts/2000-01-02-why.md b/_posts/2000-01-02-why.md deleted file mode 100755 index b0034d8..0000000 --- a/_posts/2000-01-02-why.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Why" -bg: turquoise -color: white -fa-icon: check-square-o ---- - -## Why Jsondb - -You have a Java based program (or even Android App) and you: - -- Need a light weight database of some kind to store a small amount (a few 1000 rows) of data, -- Need a pure java, easy to use, thread safe database, -- Need some ORM support, -- Need a good query interface, -- Okay with Mongodb like per API level atomicity (okay with eventualy data consistency), -- Want to be able to easily add, edit, update, delete the db data files, even when Jsondb is running, -- Want to be able to move the db files seamlessly, download updated files over network while db is running, -- Want to be able to safegaurd sensitive data (passwords etc) in the db data files, with some high strength encryption, - -## Why NOT Jsondb - -- Jsondb loads the db data files into memory, all API's return deeply cloned objects so you will need minimum as much memory as the size of data files and some more, -- Jsondb does not have full transaction support (does support Mongodb like atomic API's) diff --git a/_posts/2000-01-03-download.md b/_posts/2000-01-03-download.md deleted file mode 100755 index f24bf67..0000000 --- a/_posts/2000-01-03-download.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "download" -bg: blue -color: white -fa-icon: download ---- - -## Getting Jsondb - -Stable Jsondb builds are uploaded to [Maven Central](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.jsondb%22%20AND%20a%3A%22jsondb-core%22) - -- You can download the **jar**, **source-jar** or **javadoc-jar** from Maven Central and use it in the traditional way by adding it into your classpath. Jsondb uses quite a few of other opensource java libraries so doing it this way will involve getting all those libraries and adding to your classpath. -- Optionally (Recommended) if you use Maven, Gradle or any such build system you can get it as a dependency using the appropriate dependency code. -- Since March 2019 two different builds are released, Each version is suffixed with -j8 or -j11. First one is built using Jdk version 1.8(LTS) and second one is built using Jdk version 11(LTS). This is to facilitate users who are still on Java 8. - -**Example:** -{% highlight html %} - - - io.jsondb - jsondb-core - 1.0.106 - -{% endhighlight %} diff --git a/_posts/2000-01-05-usage.md b/_posts/2000-01-05-usage.md deleted file mode 100755 index cbaee30..0000000 --- a/_posts/2000-01-05-usage.md +++ /dev/null @@ -1,246 +0,0 @@ ---- -title: "usage" -bg: orange -color: black -fa-icon: plug ---- - -## Using Jsondb - -The best way to understand usage of JsonDB is to look at code of the many Junit tests in its source code. Every possible scenario is covered in these junit test classes. - -**For those of you who need a quick intro:** -The main class to use in Jsondb is: `io.jsondb.JsonDBTemplate` JsonDBTemplate can be used in a very similar way as Spring Data MongoTemplate class. - -**Instantiating JsonDBTemplate** -{% highlight java %} -//Actual location on disk for database files, process should have read-write permissions to this folder -String dbFilesLocation = ""; - -//Java package name where POJO's are present -String baseScanPackage = "com.mypackage.model"; - -//Optionally a Cipher object if you need Encryption -ICipher cipher = new Default1Cipher("1r8+24pibarAWgS85/Heeg=="); - -JsonDBTemplate jsonDBTemplate = new JsonDBTemplate(dbFilesLocation, baseScanPackage, cipher); -{% endhighlight %} - -**Defining a POJO** - -Every object that you wish to save in JsonDB must be a POJO (Plain Old Java Object) that satisfies the JavaBean programming conventions. Each object must implement either Serializable or Externalizable, must have a no-arg(default) constructor, and each of its properties(attributes) must have public setter and getter methods. The names of these methods must be as per the JavaBean naming conventions. - -Note the package in the POJO its the same as the 2nd argument we passed while instantiating the `JsonDBTemplate` object. -Also note the 3 annotations in the POJO: - -- **@Document :** this annotation signifies that this POJO is a Jsondb Collection, the attribute `collection` specifies the name of the `.json` file on disk, the attribute `schemaVersion` specifies schema version this support is not yet completed. -- **@Id :** this annotation signifies that this field is the primary key in the collection. Jsondb supports only one Id field per collection. -- **@Secret :** this annotation signifies that the value of this field should be encrypted before writing to disk. -{% highlight java %} -package com.mypackage.model; - -import io.jsondb.annotation.Document; -import io.jsondb.annotation.Id; -import io.jsondb.annotation.Secret; - -/** - * A test Pojo representing a imaginary class Instance. - * @version 1.0 28-Sep-2016 - */ -@Document(collection = "instances", schemaVersion= "1.0") -public class Instance { - //This field will be used as a primary key, every POJO should have one - @Id - private String id; - private String hostname; - // This field will be encrypted using the provided cipher - @Secret - private String privateKey; - - public String getId() { return id; } - public void setId(String id) { this.id = id; } - public String getHostname() { return hostname; } - public void setHostname(String hostname) { this.hostname = hostname; } - public String getPrivateKey() { return privateKey; } - public void setPrivateKey(String privateKey) { this.privateKey = privateKey; } -} -{% endhighlight %} - -**Creating a collection if it does not exist** -{% highlight java %} -jsonDBTemplate.createCollection(Instance.class); -{% endhighlight %} - -**Inserting a document into a collection** -{% highlight java %} -Instance instance = new Instance(); -instance.setId("11"); -instance.setHostname("ec2-54-191-11"); -instance.setPrivateKey("b87eb02f5dd7e5232d7b0fc30a5015e4"); -jsonDBTemplate.insert(instance); -{% endhighlight %} - -**Removing a document from a collection** -{% highlight java %} -Instance instance = new Instance(); -instance.setId("000012"); -jsonDBTemplate.remove(instance, Instance.class); -{% endhighlight %} - -**Save a document into a collection** -{% highlight java %} -Instance instance = new Instance(); -instance.setId("000015"); -jsonDBTemplate.save(instance, Instance.class); -{% endhighlight %} - -**Upsert a document into a collection** -{% highlight java %} -Instance instance = new Instance(); -instance.setId("07"); -instance.setHostname("ec2-54-191-07"); -instance.setPrivateKey("PrivateRyanSaved"); -instance.setPublicKey("TomHanks"); -jsonDBTemplate.upsert(instance); -{% endhighlight %} - -**Find a document when you know the Id** -{% highlight java %} -jsonDBTemplate.findById("000000", Instance.class); -{% endhighlight %} - -------------------------- - -## Backup and Restore - -JsonDB can backup all collection `.json` files to a zip archive and restore from that archive later. This is useful before schema changes, encryption key rotation, or routine data protection. - -The backup is a standard zip file containing one entry per collection (for example `instances.json`, `sites.json`). The `lock/` directory used at runtime is not included. - -**Backup the database to a zip file** -{% highlight java %} -// Writes /backups/my-db-backup.zip -jsonDBTemplate.backup("/backups/my-db-backup.zip"); - -// If the path does not end with .zip, the extension is added automatically -jsonDBTemplate.backup("/backups/my-db-backup"); - -// If the path is an existing directory, jsondb-backup.zip is created inside it -jsonDBTemplate.backup("/backups/"); -{% endhighlight %} - -**Restore from a backup (replace mode)** - -Use replace mode when you want the database to match the backup exactly. Existing collection files are removed and replaced with the contents of the zip. -{% highlight java %} -jsonDBTemplate.restore("/backups/my-db-backup.zip", false); -{% endhighlight %} - -**Restore from a backup (merge mode)** - -Use merge mode to upsert documents from the backup into the current database. Documents with the same id are updated; documents that exist only in the backup are added. Collections that exist in the backup but not in the database are loaded automatically. -{% highlight java %} -jsonDBTemplate.restore("/backups/my-db-backup.zip", true); -{% endhighlight %} - -If you pass a directory path for restore, JsonDB looks for `jsondb-backup.zip` inside that directory. - -------------------------- - -## XPath based Queries in Jsondb - -XPATH syntax allows for numerous ways to query and locate document(s) of interest. -Below are few examples: - -**Find a document(s) with equals criteria** -{% highlight java %} -String jxQuery = String.format("/.[id='%s']", "01"); -List instances = jsonDBTemplate.find(jxQuery, Instance.class); -{% endhighlight %} - -**Find a document(s) with NOT equals criteria** -{% highlight java %} -String jxQuery = "/.[not(privateKey='')]"; -List instances = jsonDBTemplate.find(jxQuery, Instance.class); -{% endhighlight %} - -**Find a document(s) with greater than criteria** -{% highlight java %} -String jxQuery = String.format("/.[id>'%s']", "01"); -List instances = jsonDBTemplate.find(jxQuery, Instance.class); -{% endhighlight %} - -**Find and Remove first document based on query as Atomic operation** -{% highlight java %} -String jxQuery = String.format("/.[id>'%s']", "04"); -Instance removedObjects = jsonDBTemplate.findAndRemove(jxQuery, Instance.class); -{% endhighlight %} - -**Find and Remove all documents based on query as Atomic operation** -{% highlight java %} -String jxQuery = String.format("/.[id>'%s']", "04"); -IList removedObjects = jsonDBTemplate.findAllAndRemove(jxQuery, Instance.class); -{% endhighlight %} - -**Find and Modify first document based on query as Atomic operation** -{% highlight java %} -Update update = Update.update("privateKey", "SavingPrivateRyan"); -update.set("publicKey", "SavedByPublic"); - -String jxQuery = String.format("/.[id='%s']", "03"); -Instance retInstance = jsonDBTemplate.findAndModify(jxQuery, update, "instances"); -{% endhighlight %} - -**Find and Remove all documents based on query as Atomic operation** -{% highlight java %} -Update update = Update.update("privateKey", "SavingPrivateRyan"); -update.set("publicKey", "SavedByPublic"); - -String jxQuery = String.format("/.[id>'%s']", "03"); -List retInstances = jsonDBTemplate.findAllAndModify(jxQuery, update, "instances"); -{% endhighlight %} - -------------------------- - -## Sorting and Slicing in Jsondb - -**Sorting** -Jsondb allows you to obtain a sorted result with the find() and findAll() methods. -{% highlight java %} -Comparator comparator = new Comparator() { - @Override - public int compare(Instance o1, Instance o2) { - return (o1.getSomeAttribute().compareTo(o2.getSomeAttribute())); - } -}; -List instances = jsonDBTemplate.findAll(Instance.class, comparator); -{% endhighlight %} - -**Slicing** -Jsondb slicing feature is similar to the python/numpy slicing feature. Slice string parameter is expected in format i:j:k and should following all the rules similar to the slicing feature in python/numpy. Slicing can be used in combination with sorting or without sorting -{% highlight java %} -List instances = jsonDBTemplate.findAll(Instance.class, null, "0:7:2"); -{% endhighlight %} - -------------------------- - -## Encryption support in Jsondb - -- If you do not need encryption support simply use a `JsonDBTemplate` constructor that does not require a cipher argument or pass null. Make sure you are not using the `@Secret` annotation in any of your POJO's. - -- However If you do need encryption support then as in the examples above instantiate a instance of `io.jsondb.crypto.Default1Cipher` class and pass that when instantiating `JsonDBTemplate`. - -- If you need help creating a secure `Symmetric Key` for the above default cipher use the following standalone. -{% highlight java %} -String base64EncodedKey = CryptoUtil.generate128BitKey("SomeSecretPassword", "SomeUniqueSecreteSalt"); -{% endhighlight %} - -- If you need a 192bit or 256bit secure `Symmetric Key` ensure that you have the Unlimited Strength JCE Policy jars in your `JRE\lib\security` folder and then write a modifed method similar the the `CryptoUtil.generate128BitKey()`. Compile and Execute it and use the key when instantiating `JsonDBTemplate`. - -- If you need a custom encryption support say DES Encryption you can implement the interface `io.jsondb.crypto.ICipher` and then use that when instantiating `JsonDBTemplate`. - -- At some later time if you need to change the `cipher` and/or the `key` used then use the below api. Make sure you back up the database files in case something goes wrong. -{% highlight java %} -ICipher newCipher = new Default1Cipher("SomeNewKey"); -jsonDBTemplate.changeEncryption(newCipher); -{% endhighlight %} diff --git a/astro.config.mjs b/astro.config.mjs new file mode 100644 index 0000000..fbb4a4d --- /dev/null +++ b/astro.config.mjs @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2026 Farooq Khan + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; +import starlightLinksValidator from 'starlight-links-validator'; + +const site = 'https://jsondb.github.io'; + +export default defineConfig({ + site, + integrations: [ + starlight({ + title: 'JsonDB', + description: + 'An embedded Java database that stores its data as plain JSON files, with XPath queries and optional encryption.', + logo: { src: './src/assets/logo-small.svg', alt: '' }, + favicon: '/favicon.svg', + social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/Jsondb/jsondb-core' }], + editLink: { baseUrl: 'https://github.com/Jsondb/jsondb.github.io/edit/master/' }, + customCss: ['@fontsource-variable/inter', '@fontsource-variable/jetbrains-mono', './src/styles/theme.css'], + components: { SiteTitle: './src/components/SiteTitle.astro' }, + plugins: [starlightLinksValidator()], + head: [ + { tag: 'link', attrs: { rel: 'icon', href: '/favicon.ico', sizes: '32x32' } }, + { tag: 'link', attrs: { rel: 'apple-touch-icon', href: '/apple-touch-icon.png' } }, + { tag: 'meta', attrs: { property: 'og:image', content: `${site}/og.png` } }, + { tag: 'meta', attrs: { property: 'og:image:width', content: '1200' } }, + { tag: 'meta', attrs: { property: 'og:image:height', content: '630' } }, + { tag: 'meta', attrs: { name: 'twitter:card', content: 'summary_large_image' } }, + ], + sidebar: [ + { label: 'Start here', items: ['start/introduction', 'start/installation', 'start/quick-start'] }, + { + label: 'Guides', + items: [ + 'guides/documents', + 'guides/jsondbtemplate', + 'guides/android-osgi', + 'guides/crud', + 'guides/queries', + 'guides/sorting-slicing', + 'guides/find-and-modify', + 'guides/encryption', + 'guides/schema-versions', + 'guides/backup-restore', + 'guides/file-change-listeners', + ], + }, + { + label: 'Reference', + items: [ + 'reference/xpath-cheatsheet', + 'reference/upgrading', + 'reference/security', + { label: 'Javadoc', link: 'https://javadoc.io/doc/io.jsondb/jsondb-core/1.1.16/', attrs: { target: '_blank' } }, + { label: 'Changelog', link: 'https://github.com/Jsondb/jsondb-core/blob/master/CHANGELOG.md', attrs: { target: '_blank' } }, + { label: 'Releases', link: 'https://github.com/Jsondb/jsondb-core/releases', attrs: { target: '_blank' } }, + ], + }, + ], + }), + ], +}); diff --git a/combo.css b/combo.css deleted file mode 100755 index c64e1a6..0000000 --- a/combo.css +++ /dev/null @@ -1,5 +0,0 @@ ---- ---- -{% include css/base.css %} -{% include css/skeleton.css %} -{% include css/main.css %} diff --git a/docs/superpowers/plans/2026-11-16-website-overhaul.md b/docs/superpowers/plans/2026-11-16-website-overhaul.md new file mode 100644 index 0000000..3c991d4 --- /dev/null +++ b/docs/superpowers/plans/2026-11-16-website-overhaul.md @@ -0,0 +1,517 @@ +# JsonDB website overhaul: implementation plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Replace the Jekyll site with an Astro + Starlight docs site for `jsondb-core` 1.1.16, with the new icon and indigo theme. Also finish the repository hygiene in #80. + +**Architecture:** A static Starlight site at the repo root, built and deployed by a GitHub Actions workflow whose `build` job is the required PR check. Content is Markdown/MDX in `src/content/docs/`, and every Java snippet in it is compiled against the published 1.1.16 artifact in a scratch project. The `jsondb-core` hygiene work happens in a separate git worktree, so the other session's checkout of `jsondb-core` is never touched. + +**Tech Stack:** Node 26 (LTS), Astro 7.4.12, @astrojs/starlight 0.43.1, starlight-links-validator 0.27.0, sharp 0.35.5, GitHub Actions, and JDK 17 (Homebrew) for the snippet check. + +**Spec:** `docs/superpowers/specs/2026-11-16-website-overhaul-design.md` + +## Global Constraints + +- Document only what's published in `io.jsondb:jsondb-core:1.1.16`. Nothing from the CHANGELOG's *Unreleased* section (e.g. `setSyncFolderOnWrite` doesn't exist in 1.1.16). +- Source of truth for the API: `git -C ../jsondb-core show v1.1.16:`, **never** the `jsondb-core` working tree, which another session is editing. +- Claims to quote exactly: Java 8 and later; Android **API 26+** (from `Readme.md` at v1.1.16); OSGi. +- Snippets for the Java 8 baseline use `Arrays.asList(...)`. `List.of(...)` appears only where a page says it needs Java 9+ or Android API 30+. +- Commits: identity `FarooqKhan `, already set in each repo. **No `Co-Authored-By`, `Claude-Session` or any AI attribution in commits, PR titles, PR bodies or comments.** +- New source files (`.mjs`, `.ts`, `.css`, `.astro`) carry the MIT header with `Copyright (c) 2026 Farooq Khan`. Markdown content, JSON, YAML and SVG files don't. +- `LICENSE.txt` (Tim O'Brien's theme licence) is **left untouched**, and the PR asks Farooq what he wants there. +- npm commands always take `--cache /private/tmp/claude-501/-Users-farooq-work-a-jsondb-jsondb-github-io/50088a72-a02b-4efc-88aa-392f4834f688/scratchpad/npm-cache` and run with `allowed_domains: ["registry.npmjs.org"]`. The default `~/.npm` isn't writable in the sandbox. +- Bash: inline literal paths, no shell variables. Prefer `git -C ` over `cd … &&`. +- Every PR has a "Where to look" section, says what it does **not** do, and is never merged by me. +- Repository settings (Pages source, branch protection, security alerts) change only after Farooq confirms each one in chat. + +## File structure (site repo, after the work) + +``` +.github/workflows/deploy.yml build on PR; build + deploy on push to master +.github/dependabot.yml npm (grouped, weekly) + github-actions (weekly) +.gitignore node_modules/, dist/, .astro/ +.nvmrc 26 +astro.config.mjs site URL, Starlight config, sidebar, head tags +package.json / package-lock.json +README.md what this repo is, local dev, how deploys work +scripts/build-icons.mjs SVG → favicon.ico, apple-touch-icon.png, og.png +src/assets/logo.svg large artwork (≥48 px) +src/assets/logo-small.svg small artwork (≤32 px); header logo +src/assets/logo-mono.svg monochrome, currentColor +src/components/SiteTitle.astro overrides Starlight's title: mark + "JsonDB" +src/components/CodeAndFile.astro landing demo: Java on the left, users.json on the right +src/content.config.ts docsLoader() + docsSchema() +src/content/docs/index.mdx splash landing page +src/content/docs/start/*.md(x) introduction, installation, quick-start +src/content/docs/guides/*.md(x) 11 guides +src/content/docs/reference/*.md xpath-cheatsheet, upgrading, security +src/styles/theme.css indigo/zinc tokens and landing-page styling +public/favicon.svg, favicon.ico, apple-touch-icon.png, og.png +docs/superpowers/… spec and this plan (Astro ignores them) +LICENSE.txt unchanged +``` + +Removed: `_config.yml`, `Gemfile`, `Gemfile.lock`, `_posts/`, `_includes/`, `combo.css`, `site.js`, `feed.xml`, `index.html`, `img/`. + +--- + +### Task 1: `jsondb-core` hygiene PR (Dependabot and issue forms) + +**Files:** these are created in a **worktree**, not in the other session's checkout. +- Create: `.github/dependabot.yml` +- Create: `.github/ISSUE_TEMPLATE/bug_report.yml` +- Create: `.github/ISSUE_TEMPLATE/feature_request.yml` +- Create: `.github/ISSUE_TEMPLATE/config.yml` + +- [ ] **Step 1: Create the worktree from `origin/master`.** + Run: `git -C /Users/farooq/work_a/jsondb/jsondb-core fetch origin master` (network: github.com), then `git -C /Users/farooq/work_a/jsondb/jsondb-core worktree add /private/tmp/claude-501/-Users-farooq-work-a-jsondb-jsondb-github-io/50088a72-a02b-4efc-88aa-392f4834f688/scratchpad/core-hygiene -b repo-hygiene origin/master`. + Expected: a new directory on branch `repo-hygiene`. The other session's branch and working tree are unchanged. +- [ ] **Step 2: Write `.github/dependabot.yml`.** + +```yaml +version: 2 +updates: + - package-ecosystem: gradle + directory: / + schedule: + interval: weekly + open-pull-requests-limit: 5 +``` + +- [ ] **Step 3: Write `bug_report.yml`.** It's an issue form (`name`, `description`, `labels: [bug]`) with these fields: + - `jsondb-version`, input, required, placeholder `1.1.16`; + - `java-version`, input, required, placeholder `17 (Temurin)`; + - `platform`, dropdown: JVM (desktop/server), Android, OSGi, Other; + - `android-api`, input, optional, "Android API level, if on Android"; + - `what-happened`, textarea, required; + - `expected`, textarea, required; + - `reproduce`, textarea, required, "Minimal code or steps. A failing JUnit test is ideal.", `render: java`; + - `logs`, textarea, optional, `render: text`. +- [ ] **Step 4: Write `feature_request.yml`.** Labels `[enhancement]`. Fields: `problem` (required), `proposal` (required), `alternatives` (optional), and `jsondb-version` (optional). +- [ ] **Step 5: Write `config.yml`.** Set `blank_issues_enabled: true`, plus a `contact_links` entry "Documentation", pointing to https://jsondb.github.io. +- [ ] **Step 6: Validate the YAML.** + Run: `ruby -ryaml -e 'ARGV.each { |f| YAML.load_file(f); puts "ok #{f}" }' ` + Expected: four `ok` lines. +- [ ] **Step 7: Commit, push, open the PR.** + - Commit message: `Add Dependabot for Gradle and issue forms for bugs and feature requests.` + - Push with `git push -u origin repo-hygiene` (network: github.com). + - `gh pr create -R Jsondb/jsondb-core`. The body has "Where to look" (all four files: skim; the bug form's required fields are the part to check), says it doesn't enable security alerts (a settings change, asked separately), and adds "Part of #80". +- [ ] **Step 8: Remove the worktree after the PR is open.** + Run: `git -C /Users/farooq/work_a/jsondb/jsondb-core worktree remove /private/tmp/claude-501/-Users-farooq-work-a-jsondb-jsondb-github-io/50088a72-a02b-4efc-88aa-392f4834f688/scratchpad/core-hygiene`. The branch stays on the remote. + +### Task 2: Scaffold Starlight, remove Jekyll + +**Files:** +- Delete: `_config.yml Gemfile Gemfile.lock _posts _includes combo.css site.js feed.xml index.html img` +- Create: `package.json`, `.nvmrc`, `.gitignore` (replacing the old one), `astro.config.mjs`, `src/content.config.ts`, `src/styles/theme.css`, `src/components/SiteTitle.astro`, `src/content/docs/index.mdx` (minimal for now) + +**Produces:** +- npm scripts `dev`, `build`, `preview`, `icons`; +- the sidebar slugs used by every later task (listed in the config below); +- the CSS custom properties `--jdb-*` used by the landing page. + +- [ ] **Step 1: `git rm -r` the Jekyll files listed above.** +- [ ] **Step 2: Write `package.json`.** + +```json +{ + "name": "jsondb-website", + "private": true, + "type": "module", + "scripts": { + "dev": "astro dev", + "build": "astro build", + "preview": "astro preview", + "icons": "node scripts/build-icons.mjs" + }, + "dependencies": { + "@astrojs/starlight": "0.43.1", + "astro": "7.4.12", + "sharp": "0.35.5" + }, + "devDependencies": { + "starlight-links-validator": "0.27.0" + }, + "engines": { "node": ">=22.23.4" } +} +``` + +- [ ] **Step 3: Write the dotfiles.** + - `.nvmrc` contains `26`. + - `.gitignore` contains `node_modules/`, `dist/`, `.astro/` and `.DS_Store`. +- [ ] **Step 4: Write `src/content.config.ts`.** MIT header, then: + +```ts +import { defineCollection } from 'astro:content'; +import { docsLoader } from '@astrojs/starlight/loaders'; +import { docsSchema } from '@astrojs/starlight/schema'; + +export const collections = { + docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), +}; +``` + +- [ ] **Step 5: Write `astro.config.mjs`.** MIT header, then: + +```js +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; +import starlightLinksValidator from 'starlight-links-validator'; + +const site = 'https://jsondb.github.io'; + +export default defineConfig({ + site, + integrations: [ + starlight({ + title: 'JsonDB', + description: 'An embedded Java database that stores its data as plain JSON files, with XPath queries and optional encryption.', + logo: { src: './src/assets/logo-small.svg', alt: '' }, + favicon: '/favicon.svg', + social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/Jsondb/jsondb-core' }], + editLink: { baseUrl: 'https://github.com/Jsondb/jsondb.github.io/edit/master/' }, + customCss: ['./src/styles/theme.css'], + components: { SiteTitle: './src/components/SiteTitle.astro' }, + plugins: [starlightLinksValidator()], + head: [ + { tag: 'link', attrs: { rel: 'icon', href: '/favicon.ico', sizes: '32x32' } }, + { tag: 'link', attrs: { rel: 'apple-touch-icon', href: '/apple-touch-icon.png' } }, + { tag: 'meta', attrs: { property: 'og:image', content: `${site}/og.png` } }, + { tag: 'meta', attrs: { name: 'twitter:card', content: 'summary_large_image' } }, + ], + sidebar: [ + { label: 'Start here', items: ['start/introduction', 'start/installation', 'start/quick-start'] }, + { + label: 'Guides', + items: [ + 'guides/documents', 'guides/jsondbtemplate', 'guides/android-osgi', 'guides/crud', + 'guides/queries', 'guides/sorting-slicing', 'guides/find-and-modify', 'guides/encryption', + 'guides/schema-versions', 'guides/backup-restore', 'guides/file-change-listeners', + ], + }, + { + label: 'Reference', + items: [ + 'reference/xpath-cheatsheet', 'reference/upgrading', 'reference/security', + { label: 'Javadoc', link: 'https://javadoc.io/doc/io.jsondb/jsondb-core/1.1.16/', attrs: { target: '_blank' } }, + { label: 'Changelog', link: 'https://github.com/Jsondb/jsondb-core/blob/master/CHANGELOG.md', attrs: { target: '_blank' } }, + { label: 'Releases', link: 'https://github.com/Jsondb/jsondb-core/releases', attrs: { target: '_blank' } }, + ], + }, + ], + }), + ], +}); +``` + + The "New" badges come from each page's frontmatter (`sidebar: { badge: { text: 'New', variant: 'tip' } }`), which Starlight applies to slug entries. +- [ ] **Step 6: Write `src/components/SiteTitle.astro`.** MIT header in an Astro frontmatter comment. It renders the configured logo image and the text `JsonDB`, linking to `/`, with Starlight's own `.site-title` class and sizing so the header layout doesn't change. The logo comes from `Astro.locals.starlightRoute` (`siteTitleHref`). Check the prop and locals names in the installed `node_modules/@astrojs/starlight/components/SiteTitle.astro` and copy its structure. +- [ ] **Step 7: Write `src/styles/theme.css`** (MIT header). It sets Starlight's colour variables. Dark is the default `:root`; light uses `:root[data-theme='light']`. + +```css +:root { + --sl-color-accent-low: #312e81; + --sl-color-accent: #6366f1; + --sl-color-accent-high: #c7d2fe; + --sl-color-white: #fafafa; + --sl-color-gray-1: #f4f4f5; + --sl-color-gray-2: #e4e4e7; + --sl-color-gray-3: #a1a1aa; + --sl-color-gray-4: #71717a; + --sl-color-gray-5: #3f3f46; + --sl-color-gray-6: #27272a; + --sl-color-black: #09090b; + --jdb-cyan: #67e8f9; + --jdb-grad: linear-gradient(90deg, #a5b4fc, #67e8f9); +} +:root[data-theme='light'] { + --sl-color-accent-low: #e0e7ff; + --sl-color-accent: #4f46e5; + --sl-color-accent-high: #3730a3; + --sl-color-white: #18181b; + --sl-color-gray-1: #27272a; + --sl-color-gray-2: #3f3f46; + --sl-color-gray-3: #52525b; + --sl-color-gray-4: #a1a1aa; + --sl-color-gray-5: #d4d4d8; + --sl-color-gray-6: #f4f4f5; + --sl-color-gray-7: #fafafa; + --sl-color-black: #ffffff; + --jdb-cyan: #0e7490; + --jdb-grad: linear-gradient(90deg, #4f46e5, #0e7490); +} +.jdb-accent { color: var(--sl-color-text-accent); } +``` + + Starlight's light theme also defines `--sl-color-gray-7`, so set it in light. Also check the variable list against the installed `dist/style/props.css` and add any accent or grey token that's missing. +- [ ] **Step 8: Write a minimal `src/content/docs/index.mdx`** with `title: JsonDB` and `template: splash`. Task 5 fills it in. Put a one-line `.md` page at every sidebar slug for now (title only) so the build resolves. +- [ ] **Step 9: Install and build.** + - Run `npm install --cache --no-audit --no-fund`, then `npm run build`. + - Expected: the build succeeds, `dist/index.html` exists, and the links validator reports no errors. +- [ ] **Step 10: Commit.** Message: `Replace the Jekyll site with an Astro Starlight scaffold.` + +### Task 3: Icons + +**Files:** +- Create: `src/assets/logo.svg`, `src/assets/logo-small.svg`, `src/assets/logo-mono.svg`, `public/favicon.svg`, `scripts/build-icons.mjs` +- Generate: `public/favicon.ico`, `public/apple-touch-icon.png`, `public/og.png` + +**Consumes:** the geometry from the spec's Icon section, exactly as approved on the `icon-c-v2` screen (the C2 large, C3 small and M mono symbols). + +- [ ] **Step 1: Write the three SVGs.** + - Each is a standalone file with `viewBox="0 0 64 64"` and its own `` (gradient ids prefixed `jdb-` so they don't clash when inlined). + - Paths are copied verbatim from the approved C2/C3/M symbols. + - `logo-mono.svg` uses `fill`/`stroke="currentColor"`, with the band mask. + - `public/favicon.svg` is a copy of `logo-small.svg`. +- [ ] **Step 2: Write `scripts/build-icons.mjs`** (MIT header). It uses `sharp`: + - Render `logo-small.svg` to 16 and 32 px PNGs, and `logo.svg` to a 48 px PNG. Pack all three into `public/favicon.ico` with a small PNG-in-ICO writer (Windows Vista and later support PNG entries): + +```js +function pngsToIco(pngs) { // pngs: [{ size, data: Buffer }] + const header = Buffer.alloc(6); + header.writeUInt16LE(0, 0); header.writeUInt16LE(1, 2); header.writeUInt16LE(pngs.length, 4); + const dir = Buffer.alloc(16 * pngs.length); + let offset = 6 + dir.length; + pngs.forEach(({ size, data }, i) => { + const o = i * 16; + dir.writeUInt8(size >= 256 ? 0 : size, o); + dir.writeUInt8(size >= 256 ? 0 : size, o + 1); + dir.writeUInt8(0, o + 2); dir.writeUInt8(0, o + 3); + dir.writeUInt16LE(1, o + 4); dir.writeUInt16LE(32, o + 6); + dir.writeUInt32LE(data.length, o + 8); dir.writeUInt32LE(offset, o + 12); + offset += data.length; + }); + return Buffer.concat([header, dir, ...pngs.map((p) => p.data)]); +} +``` + + - Render `logo.svg` to `public/apple-touch-icon.png` at 180 px. Flatten it onto `#4338ca`, because iOS shows a transparent background as black and applies its own corner mask. + - Build `public/og.png` at 1200 × 630 from an SVG string: + - a `#09090b` background, with a radial indigo glow at the top right and a cyan glow at the bottom left; + - `logo.svg` inlined at 220 px on the left; + - "Json" + "DB" in `#a5b4fc` at 96 px, weight 700, font family `Inter, 'Helvetica Neue', Arial, sans-serif`; + - the tagline "An embedded Java database that's just JSON files" at 34 px in `#a1a1aa`; + - "jsondb.github.io" at 26 px in `#71717a`. +- [ ] **Step 3: Generate.** Run `npm run icons`. Expected: the three files exist, and `file public/favicon.ico` reports "MS Windows icon resource - 3 icons". +- [ ] **Step 4: Check by eye.** + - Use the Read tool to look at `public/og.png`, `public/apple-touch-icon.png`, and an 8× nearest-neighbour upscale of the 16 px PNG (written to scratch, not committed). + - Check: the braces are clear of the tile edge, the band is visible at 16 px, and the og text doesn't overlap the logo. + - If something looks wrong, fix the geometry and repeat Steps 3–4. +- [ ] **Step 5: Build and commit.** Run `npm run build`, then commit with `Add the new JsonDB icon, favicons and social card.` + +### Task 4: Snippet verification harness (scratch, never committed) + +**Files:** +- Create (scratch): `/private/tmp/claude-501/-Users-farooq-work-a-jsondb-jsondb-github-io/50088a72-a02b-4efc-88aa-392f4834f688/scratchpad/snippets/`, containing `build.gradle`, `settings.gradle`, the Gradle wrapper copied from `jsondb-core` (read-only copy), and `src/main/java/docs/*.java`. + +**Produces:** a `verify` command that later tasks run after adding their snippets: +`JAVA_HOME=/opt/homebrew/opt/openjdk@17 /…/scratchpad/snippets/gradlew -p /…/scratchpad/snippets run` + +- [ ] **Step 1: Copy the wrapper.** Copy `gradlew` and `gradle/wrapper/` from `/Users/farooq/work_a/jsondb/jsondb-core` with `cp`. This only reads `jsondb-core`. +- [ ] **Step 2: Write `build.gradle`.** + +```groovy +plugins { id 'application' } +repositories { mavenCentral() } +dependencies { + implementation 'io.jsondb:jsondb-core:1.1.16' + runtimeOnly 'org.slf4j:slf4j-simple:2.0.17' +} +java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } +tasks.withType(JavaCompile).configureEach { options.release = 8 } +application { mainClass = 'docs.RunAll' } +``` + + Java 8 snippets compile with `--release 8`, so any Java 9+ API slipping into them fails the build. Pages that show `List.of` keep those lines in a separate `Java9Snippets.java` compiled by a second source set with `release = 9`. +- [ ] **Step 3: Write `docs/RunAll.java`.** + - `main` creates a temp folder, then calls each `XxxSnippets.run(Path dbDir)` in turn, each with a fresh subfolder. + - Each snippet class includes the doc's code **verbatim** and asserts what the doc claims, throwing `AssertionError` if a claim is false. For example: `count()` returns 2 after two inserts; `restore(…, true)` merges. +- [ ] **Step 4: Run once with an empty `RunAll`.** + - Network: `repo.maven.apache.org`, `repo1.maven.org`, `services.gradle.org`, `downloads.gradle.org`. + - Expected: BUILD SUCCESSFUL. This proves 1.1.16 resolves from Maven Central. + +### Task 5: Landing page + +**Files:** +- Modify: `src/content/docs/index.mdx` +- Create: `src/components/CodeAndFile.astro` +- Modify: `src/styles/theme.css` (landing-page section) + +- [ ] **Step 1: Write the `index.mdx` frontmatter.** + - `template: splash`. + - `hero`: + - `title: "A database that's just JSON files"`; + - `tagline`: the pitch paragraph from the layout screen; + - `image: { file: ../../assets/logo.svg }`; + - `actions`: "Get started" (`/start/quick-start/`, primary, `icon: right-arrow`) and "View on GitHub" (`https://github.com/Jsondb/jsondb-core`, minimal, `icon: external`). + - Check that the hero title accepts HTML in Starlight 0.43 (`schemas/hero.js`). If it doesn't, use `HeroTitle` text without the span and apply the gradient with CSS on `.hero h1`. +- [ ] **Step 2: Write the body.** + - A `` above the tabs. + - `` with Gradle (`implementation "io.jsondb:jsondb-core:1.1.16"`) and Maven (the `` block). + - `` with the six cards from the spec, using Starlight icons: `seti:json`, `magnifier`, `approve-check`, `random`, `download`, `rocket`. + - ``. +- [ ] **Step 3: Write `CodeAndFile.astro`.** + - Two Starlight `` blocks side by side (stacked under 50rem): the Java `User` snippet and the matching `users.json`. + - The JSON is whatever Task 4's harness actually writes. Run the snippet and paste the real file contents; don't invent the format. +- [ ] **Step 4: Add the snippet to the harness.** Add `LandingSnippets` to Task 4's harness, run `verify`, then run `npm run build`. Both must pass. +- [ ] **Step 5: Commit.** Message: `Add the landing page.` + +### Tasks 6–9: Documentation pages + +Each page follows the same cycle: +1. Read the listed source at `v1.1.16`. +2. Write the page. +3. Add its snippets verbatim to `docs/Snippets.java`, with assertions for every behavioural claim. +4. Run `verify`, then `npm run build`. +5. Commit each task's pages together. + +Frontmatter on every page: `title`, `description` (one sentence), and, for 1.1.x additions, `sidebar: { badge: { text: 'New', variant: 'tip' } }`. + +#### Task 6: Start here + +- **`start/introduction.md`** + - Sections: what JsonDB is (in-memory, with every write saved to `.json` files); good fits (config/state stores, desktop and Android apps, tests, small services); when *not* to use it (large datasets, multi-process writers, heavy concurrent write load, needs SQL or transactions); how it compares to "just use a JSON file". + - Sources: the old `_posts/2000-01-02-why.md` (from git history), `Readme.md`@v1.1.16. +- **`start/installation.md`** + - Sections: Gradle (Kotlin and Groovy tabs), Maven, the plain jar from Maven Central; Java 8+, one artifact; logging is SLF4J (add a binding); Android note linking to the Android guide. + - Check the SLF4J dependency claim in `build.gradle`@v1.1.16. +- **`start/quick-start.mdx`** + - Uses ``: define `User` with `@Document(collection="users", schemaVersion="1.0")` and `@Id`; create a `JsonDBTemplate` with try-with-resources and `Arrays.asList(User.class)`; `createCollection` if `!collectionExists`; `insert`, `find`, `count`; show the resulting `users.json`. + - The program runs end to end in the harness. + +#### Task 7: Guides, part 1 + +- **`guides/documents.md`** + - `@Document` (`collection`, `schemaVersion`), `@Id` (one per class; JsonDB's own annotation, and `javax.persistence.Id` is rejected with `InvalidJsonDbApiUsageException`), `@Secret` (needs a cipher; String fields). + - Requirements for POJOs: check the Serializable and getter/setter claims against `ReflectionPropertyHandler.java`@v1.1.16 and write only what's true. + - Sources: `annotation/*.java`. +- **`guides/jsondbtemplate.md`** *(New)* + - Table of all seven constructors, from `JsonDBTemplate.java`@v1.1.16 lines 100–147. + - Package scanning vs entity classes; one instance per folder, shared between threads; the warning text; `close()` and try-with-resources; `reLoadDB`/`reloadCollection`; `compatibilityMode` and `schemaComparator`. +- **`guides/android-osgi.md`** *(New)* + - API 26+; why package scanning fails; pass entity classes; no `java.beans` or `SunJCE` needed; where to put the database folder (`context.getFilesDir()`). + - Android snippets are illustrative and use only JsonDB API. The Android `Context` line is marked as Android-only, and its JsonDB calls are compiled in the harness with a plain path. +- **`guides/crud.md`** + - `createCollection`/`collectionExists`/`dropCollection`; `insert` (fails on a duplicate id); `save` (fails if missing); `upsert`; `remove` (returns the removed document); batch variants; `findById`, `findOne`, `findAll`, `getCollection`; read-only collections; `InvalidJsonDbApiUsageException` for unknown collections. + - Check every "fails if…" claim in the harness. + +#### Task 8: Guides, part 2 + +- **`guides/queries.md`** (`count()` is *New*) + - JXPath basics (`/.[field='x']`); and/or/not; comparisons; `contains()`, `starts-with()`; nested properties; `find` by class vs by collection name; `findOne`; `count(Class)`/`count(String)`. + - A security callout: extension functions are disabled, core functions work; the example of `/.[java.lang.System.exit(0)]` now being rejected. + - Check in the harness: `contains()`, `not()` and `count()` work, and an extension-function query throws. Record the exact exception type. +- **`guides/sorting-slicing.md`** + - `Comparator` (show both a lambda and `Comparator.comparing`, since both are Java 8); slice syntax `i:j:k`, with a table of examples taken from the slicing code at v1.1.16; `findAll(Class, null, "0:7:2")`. +- **`guides/find-and-modify.md`** + - `Update.update(field, value).set(...)`; `findAndModify`/`findAllAndModify`; `findAndRemove`/`findAllAndRemove`; the conversion rules from `query/Update.java` and `ReflectionPropertyHandler.java`@v1.1.16; changing `@Id` is rejected (#78), but setting it to its current value is allowed. + +#### Task 9: Guides, part 3, and Reference + +- **`guides/encryption.md`** + - `Default1Cipher` (AES-GCM; key format from `crypto/Default1Cipher.java`); `CryptoUtil.generate128BitKey(password, salt)`; `DefaultAESCBCCipher`, deprecated, and why; custom `ICipher`; `changeEncryption(newCipher)`, with a note to back up first; on disk only `@Secret` fields are encrypted. + - The harness shows a raw file containing ciphertext, and a round trip. +- **`guides/schema-versions.md`** + - `schemaVersion` on `@Document`; `CollectionSchemaUpdate.update(...)` with `RenameOperation`, `AddOperation`, `DeleteOperation` (constructors from `query/ddl/*`@v1.1.16); add fills only missing or null values; updates that would lose data are rejected (record the exception); `DefaultSchemaVersionComparator` and custom comparators. +- **`guides/backup-restore.md`** + - Port the existing section, adapted to Starlight with `