- Notifications
You must be signed in to change notification settings - Fork133
rails/sdoc
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Poweringhttp://api.rubyonrails.org/
SDoc is an HTML template built on top of the RDoc documentation generator for Ruby code.
# Install the gemgem install sdoc# Generate documentation for 'projectdir'sdoc projectdir
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
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
.
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.
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.
- Vladimir Kolesnikov (voloko)
- Nathan Broadbent (ndbroadbent)
- Petrik de Heus (p8)
- (zzak)