### Local Development with Ruby and Bundler Source: https://context7.com/kong/insomnia-docs/llms.txt This bash script provides instructions for setting up and running the documentation site locally using Ruby and Bundler. It covers installing prerequisites (Ruby, Bundler), installing dependencies, starting the development server, and building the static site. It also notes how to stop the server. ```bash # Prerequisites # - Install Ruby: https://www.ruby-lang.org/en/ # - Install Bundler: gem install bundler # Setup cd docs bundle install # Start development server bundle exec jekyll serve # Server starts at http://localhost:4000 # Site auto-rebuilds on file changes # Ctrl+C to stop the server # Build static site without serving bundle exec jekyll build # Output in docs/_site/ ``` -------------------------------- ### Local Development with Nix Source: https://context7.com/kong/insomnia-docs/llms.txt This bash script outlines the steps for setting up a reproducible development environment for the documentation site using the Nix package manager. It includes entering the Nix shell, installing Ruby dependencies, and starting the Jekyll development server with live reloading. Instructions for exiting the shell are also provided. ```bash # Prerequisites # - Install Nix: https://nixos.org/ # Setup and run cd docs nix-shell # Enters isolated environment bundle install # Install Ruby dependencies bundle exec jekyll serve -H 0.0.0.0 -P 4000 --watch # Server accessible at http://localhost:4000 # Changes trigger automatic rebuilds # Exit nix-shell with 'exit' command ``` -------------------------------- ### GitHub Workflow for Building Docs PDF Source: https://context7.com/kong/insomnia-docs/llms.txt This YAML workflow automates the creation of a PDF version of the documentation. It checks out the repository, sets up Ruby, installs Jekyll dependencies, builds the Jekyll site, installs Node.js dependencies, runs a PDF generation script, and uploads the PDF as an artifact. It is triggered manually. ```yaml # .github/workflows/build-docs-pdf.yml # Trigger manually via workflow_dispatch # Steps performed: # 1. Checkout repository # 2. Set up Ruby 2.7.2 with gem caching # 3. Install Jekyll dependencies # 4. Build Jekyll site to _site directory # 5. Install Node.js dependencies in pdf-generation # 6. Run PDF generation script # 7. Upload resulting PDF as artifact # To trigger: # - Go to Actions tab in GitHub # - Select "Build Docs PDF" workflow # - Click "Run workflow" # - Download artifact from workflow run ``` -------------------------------- ### Build Docker Image for Insomnia Docs Source: https://context7.com/kong/insomnia-docs/llms.txt Builds the Docker image for the Jekyll documentation site using Buildkit. This allows for local development without a local Ruby installation. It can be executed directly via Docker or through a makefile shortcut. ```bash # Build the Docker image using Buildkit DOCKER_BUILDKIT=1 docker build --tag insomnia-docs:latest . # Alternative: Use the makefile shortcut make build ``` -------------------------------- ### GitHub Workflow for Docker Image Build and Publish Source: https://context7.com/kong/insomnia-docs/llms.txt This YAML workflow automates the building and publishing of the documentation Docker image to GitHub Container Registry. It includes steps for checking out the repository, installing cosign, setting up Docker Buildx, logging into the registry, extracting metadata, building and pushing the image, and signing the image with cosign. It's triggered manually. ```yaml # .github/workflows/docker.yml # Manual trigger only via workflow_dispatch env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} # The workflow: # 1. Checks out repository # 2. Installs cosign for image signing # 3. Sets up Docker Buildx for multi-platform builds # 4. Logs into GitHub Container Registry # 5. Extracts metadata (tags, labels) # 6. Builds and pushes image with cache optimization # 7. Signs published image with cosign (not on PRs) # Result: ghcr.io/kong/insomnia-docs:latest ``` -------------------------------- ### Run Insomnia Docs Jekyll Server in Docker Source: https://context7.com/kong/insomnia-docs/llms.txt Starts a containerized Jekyll server with live reload functionality for the Insomnia documentation. It mounts the local 'docs' directory to enable real-time content updates during development. Access the site at http://localhost:4000. ```bash # Run the container with volume mounting docker run --rm -it -p 4000:4000 -v ${PWD}/docs:/docs insomnia-docs:latest # Alternative: Use the makefile shortcut make run # Access the documentation at http://localhost:4000 # Changes to files in ./docs will automatically trigger rebuilds ``` -------------------------------- ### Ruby Dependencies for Jekyll Source: https://context7.com/kong/insomnia-docs/llms.txt This Ruby file specifies the Gemfile for the Jekyll documentation site. It defines the required gems, including Jekyll and the minima theme, as well as the jekyll-feed plugin. Instructions for installing dependencies and serving the site locally are provided. ```ruby # docs/Gemfile source "https://rubygems.org" gem "jekyll", "~> 4.3.0" gem "minima", "~> 2.5" group :jekyll_plugins do gem "jekyll-feed", "~> 0.12" end # Install dependencies: # bundle install # Serve documentation locally: # bundle exec jekyll serve # Access at http://localhost:4000 # Site builds to docs/_site directory ``` -------------------------------- ### Complete PDF Generation Pipeline (JavaScript) Source: https://context7.com/kong/insomnia-docs/llms.txt Orchestrates the full PDF generation process for Insomnia documentation. This includes starting a static file server, extracting and normalizing documentation URLs from navigation, and creating a consolidated PDF document. Requires the 'run.js' script and can be run via npm scripts. ```javascript const run = require('./run.js'); // Run the complete PDF generation pipeline await run(); // This will: // 1. Start static server on port 3000 serving _site directory // 2. Read navigation from ../docs/_data/main-nav.yaml // 3. Extract and normalize all documentation URLs // 4. Generate ./pdfs/insomnia.pdf with all pages // 5. Exit when complete // Can also be run directly from command line: // cd pdf-generation // npm ci // node run.js ``` -------------------------------- ### Algolia DocSearch Index Configuration Source: https://context7.com/kong/insomnia-docs/llms.txt This JSON configuration defines the settings for the Algolia DocSearch crawler to index the Insomnia documentation. It specifies the index name, starting URLs, and crucially, the CSS selectors for different heading levels (lvl1 to lvl4) and general text content within the documentation pages. It also includes settings for content hierarchy and number of hits. ```json { "index_name": "insomnia_docs", "start_urls": [ { "url": "https://docs.insomnia.rest/" } ], "stop_urls": [], "selectors": { "lvl0": { "selector": "", "global": true, "default_value": "" }, "lvl1": "h1", "lvl2": ".article-detail-container h2", "lvl3": ".article-detail-container h3", "lvl4": ".article-detail-container h4", "text": ".article-detail-container p, .article-detail-container li" }, "only_content_level": true, "conversation_id": ["534091583"], "nb_hits": 27926 } ``` -------------------------------- ### Jekyll Site Configuration Source: https://context7.com/kong/insomnia-docs/llms.txt This YAML file configures the Jekyll site, defining its title, email, description, base URL, and public URL. It also specifies the theme, plugins, permalink structure, highlighter, and Sass directory. It includes links to external developer and GitHub resources. ```yaml # docs/_config.yml title: Insomnia Docs email: support@insomnia.rest description: >- Insomnia Docs: Deliver high quality APIs through standards and collaboration with the Insomnia API design platform. baseurl: "/" url: "https://docs.insomnia.rest" twitter_username: getinsomnia github_username: insomnia # Build settings theme: minima plugins: - jekyll-feed permalink: pretty highlighter: rouge sass: sass_dir: assets/css links: dev_site: https://developer.konghq.com ``` -------------------------------- ### Build Documentation URLs from Navigation (JavaScript) Source: https://context7.com/kong/insomnia-docs/llms.txt Extracts and normalizes local documentation URLs from the Jekyll navigation configuration file. It filters out external links and ensures URLs are consistent with trailing slashes and no fragments. Requires the 'build-urls' module. ```javascript const buildUrls = require('./build-urls'); // Extract URLs from navigation configuration const urls = buildUrls({ path: '../docs/_data/main-nav.yaml' }); // Returns normalized URLs like: // [ // 'http://localhost:3000/inso-cli/install/', // 'http://localhost:3000/insomnia/get-started/', // 'http://localhost:3000/insomnia/collections/' // ] // URLs are automatically: // - Stripped of fragments (#anchors) // - Given trailing slashes for consistency // - Deduplicated // - Filtered to exclude external links ``` -------------------------------- ### Create PDF from Documentation Pages (JavaScript) Source: https://context7.com/kong/insomnia-docs/llms.txt Generates a consolidated PDF document from an array of documentation page URLs. It uses Puppeteer for rendering and 'pdf-merger-js' for combining pages, automatically applying PDF styling, extracting main content, and removing navigation elements. Requires the 'create-pdf' module. ```javascript const createPDF = require('./create-pdf'); // Generate PDF from array of URLs const urls = [ 'http://localhost:3000/insomnia/get-started/', 'http://localhost:3000/insomnia/collections/', 'http://localhost:3000/insomnia/requests/' ]; await createPDF('insomnia', urls); // Output: ./pdfs/insomnia.pdf // The function automatically: // - Launches headless browser // - Waits for all images and fonts to load // - Applies PDF-specific styling (A4, proper margins) // - Extracts main content area only // - Removes navigation and anchor links // - Merges all pages into single PDF // - Handles white-space wrapping for code blocks ``` -------------------------------- ### Algolia Search Index Update Workflow (GitHub Actions) Source: https://context7.com/kong/insomnia-docs/llms.txt A GitHub Actions workflow that automatically updates the Algolia search index for Insomnia documentation daily. It can be triggered on a schedule (midnight UTC) or manually via workflow dispatch. Uses the 'algolia-docsearch-action'. ```yaml # .github/workflows/algolia.yml on: schedule: - cron: '0 0 * * *' # Runs daily at midnight UTC workflow_dispatch: # Can also be triggered manually jobs: updateAlgoliaIndexFullDocs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Run docsearch for Insomnia Docs uses: darrenjennings/algolia-docsearch-action@75b0f6d28d82eff3dd76f57a96a99490df11a250 with: algolia_api_key: ${{ secrets.ALGOLIA_API_KEY }} algolia_application_id: ${{ secrets.ALGOLIA_APPLICATION_ID }} file: search-config/insomnia_docs.json ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.