8000 Basic setup for Reline's official documentation website by st0012 · Pull Request #820 · ruby/reline · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Basic setup for Reline's official documentation website #820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy Reline documentation to GitHub Pages

on:
push:
branches: ["master"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.repository == 'ruby/reline' && !startsWith(github.event_name, 'pull') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984 # v1.196.0
with:
ruby-version: "3.3"
bundler-cache: true
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Reline
run: bundle exec rake rdoc
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
*.swp
Gemfile.lock
/.idea/
/_site/
3 changes: 3 additions & 0 deletions .rdoc_options
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
page_dir: doc
autolink_excluded_words:
- Reline
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if is_unix && ENV['WITH_VTERM']
end

gem 'bundler'
gem 'rdoc'
gem 'rake'
gem 'test-unit'

Expand Down
8 changes: 8 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rdoc/task'

ENCODING_LIST = {
test_shift_jis: Encoding::Shift_JIS,
Expand Down Expand Up @@ -45,3 +46,10 @@ end


task default: :test

RDoc::Task.new do |rdoc|
rdoc.title = "Reline Documentation"
rdoc.main = "Index.md"
rdoc.rdoc_dir = "_site"
rdoc.options.push("lib")
end
38 changes: 38 additions & 0 deletions doc/Index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Reline

[![Gem Version](https://badge.fury.io/rb/reline.svg)](https://badge.fury.io/rb/reline)
[![build](https://github.com/ruby/reline/actions/workflows/reline.yml/badge.svg)](https://github.com/ruby/reline/actions/workflows/test.yml)

## Overview

Reline is Ruby's official library for input editing and history management.

## Installation

To install it with `bundler`, add this line to your application's Gemfile:

```ruby
gem 'reline'
```

Then execute:

```console
$ bundle
```

Or install it directly with:

```console
$ gem install reline
```

## Usage

See `Reline` module for public API.

See [Face.md](rdoc-ref:reline/face.md) for customizing Reline's UI appearance.

## License

The gem is available as open source under the terms of the [Ruby License](https://www.ruby-lang.org/en/about/license.txt) 8000 .
32 changes: 21 additions & 11 deletions lib/reline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

module Reline
# NOTE: For making compatible with the rb-readline gem
FILENAME_COMPLETION_PROC = nil
USERNAME_COMPLETION_PROC = nil
FILENAME_COMPLETION_PROC = nil # :nodoc:
USERNAME_COMPLETION_PROC = nil # :nodoc:

class ConfigEncodingConversionError < StandardError; end
class ConfigEncodingConversionError < StandardError; end # :nodoc:

# EOF key: { char: nil, method_symbol: nil }
# Other key: { char: String, method_symbol: Symbol }
Expand All @@ -24,8 +24,8 @@ class ConfigEncodingConversionError < StandardError; end
def match?(sym)
method_symbol && method_symbol == sym
end
end
CursorPos = Struct.new(:x, :y)
end # :nodoc:
CursorPos = Struct.new(:x, :y) # :nodoc:
DialogRenderInfo = Struct.new(
:pos,
:contents,
Expand All @@ -35,7 +35,7 @@ def match?(sym)
:height,
:scrollbar,
keyword_init: true
)
) # :nodoc:

class Core
ATTR_READER_NAMES = %i(
Expand Down Expand Up @@ -244,8 +244,8 @@ def get_screen_size
height: [15, preferred_dialog_height].min,
face: :completion_dialog
)
}
Reline::DEFAULT_DIALOG_CONTEXT = Array.new
} # :nodoc:
Reline::DEFAULT_DIALOG_CONTEXT = Array.new # :nodoc:

def readmultiline(prompt = '', add_hist = false, &confirm_multiline_termination)
@mutex.synchronize do
Expand Down Expand Up @@ -439,6 +439,17 @@ def ambiguous_width
}
def_single_delegators :core, :input=, :output=
def_single_delegators :core, :vi_editing_mode, :emacs_editing_mode

##
# :singleton-method: readmultiline
# :call-seq:
# readmultiline(prompt = '', add_hist = false, &confirm_multiline_termination) -> string or nil
def_single_delegators :core, :readmultiline

##
# :singleton-method: readline
# :call-seq:
# readline(prompt = '', add_hist = false) -> string or nil
def_single_delegators :core, :readline
def_single_delegators :core, :completion_case_fold, :completion_case_fold=
def_single_delegators :core, :completion_quote_character
Expand Down Expand Up @@ -474,11 +485,10 @@ def self.insert_text(text)
def_single_delegators :core, :dialog_proc
def_single_delegators :core, :autocompletion, :autocompletion=

def_single_delegators :core, :readmultiline
def_instance_delegators self, :readmultiline
private :readmultiline

def self.encoding_system_needs
def self.encoding_system_needs # :nodoc:
self.core.encoding
end

Expand Down Expand Up @@ -511,7 +521,7 @@ def self.line_editor
Reline::IOGate = Reline::IO.decide_io_gate

# Deprecated
Reline::GeneralIO = Reline::Dumb.new
Reline::GeneralIO = Reline::Dumb.new # :nodoc:

Reline::Face.load_initial_configs

Expand Down
0