From 02fc8cda98329c455935680479250cc00cf0daa3 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Mon, 22 Jul 2019 09:23:13 +0900 Subject: [PATCH 1/4] Add docs URL to gemspec --- rouge.gemspec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rouge.gemspec b/rouge.gemspec index dc414c0f25..c03687639c 100644 --- a/rouge.gemspec +++ b/rouge.gemspec @@ -18,7 +18,9 @@ Gem::Specification.new do |s| s.licenses = ['MIT', 'BSD-2-Clause'] s.required_ruby_version = '>= 2.0' s.metadata = { - 'source_code_uri' => 'https://github.com/jneen/rouge', - 'changelog_uri' => 'https://github.com/jneen/rouge/blob/master/CHANGELOG.md' + "bug_tracker_uri" => "https://github.com/rouge-ruby/rouge/issues", + "changelog_uri" => "https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md", + "documentation_uri" => "https://rouge-ruby.github.io/docs/", + "source_code_uri" => "https://github.com/rouge-ruby/rouge" } end From 42fcf3e4c89ae79451696c8c4bd04d818def0c47 Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Tue, 23 Jul 2019 04:45:14 +0900 Subject: [PATCH 2/4] Add Rake task for generating documentation --- Rakefile | 5 +++-- tasks/generate/docs.rake | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tasks/generate/docs.rake diff --git a/Rakefile b/Rakefile index f5bd5e3634..3fc490b38e 100644 --- a/Rakefile +++ b/Rakefile @@ -5,14 +5,15 @@ require "bundler/gem_tasks" # Adds the :build, :install and :release tasks require "rake/clean" # Adds the :clean and :clobber tasks require "rake/testtask" require "rubocop/rake_task" +require "yard" # Add tasks -task :check => ["check:specs", :newline, "check:style"] +task :check => ["check:specs", "check:style"] task :default => [:check] task :test => [:check] # Add pre-requisites -task :build => [:clean, :check] +task :build => [:clean, :check, "generate:docs"] # Add utility tasks task :newline do diff --git a/tasks/generate/docs.rake b/tasks/generate/docs.rake new file mode 100644 index 0000000000..f36c3a857f --- /dev/null +++ b/tasks/generate/docs.rake @@ -0,0 +1,8 @@ +namespace :generate do + desc "Generate YARD documentation" + YARD::Rake::YardocTask.new(:docs) do |t| + t.files = ["lib/**/*.rb", "-", "docs/*.md"] + t.options = ["--no-private", "--protected", "--markup-provider=redcarpet", + "--markup=markdown"] + end +end From 373c9c6e4edaf8684dfac17a4873c11ef42c7d1f Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Tue, 23 Jul 2019 04:45:42 +0900 Subject: [PATCH 3/4] Update README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0772dafceb..283d184afb 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://secure.travis-ci.org/rouge-ruby/rouge.svg)](https://travis-ci.org/rouge-ruby/rouge) [![Gem Version](https://badge.fury.io/rb/rouge.svg)](https://rubygems.org/gems/rouge) +[![YARD Docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://rouge-ruby.github.io/docs/) [rouge]: http://rouge.jneen.net/ @@ -159,13 +160,13 @@ To test a lexer visually, run `rackup` from the root and go to `localhost:9292/# ### API Documentation -is at http://rubydoc.info/gems/rouge/frames. +is at https://rouge-ruby.github.io/docs/. ### Developing lexers We have [a guide][lexer-dev-doc] on lexer development in the documentation but you'll also learn a lot by reading through the existing lexers. -[lexer-dev-doc]: https://www.rubydoc.info/github/rouge-ruby/rouge/file/docs/LexerDevelopment.md +[lexer-dev-doc]: https://rouge-ruby.github.io/docs/file.LexerDevelopment.html Please don't submit lexers that are largely copy-pasted from other files. From d0011a4f804bb5ff0482f4cf70146f2c91ca687d Mon Sep 17 00:00:00 2001 From: Michael Camilleri Date: Tue, 23 Jul 2019 04:58:20 +0900 Subject: [PATCH 4/4] Move YARD gem out of :development group --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 387e30e64e..12095db5bc 100644 --- a/Gemfile +++ b/Gemfile @@ -22,12 +22,12 @@ end # Needed for a Rake task gem 'git' +gem 'yard' group :development do gem 'pry' # docs - gem 'yard' gem 'github-markup' # for visual tests