### Install Gokdok Gem Source: https://github.com/averell23/gokdok/blob/master/README.rdoc Use this command to install the Gokdok gem. Ensure you have RubyGems installed. ```bash gem install averell23-gokdok ``` -------------------------------- ### Complete Rakefile Integration Example Source: https://context7.com/averell23/gokdok/llms.txt An example Rakefile demonstrating how to integrate Gokdok with Rake tasks for RDoc generation and custom settings. ```ruby require 'rake' require 'rake/rdoctask' require 'gokdok' ``` -------------------------------- ### Configure Gokdok for GitHub Pages Source: https://context7.com/averell23/gokdok/llms.txt Configure Gokdok's Dokker to specify the output directory for RDoc, the remote path for deployment, and the Rake task to use. This setup is for deploying docs to the root of the gh-pages branch for cleaner URLs. ```ruby Gokdok::Dokker.new do |gd| gd.doc_home = 'html' # Match RDoc output directory gd.remote_path = '' # Put docs in gh-pages root for cleaner URLs gd.rdoc_task = :rdoc # Use the RDoc task defined above end ``` -------------------------------- ### Initialize Gokdok Documentation Source: https://github.com/averell23/gokdok/blob/master/README.rdoc Run this one-time command to initialize the Gokdok documentation system in your project. ```bash rake gokdok:init ``` -------------------------------- ### Initialize Gokdok Repository Source: https://context7.com/averell23/gokdok/llms.txt Run this task once per project to set up the `.gitignore` file and checkout the `gh-pages` branch. It creates an orphan branch if it doesn't exist. ```bash # Initialize Gokdok (run once per project) rake gokdok:init # Expected output: # Setting up the .gitignore file... created new # Checking out the pages... # -> Starting checkout of git@github.com:user/repo.git # -> Repository cloned # -> No branch for gh-pages found, creating it. # -> Clean branch created ``` -------------------------------- ### rake gokdok:init Source: https://context7.com/averell23/gokdok/llms.txt Initializes the repository for Gokdok by configuring .gitignore and setting up the gh-pages branch. ```APIDOC ## rake gokdok:init ### Description Sets up the repository for Gokdok by adding the pages directory to .gitignore and checking out the gh-pages branch. If the branch does not exist, it creates an orphan branch. ### Usage `rake gokdok:init` ``` -------------------------------- ### Display Gokdok Configuration Settings Source: https://context7.com/averell23/gokdok/llms.txt Shows the current Gokdok configuration, including paths to the Git binary, repository URL, and documentation directories. Helpful for debugging. ```bash # Show current settings rake gokdok:settings # Expected output: # GOKDOK Settings: # # Git binary: /usr/bin/git # Git repository: git@github.com:user/repo.git # Generated RDoc in /path/to/project/html # GH-Pages in /path/to/project/.gh_pages # Remote path: html ``` -------------------------------- ### Configure Gokdok::Dokker in Rakefile Source: https://context7.com/averell23/gokdok/llms.txt Set up Gokdok by configuring paths, repository URLs, and Rake task names within a block. Auto-detection is used for git_path and repo_url if not explicitly provided. ```ruby require 'gokdok' # Basic configuration in your Rakefile Gokdok::Dokker.new do |gd| gd.git_path = '/usr/bin/git' # Path to git binary (auto-detected on Unix) gd.doc_home = 'html' # Where RDoc generates docs (default: 'html') gd.pages_home = '.gh_pages' # Local gh-pages checkout dir (default: '.gh_pages') gd.remote_path = 'html' # Path in gh-pages for docs (default: 'html') gd.repo_url = 'git@github.com:user/repo.git' # Repository URL (auto-detected from origin) gd.rdoc_task = :rdoc # Rake task to generate docs (default: :rdoc) end # Minimal configuration using all defaults Gokdok::Dokker.new # Configuration to put docs in repository root Gokdok::Dokker.new do |gd| gd.remote_path = '' # Docs go directly into gh-pages root end ``` -------------------------------- ### Push Gokdok Documentation Source: https://github.com/averell23/gokdok/blob/master/README.rdoc Execute this command each time you want to recreate and push your documentation to GitHub pages. ```bash rake gokdok:push ``` -------------------------------- ### Pull, Generate, and Push Documentation with Gokdok Source: https://context7.com/averell23/gokdok/llms.txt Performs a `git pull` before generating and pushing documentation. Use this to incorporate remote changes from collaborators. ```bash # Pull remote changes, generate docs, and push rake gokdok:pushplus # Expected output: # (RDoc generation output) # Deleting the old documentation in /path/to/project/.gh_pages/html # Copy the new documentation into place # (Git pull output) # (Git push output) ``` -------------------------------- ### Generate Documentation Locally with Gokdok Source: https://context7.com/averell23/gokdok/llms.txt Generates RDoc documentation and commits it to the local `gh-pages` checkout without pushing to the remote. Useful for reviewing changes. ```bash # Generate and commit docs locally (no push) rake gokdok:update # Expected output: # (RDoc generation output) # Deleting the old documentation in /path/to/project/.gh_pages/html # Copy the new documentation into place ``` -------------------------------- ### Generate and Push Documentation with Gokdok Source: https://context7.com/averell23/gokdok/llms.txt Generates RDoc documentation, updates the `gh-pages` branch, and pushes to GitHub. This task depends on `:update` for local changes. ```bash # Generate docs and push to GitHub rake gokdok:push # Expected output: # (RDoc generation output) # Deleting the old documentation in /path/to/project/.gh_pages/html # Copy the new documentation into place # (Git push output) # Your documentation is now live at: # https://username.github.io/repository/html/ ``` -------------------------------- ### rake gokdok:settings Source: https://context7.com/averell23/gokdok/llms.txt Displays the current Gokdok configuration settings. ```APIDOC ## rake gokdok:settings ### Description Outputs the current configuration, including git paths, repository URLs, and directory settings. ### Usage `rake gokdok:settings` ``` -------------------------------- ### Push Documentation with Remote Changes Source: https://github.com/averell23/gokdok/blob/master/README.rdoc Use this command if there are remote changes on the documentation branch that need to be incorporated. ```bash rake gokdok:pushplus ``` -------------------------------- ### Configure Gokdok in Rakefile Source: https://github.com/averell23/gokdok/blob/master/README.rdoc Add this configuration block to your Rakefile to set up Gokdok. You can customize options within the block. ```ruby Gokdok::Dokker.new do |gd| # Set some options if you want to end ``` -------------------------------- ### rake gokdok:push Source: https://context7.com/averell23/gokdok/llms.txt Generates documentation, commits it to the gh-pages branch, and pushes to the remote repository. ```APIDOC ## rake gokdok:push ### Description Generates RDoc documentation, copies it to the gh-pages directory, commits the changes, and pushes to GitHub. ### Usage `rake gokdok:push` ``` -------------------------------- ### rake gokdok:pushplus Source: https://context7.com/averell23/gokdok/llms.txt Pulls remote changes, generates documentation, and pushes updates to GitHub. ```APIDOC ## rake gokdok:pushplus ### Description Performs a git pull to incorporate remote changes before generating documentation and pushing to the remote repository. ### Usage `rake gokdok:pushplus` ``` -------------------------------- ### Configure RDoc Generation with Rake Source: https://context7.com/averell23/gokdok/llms.txt Set up RDoc generation by specifying files to include, the main document, title, and additional options like line numbers and inline source. ```ruby Rake::RDocTask.new do |rdoc| rdoc.rdoc_files.include("lib/**/*.rb") rdoc.rdoc_files.include('LICENSE', 'CHANGES', 'README.rdoc') rdoc.main = "README.rdoc" rdoc.title = "MyProject Documentation" rdoc.options << '--line-numbers' << '--inline-source' end ``` -------------------------------- ### rake gokdok:update Source: https://context7.com/averell23/gokdok/llms.txt Generates and commits documentation locally without pushing to the remote repository. ```APIDOC ## rake gokdok:update ### Description Generates documentation and commits it to the local gh-pages checkout. Useful for local review before publishing. ### Usage `rake gokdok:update` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.