Git Product home page Git Product logo

sdoc's Introduction

SDoc

Tests

Powering http://api.rubyonrails.org/

What is sdoc?

SDoc is an HTML template built on top of the RDoc documentation generator for Ruby code.

Getting Started

# Install the gem
gem install sdoc

# Generate documentation for 'projectdir'
sdoc projectdir

sdoc

sdoc is simply a wrapper for the rdoc command line tool. See sdoc --help for more details.

When using the sdoc command, --fmt is set to shtml by default. The default template (or -T option) is set to shtml, but you can also use the direct template when generating documentation.

Example:

sdoc -o doc/rails -T direct rails

Rake Task

If you want, you can setup a task in your Rakefile for generating your project's documentation via the rake rdoc command.

# Rakefile
require 'sdoc' # and use your RDoc task the same way you used it before
require 'rdoc/task' # ensure this file is also required in order to use `RDoc::Task`

RDoc::Task.new do |rdoc|
  rdoc.rdoc_dir = 'doc/rdoc'      # name of output directory
  rdoc.options << '--format=sdoc' # explictly set the sdoc generator
  rdoc.template = 'rails'         # template used on api.rubyonrails.org
end

NOTE: If you don't set template the default "sdoc" template is chosen, with a lighter color scheme.

Now you can execute this command with rake rdoc, to compile the documentation for the current project directory.

Alternatively you can pass this command a path to the project you wish to compile: rake rdoc path/to/project.

RDoc

As mentioned before, SDoc is built on top of the RDoc project.

If you notice any bugs in the output of your documentation, it may be RDoc's fault and should be reported upstream.

An example of an SDoc bug would be:

  • Error or warning in JavaScript or HTML found in your browser
  • Generation fails with some exception (likely due to incompatibility with RDoc)

Please feel free to still report issues here for both projects, especially if you aren't sure. We will try to redirect to the proper place if necessary.

Contributing

If you'd like to contribute you can generate the Rails main branch documentation by running:

rake test:rails

You can generate the Ruby default branch documentation by running:

rake test:ruby

The generated documentation will be put into doc/public directory. To view the just generated documentation start up a rack application by running:

rackup config.ru

Then open http://localhost:9292 in the browser to view the documentation.

Who?

sdoc's People

Contributors

adamlogic avatar aleksi avatar amatsuda avatar anatol avatar aycabta avatar cveneziani avatar daz avatar derikson avatar drbrain avatar ghiculescu avatar jeanmertz avatar jscissr avatar manuelmeurer avatar mikdiet avatar mikerogers0 avatar ndbroadbent avatar p8 avatar pda avatar rafaelfranca avatar robin850 avatar sferik avatar toshimaru avatar toy avatar ttilley avatar voloko avatar wooandoo avatar xuhao avatar xuhaoatekohe avatar yhirano55 avatar zzak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.