diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..a684d0b --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,56 @@ +name: Release + +on: + push: + tags: + - "v*.*.*" + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Build changelog + id: changelog + shell: bash + run: | + git fetch --tags --force + current_tag="${GITEA_REF_NAME}" + previous_tag="$(git tag --sort=-creatordate | grep -v "^${current_tag}$" | head -n 1)" + if [ -n "$previous_tag" ]; then + range="${previous_tag}..${current_tag}" + header="Changes since ${previous_tag}" + else + range="${current_tag}" + header="Initial release" + fi + { + echo "notes<> "$GITEA_OUTPUT" + + - name: Package extension + shell: bash + run: | + mkdir -p dist + zip -r "dist/json-content-formatter-${GITEA_REF_NAME}.zip" \ + . \ + -x ".git/*" \ + -x ".gitea/*" \ + -x "dist/*" + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + body: ${{ steps.changelog.outputs.notes }} + files: dist/json-content-formatter-${{ gitea.ref_name }}.zip diff --git a/README.md b/README.md new file mode 100644 index 0000000..4e1b4fb --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# JSON Content Formatter + +A Chrome extension that formats JSON in the current tab, highlights with +highlight.js, linkifies URLs, and offers collapsible views and line numbers. + +## Features +- Auto format (optional) for supported content types. +- Manual format via toolbar icon or context menu. +- Theme selection (light/dark + highlight.js theme). +- Line numbers toggle. +- Collapsible blocks for JSON, YAML, XML, and Markdown. + +## Supported Languages +Defaults to JSON only. Enable additional languages in options: +- JSON +- Markdown +- Plaintext +- XML +- YAML + +## Usage +1. Load the extension via `chrome://extensions` (Developer mode > Load unpacked). +2. Open the extension options to configure: + - Auto format + - Theme mode and highlight theme + - Line numbers + - Enabled languages +3. Use: + - Toolbar icon click to format the current tab + - Right-click the icon > "Einstellungen" to open options + - Right-click the page > "JSON jetzt formatieren" + +## Notes +- Auto format requires host permissions to read page content. +- Manual formatting uses language auto-detection only for enabled languages.