Skip to content

Commit

Permalink
Move to self-hosted documentation (#1270)
Browse files Browse the repository at this point in the history
* Add docs URL to gemspec

* Add Rake task for generating documentation

* Update README

* Move YARD gem out of :development group
  • Loading branch information
pyrmont authored Jul 24, 2019
1 parent 9247133 commit 7ff2d09
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down Expand Up @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions rouge.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions tasks/generate/docs.rake
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7ff2d09

Please sign in to comment.