Skip to content

Commit 26519ff

Browse files
committed
📝 Documentation on GitHub Pages
- https://oauth2.galtzo.com
1 parent a99bb0f commit 26519ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+17270
-47
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Appraisal.*.gemfile.lock
2020
# Documentation
2121
/.yardoc
2222
/_yardoc/
23-
/doc/
2423
/rdoc/
2524

2625
# RVM

.rubocop_gradual.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"lib/oauth2/response.rb:4048171841": [
2222
[35, 5, 204, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 996912427]
2323
],
24-
"oauth2.gemspec:461003665": [
24+
"oauth2.gemspec:2957552385": [
2525
[5, 23, 12, "Gemspec/RubyVersionGlobalsUsage: Do not use `RUBY_VERSION` in gemspec file.", 31296028]
2626
],
2727
"spec/oauth2/access_token_spec.rb:443932125": [

.yard_gfm_support.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Gratefully and liberally taken from the MIT-licensed https://github.com/bensheldon/good_job/pull/113/files
2+
require "kramdown"
3+
require "kramdown-parser-gfm"
4+
5+
# Custom markup provider class that always renders Kramdown using GFM (Github Flavored Markdown).
6+
# GFM is needed to render markdown tables and fenced code blocks in the README.
7+
class KramdownGfmDocument < Kramdown::Document
8+
def initialize(source, options = {})
9+
options[:input] = "GFM" unless options.key?(:input)
10+
super(source, options)
11+
end
12+
end
13+
14+
# Insert the new provider as the highest priority option for Markdown.
15+
# See:
16+
# - https://github.com/lsegal/yard/issues/1157
17+
# - https://github.com/lsegal/yard/issues/1017
18+
# - https://github.com/lsegal/yard/blob/main/lib/yard/templates/helpers/markup_helper.rb
19+
YARD::Templates::Helpers::MarkupHelper::MARKUP_PROVIDERS[:markdown].insert(
20+
0,
21+
{const: "KramdownGfmDocument"},
22+
)

.yardopts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--plugin junk
2+
--plugin relative_markdown_links
3+
--readme README.md
4+
--charset utf-8
5+
--markup markdown
6+
--load .yard_gfm_support.rb
7+
'lib/**/*.rb'
8+
-
9+
'*.md'
10+
'*.txt'

Gemfile.lock

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ GEM
110110
simplecov-rcov (~> 0.3, >= 0.3.3)
111111
simplecov_json_formatter (~> 0.1, >= 0.1.4)
112112
version_gem (~> 1.1, >= 1.1.7)
113+
kramdown (2.5.1)
114+
rexml (>= 3.3.9)
115+
kramdown-parser-gfm (1.1.0)
116+
kramdown (~> 2.0)
113117
language_server-protocol (3.17.0.5)
114118
lint_roller (1.1.0)
115119
logger (1.7.0)
@@ -118,6 +122,10 @@ GEM
118122
net-http (0.6.0)
119123
uri
120124
nkf (0.2.0)
125+
nokogiri (1.18.8-x86_64-darwin)
126+
racc (~> 1.4)
127+
nokogiri (1.18.8-x86_64-linux-gnu)
128+
racc (~> 1.4)
121129
ostruct (0.6.1)
122130
parallel (1.27.0)
123131
parser (3.3.8.0)
@@ -274,6 +282,8 @@ GEM
274282
uri (1.0.3)
275283
version_gem (1.1.8)
276284
yard (0.9.37)
285+
yard-relative_markdown_links (0.5.0)
286+
nokogiri (>= 1.14.3, < 2)
277287
zeitwerk (2.7.2)
278288

279289
PLATFORMS
@@ -290,6 +300,8 @@ DEPENDENCIES
290300
debug (>= 1.0.0)
291301
gem_bench (~> 2.0, >= 2.0.5)
292302
kettle-soup-cover (~> 1.0, >= 1.0.6)
303+
kramdown (~> 2.5, >= 2.5.1)
304+
kramdown-parser-gfm (~> 1.1)
293305
nkf (~> 0.2)
294306
oauth2!
295307
rake (~> 13.0)
@@ -309,6 +321,7 @@ DEPENDENCIES
309321
stone_checksums (~> 1.0)
310322
yard (~> 0.9, >= 0.9.37)
311323
yard-junk (~> 0.0, >= 0.0.10)!
324+
yard-relative_markdown_links (~> 0.5.0)
312325

313326
BUNDLED WITH
314327
2.6.9

README.md

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,11 @@
99

1010
## 🔐 OAuth2
1111

12-
[![Version][👽versioni]][👽version]
13-
[![License: MIT][📄license-img]][📄license-ref]
14-
[![Downloads Rank][👽dl-ranki]][👽dl-rank]
15-
[![Open Source Helpers][👽oss-helpi]][👽oss-help]
16-
[![Depfu][🔑depfui♻️]][🔑depfu]
17-
[![Coveralls Test Coverage][🔑coveralls-img]][🔑coveralls]
18-
[![QLTY Test Coverage][🔑qlty-covi♻️]][🔑qlty-cov]
19-
[![QLTY Maintainability][🔑qlty-mnti♻️]][🔑qlty-mnt]
20-
[![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf]
21-
[![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf]
22-
[![CI Current][🚎11-c-wfi]][🚎11-c-wf]
23-
[![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf]
24-
[![CI JRuby][🚎10-j-wfi]][🚎10-j-wf]
25-
[![CI Supported][🚎6-s-wfi]][🚎6-s-wf]
26-
[![CI Legacy][🚎4-lg-wfi]][🚎4-lg-wf]
27-
[![CI Unsupported][🚎7-us-wfi]][🚎7-us-wf]
28-
[![CI Ancient][🚎1-an-wfi]][🚎1-an-wf]
29-
[![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf]
30-
[![CI Style][🚎5-st-wfi]][🚎5-st-wf]
31-
[![CodeQL][🖐codeQL-img]][🖐codeQL]
12+
[![Version][👽versioni]][👽version] [![License: MIT][📄license-img]][📄license-ref] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![Open Source Helpers][👽oss-helpi]][👽oss-help] [![Depfu][🔑depfui♻️]][🔑depfu] [![Coveralls Test Coverage][🔑coveralls-img]][🔑coveralls] [![QLTY Test Coverage][🔑qlty-covi♻️]][🔑qlty-cov] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![CI Supported][🚎6-s-wfi]][🚎6-s-wf] [![CI Legacy][🚎4-lg-wfi]][🚎4-lg-wf] [![CI Unsupported][🚎7-us-wfi]][🚎7-us-wf] [![CI Ancient][🚎1-an-wfi]][🚎1-an-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CodeQL][🖐codeQL-img]][🖐codeQL]
3213

3314
---
3415

35-
[![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay]
36-
[![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor]
37-
[![Buy me a coffee][🖇buyme-small-img]][🖇buyme]
38-
[![Donate on Polar][🖇polar-img]][🖇polar]
39-
[![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi]
40-
[![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon]
16+
[![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi] [![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon]
4117

4218
OAuth 2.0 is the industry-standard protocol for authorization.
4319
OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications,
@@ -410,7 +386,7 @@ of a major release, support for that Ruby version may be dropped.
410386
NOTE: The 1.4 series will only receive critical security updates.
411387
See [SECURITY.md][🔐security].
412388

413-
## Usage Examples
389+
## 🔧 Basic Usage
414390

415391
### Global Configuration
416392

@@ -533,7 +509,7 @@ client = OAuth2::Client.new(
533509
```
534510
</details>
535511

536-
## OAuth2::Response
512+
### OAuth2::Response
537513

538514
The `AccessToken` methods `#get`, `#post`, `#put` and `#delete` and the generic `#request`
539515
will return an instance of the #OAuth2::Response class.
@@ -546,14 +522,14 @@ array. Otherwise, it will return the original body string.
546522
The original response body, headers, and status can be accessed via their
547523
respective methods.
548524

549-
## OAuth2::AccessToken
525+
### OAuth2::AccessToken
550526

551527
If you have an existing Access Token for a user, you can initialize an instance
552528
using various class methods including the standard new, `from_hash` (if you have
553529
a hash of the values), or `from_kvform` (if you have an
554530
`application/x-www-form-urlencoded` encoded string of the values).
555531

556-
## OAuth2::Error
532+
### OAuth2::Error
557533

558534
On 400+ status code responses, an `OAuth2::Error` will be raised. If it is a
559535
standard OAuth2 error response, the body will be parsed and `#code` and `#description` will contain the values provided from the error and
@@ -565,7 +541,7 @@ option on initialization of the client. In this case the `OAuth2::Response`
565541
instance will be returned as usual and on 400+ status code responses, the
566542
Response instance will contain the `OAuth2::Error` instance.
567543

568-
## Authorization Grants
544+
### Authorization Grants
569545

570546
Currently the Authorization Code, Implicit, Resource Owner Password Credentials, Client Credentials, and Assertion
571547
authentication grant types have helper strategy classes that simplify client
@@ -784,7 +760,7 @@ or one of the others at the head of this README.
784760
[📜src-gh-img]: https://img.shields.io/badge/GitHub-238636?style=for-the-badge&logo=Github&logoColor=green
785761
[📜src-gh]: https://github.com/oauth-xx/oauth2
786762
[📜docs-cr-rd-img]: https://img.shields.io/badge/RubyDoc-Current_Release-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
787-
[📜docs-head-rd-img]: https://img.shields.io/badge/RubyDoc-HEAD-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
763+
[📜docs-head-rd-img]: https://img.shields.io/badge/YARD_on_Galtzo.com-HEAD-943CD2?style=for-the-badge&logo=readthedocs&logoColor=white
788764
[📜wiki]: https://gitlab.com/oauth-xx/oauth2/-/wikis/home
789765
[📜wiki-img]: https://img.shields.io/badge/wiki-examples-943CD2.svg?style=for-the-badge&logo=Wiki&logoColor=white
790766
[👽dl-rank]: https://rubygems.org/gems/oauth2

Rakefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ begin
7373

7474
YARD::Rake::YardocTask.new(:yard) do |t|
7575
t.files = [
76-
# Splats (alphabetical)
76+
# Source Splats (alphabetical)
7777
"lib/**/*.rb",
78+
"-", # source and extra docs are separated by "-"
79+
# Extra Files (alphabetical)
80+
"*.md",
81+
"*.txt",
7882
]
7983
end
8084
defaults << "yard"

0 commit comments

Comments
 (0)