Skip to content
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

Doc page improvements #35

Merged
merged 3 commits into from
Jan 2, 2015
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,10 @@ def rspec_documentation
end
hash
end

def documentation_links_for(gem_name)
rspec_documentation.fetch(gem_name) { [] }.sort.reverse.map do |version|
link_to version, "/documentation/#{version}/#{gem_name}/"
end
end
end
14 changes: 0 additions & 14 deletions source/code_snippets/_bowling_spec.html.erb

This file was deleted.

4 changes: 0 additions & 4 deletions source/code_snippets/_doubles.html.erb

This file was deleted.

3 changes: 0 additions & 3 deletions source/code_snippets/_install.html.erb

This file was deleted.

7 changes: 0 additions & 7 deletions source/code_snippets/_matchers.html.erb

This file was deleted.

13 changes: 0 additions & 13 deletions source/code_snippets/_story.html.erb

This file was deleted.

14 changes: 0 additions & 14 deletions source/code_snippets/bowling.html.erb

This file was deleted.

6 changes: 0 additions & 6 deletions source/code_snippets/fail.html.erb

This file was deleted.

10 changes: 0 additions & 10 deletions source/code_snippets/green.html.erb

This file was deleted.

60 changes: 44 additions & 16 deletions source/documentation.html.slim
Original file line number Diff line number Diff line change
@@ -1,29 +1,57 @@
---
title: RSpec documentation
gems:
- name: rspec-core
description: >
The spec runner, providing a rich command line program, flexible and
customizable reporting, and an API to organize your code examples
- name: rspec-expectations
description: >
Provides a readable API to express expected outcomes of a code example
- name: rspec-mocks
description: >
Test double framework, providing multiple types of fake objects to allow you
to tightly control the environment in which your specs run
- name: rspec-rails
description: >
Supports using RSpec to test Ruby on Rails applications in place of Rails' built-in test framework.
---
section
article.relish
h2 Relish
article.rdoc
h2 API Documentation

p
| RSpec is documented through executable examples on Relish. These examples
are executed via cucumber to ensure they it stays up-to-date with the current
code base.
| The API documentation contains details about all public APIs supported by RSpec.
We consider these the primary docs and will treat these APIs according to the
policies of #{link_to 'Semantic Versioning', 'http://semver.org/'}. We encourage you
to use only public APIs as private APIs may change in any release without warning.
If you have a use case not supported by the existing public APIs, #{link_to 'please ask', '/help'}
and we'll be glad to add an API for you or make an existing private API public.

p
| RSpec is composed of multiple libraries, which are designed to work together, or
can be used independently with other testing tools like #{link_to 'Cucumber', 'http://cukes.info/'}
or #{link_to 'Minitest', 'http://docs.seattlerb.org/minitest/'}. The parts of RSpec are:
ul
li= link_to 'http://relishapp.com/rspec', 'http://relishapp.com/rspec'
- current_page.data.fetch('gems').each do |gem|
li
b
| #{gem.name}: 
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probable don't need the nbsp anymore here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without it, the name and description run together and it looks terrible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, weird, maybe remove the leading | on the next line, you only need it on the first anyway

| #{gem.description}
#{documentation_links_for(gem.name).join(' | ')}

article.rdoc
h2 API Documentation
article.relish
h2 Relish
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Relish is a better starting point than the API documentation and thus should be at the top...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I specifically put the API docs on top because I feel we should advertise them as the more primary/main docs. We've gotten a lot of complaints about the relish docs and I think it's time to de-emphasize them.


p
| You can find detailed API documentation for versions below
| RSpec is also documented through executable examples on Relish. The examples
are written in an "end-to-end" style demonstrating the use of various RSpec
features in the context of executable spec files. It's a good resource for
getting a survey of what RSpec is capable of and seeing how the pieces can
be used together, but for detailed documentation about a partiular API or
feature, we recommend the API docs. The relish examples are executed via
Cucumber to ensure they are always up-to-date with the current code base.

ul
- rspec_documentation.each do |gem, versions|
li
b
| #{gem}: 
- versions.sort.reverse.each do |version|
= link_to version, "/documentation/#{version}/#{gem}/"
|  
li= link_to 'http://relishapp.com/rspec', 'http://relishapp.com/rspec'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excess ws ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.