Skip to content

gaurav-nelson/vale-online-app

Repository files navigation

Demo

Vale at Red Hat online app

Simple web application to run Vale at Red Hat linting on a container locally with optional AI-powered issue fixing using Ollama and AsciiDoc to DITA conversion.

Features

Vale Linting: Lint AsciiDoc content using Vale at Red Hat rules
🎯 AsciiDocDITA Mode: Switch to DITA-specific linting rules with one-click DITA conversion
🤖 AI-Powered Fixing: Automatically fix Vale issues using Ollama
⚙️ Customizable Settings: Configure DITA conversion options and AI models
🌓 Dark Mode Support: Toggle between light and dark themes
💾 Download & Copy: Easily download or copy converted DITA files

How to run

  1. Run the following command to download the image and start the container:
docker pull quay.io/ganelson/vale-online-app && docker run --rm -p 8080:8080 quay.io/ganelson/vale-online-app
  1. Open your browser and go to http://localhost:8080
  2. Paste the content you want to check in the text area and click on the Lint button.
  3. To close the app, press Ctrl+C in the terminal where the container is running.

AI-Powered Issue Fixing with Ollama

The app includes an optional AI-powered feature to automatically fix Vale linting issues using Ollama.

Prerequisites

  1. Install and run Ollama on your host machine
  2. Pull at least one model (e.g., ollama pull llama2)

Using with Docker/Podman

When running the container, the app will automatically detect if Ollama is available on your host machine and show a "Fix issues with AI" button after linting.

For Docker:

docker run --rm -p 8080:8080 --add-host=host.docker.internal:host-gateway quay.io/ganelson/vale-online-app

For Podman:

podman run --rm -p 8080:8080 quay.io/ganelson/vale-online-app

Custom Ollama host/port: If Ollama is running on a different host or port, you can configure it:

docker run --rm -p 8080:8080 -e OLLAMA_HOST=localhost -e OLLAMA_PORT=11434 quay.io/ganelson/vale-online-app

How it works

  1. Run Vale lint on your content
  2. If Ollama is available, click "Fix issues with AI"
  3. Select which issues to fix (or use "Select All Errors"/"Select All Warnings")
  4. Click "Fix Selected Issues" to start the approval workflow
  5. For each issue:
    • Review the AI suggestion with word-level diff highlighting
    • Edit the suggestion directly if needed
    • Approve, Skip, or Retry for a new suggestion
  6. After reviewing all issues, click "Apply Changes" to update your text
  7. Choose your preferred AI model from the Settings menu

AsciiDocDITA Mode

The app includes a special DITA mode for converting AsciiDoc files to DITA format with DITA-specific linting rules, specialized DITA types, and automated cleanup.

How to use

  1. Enable DITA Mode: Toggle the "DITA mode" switch in the header (near the app title)
  2. Lint your content: Paste your AsciiDoc content and click "Lint"
  3. Fix any issues: DITA mode uses strict DITA-specific rules from the asciidoctor-dita-vale package
  4. Convert to DITA: Once your content has no errors or warnings, the "Convert to DITA" button appears
  5. Get your DITA file:
    • With Auto-convert enabled (default): Automatically converts to specialized DITA (concept/reference/task) with type badge
    • With Auto-convert disabled: Shows generic DITA with buttons to manually convert to concept, reference, or task
    • View the DITA XML in the modal
    • Copy to clipboard or download the file
    • The filename is automatically extracted from your document's id attribute

DITA Conversion Settings

Access DITA conversion options from the Settings menu (gear icon) when in DITA mode:

Automation Settings (both enabled by default):

  • Auto-convert to specialized DITA: Automatically detect content type and convert to specialized DITA (concept/reference/task)
  • Auto-cleanup DITA: Automatically clean up DITA files after conversion using dita-cleanup utility

Conversion Options:

  • Enable author lines: Process author lines as metadata instead of paragraphs
  • Disable floating titles: Don't convert floating titles (may lose content)
  • Disable callouts: Don't convert callout annotations (may lose content)
  • Secure mode (enabled by default): Only convert the current file, don't resolve include directives

Technical Details

  • Uses asciidoctor-dita-topic gem for initial conversion to generic DITA
  • Uses dita-convert Python package to specialize DITA topics to concept, reference, or task
  • Uses dita-cleanup Python package to clean up generated DITA files
  • Applies DITA-specific Vale rules during linting
  • Mode preference is saved in your browser (localStorage)
  • Non-destructive: original AsciiDoc content remains unchanged
  • Supports custom DITA conversion options via Settings
  • Auto-detection of content type based on AsciiDoc metadata when available

Using custom Vale configuration

If you want to use a custom Vale configuration, you can mount a volume with the configuration file and specify the VALE_INI_PATH environment variable.

For example, if you have a .vale.ini file in the current directory, you can run the following command:

docker run --rm -p 8080:8080 -v $(pwd)/.vale.ini:/app/config/user.ini -e VALE_INI_PATH=/app/config/user.ini quay.io/ganelson/vale-online-app

Known Issues

Vale at Red Hat online app fails to load in Chrome on Fedora Linux 41

The Vale at Red Hat online app might fail to load on Google Chrome. See #2 for more information.

Workaround: Use Firefox to access the Vale at Red Hat online app on Fedora Linux 41 as a temporary workaround.

About

Run Vale-at-Red-Hat online app as a container

Resources

License

Stars

Watchers

Forks