Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/sdocPublic

Standalone sdoc generator

License

NotificationsYou must be signed in to change notification settings

rails/sdoc

Repository files navigation

Tests

Poweringhttp://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 gemgem install sdoc# Generate documentation for 'projectdir'sdoc projectdir

sdoc

sdoc is simply a wrapper for therdoc command line tool. Seesdoc --help for more details.

When using thesdoc command,--fmt is set toshtml by default. The default template (or-T option) is set toshtml, but you can also use thedirect template when generating documentation.

Example:

sdoc -o doc/rails -T direct rails

Rake Task

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

# Rakefilerequire'sdoc'# and use your RDoc task the same way you used it beforerequire'rdoc/task'# ensure this file is also required in order to use `RDoc::Task`RDoc::Task.newdo |rdoc|rdoc.rdoc_dir='doc/rdoc'# name of output directoryrdoc.options <<'--format=sdoc'# explicitly set the sdoc generatorrdoc.template='rails'# template used on api.rubyonrails.orgend

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

Now you can execute this command withrake 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 bereported 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:

bundleexec rake test:rails

You can generate the Ruby default branch documentation by running:

bundleexec rake test:ruby

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

bundleexec rackup config.ru

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

Who?


[8]ページ先頭

©2009-2025 Movatter.jp