Giter VIP home page Giter VIP 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' # explicitly 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

aleksi avatar aycabta avatar hsbt avatar jeanmertz avatar jonathanhefner avatar koic avatar krisb avatar m-nakamura145 avatar manuelmeurer avatar mdesantis avatar mikdiet avatar mikerogers0 avatar ndbroadbent avatar nerdmaster avatar nickhammond avatar p8 avatar pda avatar pocke avatar rafaelfranca avatar rileygelwicks avatar robin850 avatar toshimaru avatar toy avatar ttilley avatar voloko avatar wooandoo avatar xuhao avatar xuhaoatekohe avatar yhirano55 avatar zzak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdoc's Issues

Getting nil error using sdoc 0.2.20 and rdoc 2.4.3

Generating SHtml...
/Users/me/.rvm/gems/ree-1.8.7-2010.02/gems/rdoc-2.4.3/lib/rdoc/markup/fragments.rb:339: warning: Object#type is deprecated; use Object#class
/Users/me/.rvm/gems/ree-1.8.7-2010.02/gems/rdoc-2.4.3/lib/rdoc/markup/fragments.rb:340:in add_list_breaks': Error while evaluating /Users/me/.rvm/gems/ree-1.8.7-2010.02/gems/sdoc-0.2.20/lib/sdoc/generator/template/direct/_context.rhtml: undefined methodlevel' for nil:NilClass (at nil)

stuck on Generating SDoc

On version 0.4.0+ i get stuck on

Generating SDoc format into .../doc...

With version 0.3 it all works fine.

Doesn't seem to work when accessing through file:///

I try to access my rdocs without having to use a webserver (using the bdoc gem) and sdoc doesn't seem to work when accessed through the file:/// protocol. I can get the frameset/iframe to show, but the navigation doesn't seem to work.

Error building docs for Rails 4.0.0.beta1

This is the error I get when trying to build the docs for Rails 4.0.0.beta1:

...
working on ci/travis.rb (/Users/manuel/Downloads/rails-docs/files/ci/travis_rb.html)
rendering /Users/manuel/Downloads/rails-docs/files/ci/travis_rb.html
working on guides/Rakefile (/Users/manuel/Downloads/rails-docs/files/guides/Rakefile.html)
rendering /Users/manuel/Downloads/rails-docs/files/guides/Rakefile.html
Error while evaluating /Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/rdoc/generator/template/sdoc/_context.rhtml: undefined method `chomp' for nil:NilClass (at nil)
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/sdoc/templatable.rb:29:in `eval'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/ruby_lex.rb:497:in `block in lex_init'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/1.9.1/irb/slex.rb:236:in `call'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/1.9.1/irb/slex.rb:236:in `match_io'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/1.9.1/irb/slex.rb:221:in `match_io'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/1.9.1/irb/slex.rb:221:in `match_io'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/1.9.1/irb/slex.rb:75:in `match'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/ruby_lex.rb:354:in `token'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/ruby_lex.rb:71:in `tokenize'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/markup/to_html.rb:198:in `accept_verbatim'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/markup/verbatim.rb:21:in `accept'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/markup/document.rb:63:in `block in accept'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/markup/document.rb:58:in `each'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/markup/document.rb:58:in `accept'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/text.rb:105:in `markup'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/generator/markup.rb:28:in `description'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/rdoc/generator/template/sdoc/_context.rhtml:2:in `include_template'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/1.9.1/erb.rb:838:in `eval'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/1.9.1/erb.rb:838:in `result'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/sdoc/templatable.rb:14:in `eval_template'
(eval):1:in `include_template'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/sdoc/templatable.rb:29:in `eval'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/sdoc/templatable.rb:29:in `include_template'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/rdoc/generator/template/sdoc/file.rhtml:26:in `block in generate_file_files'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/1.9.1/erb.rb:838:in `eval'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/1.9.1/erb.rb:838:in `result'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/sdoc/templatable.rb:14:in `eval_template'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/sdoc/templatable.rb:36:in `render_template'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/sdoc/generator.rb:324:in `block in generate_file_files'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/sdoc/generator.rb:318:in `each'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/sdoc/generator.rb:318:in `generate_file_files'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/lib/sdoc/generator.rb:173:in `generate'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/rdoc.rb:493:in `block in generate'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/rdoc.rb:488:in `chdir'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/rdoc.rb:488:in `generate'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/rdoc-3.12.2/lib/rdoc/rdoc.rb:471:in `document'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/sdoc-0.3.20/bin/sdoc:7:in `<top (required)>'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/bin/sdoc:23:in `load'
/Users/manuel/.rbenv/versions/1.9.3-p327-perf/bin/sdoc:23:in `<main>'

Any tips on how to debug this?
I can't find a chomp anywhere...

Code snippets style broken

Hello,

Currently, SDoc 0.4.0 break the code snippets style on the Rails edge API. This issue just concerns code examples, not source ones.

snippets

Have a nice day.

SEARCH_INDEX_FILE constant missing

The SEARCH_INDEX_FILE constant has been removed but is still referenced to in merge.rb.
This causes sdoc-merge to fail.

I really appreciate this gem, thank you!

active_record parsing hangs at relation.rb everytime

I am trying to build sdoc for all installed gems in my bundle, now, it always shang 100% CPU @ 72% on relation.rb file. I'm not sure on what to show here so ask me anything and I'll produce it for you.

Thank you

Don't work well with inline private

class Example
   def public_method1; end

  private def private_method; end

  def other_public_method; end
end

sdoc see other_public_method as private method

[feature] Option to generate vi-style hjkl keypress bindings

Years of using vim and less have burned HJKL into my memory, and it would be nice to have the same mappings to navigate sdoc-generated search-results.

Of course, since your preferred mapping of IJKL conflicts with HJKL, this would have to be a compile-time switch. I think everyone who has used vim or scrolled though a man page would find the alternate key mappings very natural.

sdoc-merge no longer works after upgraded to 0.3.7

Run sdoc-merge will get this error message:

uh-oh! SDoc merge had a problem:
uninitialized constant RDoc::Generator::SHtml

Tried grep SHtml in the source repo, no such class found. Is there something missing?

chdir warning on install

Hi,

Snow Leopard
Ruby 1.8.7
sdoc 0.2.17
rubygems 1.3.5

I got this strange warning when I installed 0.2.17:

sudo gem install sdoc
Successfully installed sdoc-0.2.17
1 gem installed
Installing ri documentation for sdoc-0.2.17...
Installing RDoc documentation for sdoc-0.2.17...
/opt/ree/lib/ruby/gems/1.8/gems/sdoc-0.2.17/lib/rdoc/../sdoc/github.rb:57: warning: conflicting chdir during another chdir block
/opt/ree/lib/ruby/gems/1.8/gems/sdoc-0.2.17/lib/rdoc/../sdoc/github.rb:62: warning: conflicting chdir during another chdir block

That repeats several more times.

cp_r :preserve using a /source/ending/with/. breaks on windows

When sdoc tried to copy static resources while generating documentation is uses

RESOURCES_DIR = File.join('resources', '.')
...
def copy_resources
  resoureces_path = @template_dir + RESOURCES_DIR
  debug_msg "Copying #{resoureces_path}/** to #{@outputdir}/**"
  FileUtils.cp_r resoureces_path.to_s, @outputdir.to_s, :preserve => true unless $dryrun
end

https://github.com/voloko/sdoc/blob/master/lib/sdoc/generator.rb#L367

Which breaks while trying to write the utime for the folder on Windows

Copying C:/SDK/Ruby/Ruby193/lib/ruby/gems/1.9.1/gems/sdoc-0.3.15/lib/rdoc/generator/template/sdoc/resources/./
** to C:/Users/Justin/Projects/sdoc/doc/**

Permission denied - C:/Users/Justin/Projects/sdoc/doc/.
C:/SDK/Ruby/Ruby193/lib/ruby/1.9.1/fileutils.rb:1379:in `utime'

Full Trace: https://gist.github.com/2048215#file_error+output+from+sdoc

Removing :preserve => true fixes it.

Make it more clear this is a template

Many people seem confused that this gem is doing more than they think.

It's actually just a plugin for RDoc, so many of the issues here can stem back from upstream.

Let's make it more clear what SDoc does, and how it's used.

Files to include

This is more of a general question about how to use sdoc/rdoc but I think it might help some other people having the same problems.

So I started generating Ruby and Rails docs for http://ruby-docs.org a while ago, and initially I simply included all files of a project. I ran into problems with files like this for example: https://github.com/ruby/ruby/blob/v0_7_1/doc/irb/irb-tools.rd.jp
sdoc (or rdoc) would crash hard with only the message "Terminated", no stack trace etc.
So then I explicitly named the files to be documented and chose all *.rb and *.rdoc files.
This led to the problem that in the Ruby docs for example, a lot of methods were missing: https://twitter.com/gerjomarty/status/421340424364888064
I then included *.c files as well and voila, the missing methods are back.

Now I'm unsure about which files need to be included to get complete docs?
Do I need *.h, *.el and generally all source code files, no matter which programming language?

rake doc:rails not working under Windows 7

This issue was originally posted under rails/rails#10382 and is pertaining to MS-Windows.

Composite paths in URLs may not consist of colons (:) in the middle of the path.

I worked on a temporary hack to make at least rake doc:(re)rails fly under Windows again.

The hack is neither clean nor DRY. Additionally, I had to introduce additional logic into views (templates) - and did not like it, unfortunately I found no other place without refactoring the generator codebase. I also did not feel comfortable with the lack of a test suite for the gem as such - and had no time (yet) to write one myself.

So the only "test suite" I used was rake doc:rails. I also did not test to merge 2 or more repositories, there are may be still bugs for Windows.

What worked well is the above under Windows7 - MRI ruby 2.0.0p0 and ruby 2.0.0p195. rails 4.0.0.rc1 as the repository codebase.

Same "tests" under Ubuntu 12.04 LTS also OK. I assume this should also work with other platforms. Other rubies I did not test.

The modified codebase is under https://github.com/DHB/sdoc (master) or :git => "git://github.com/DHB/sdoc",

Let me know if you accept it as is and if you want me to do a PR for it.

Error when regenerating rdoc through `gem rdoc` command

I tried to regenerate my gems' rdoc with the sdoc format. So I ran gem rdoc --all --overwrite --no-ri --config-file=~/.gemrc. My .gemrc has options 'rdoc: --inline-source --line-numbers --fmt=sdoc'. This is the error I get:

ERROR: While generating documentation for addressable-2.2.6
... MESSAGE: Error while evaluating /Users/ningj/.rvm/gems/ruby-1.9.2-p0@global/gems/sdoc-0.3.7/lib/rdoc/generator/template/sdoc/_context.rhtml: undefined method `path' for nil:NilClass (at " \n <a href="")
... RDOC args: --op /Users/ningj/.rvm/gems/ruby-1.9.2-p0@global/doc/addressable-2.2.6/rdoc --line-numbers --fmt=sdoc lib --title addressable-2.2.6 Documentation --quiet

When installing new gems, it works fine, but not when using the gem rdoc command.

Ability to give custom CSS / increase the font size

First of all, thanks for this project; awesome tool!

I would like to able to easily override some of the CSS in main.css. I'm especially interested in increasing font-size. The default is too small for my screen.

For the generator, maybe one could provide some easy mechanism to inject/modify CSS. For example, the wrapper executable could provide an option to specify additional CSS files which would then be included with the generated docs (and of course linked to from the frameset).

It would be especially welcome if there was some similar option on railsapi.com, so one could have the docs displayed with modified CSS or at least a bigger font size.

SDoc issues a deprecation warning in Rubygems 1.8.10

NOTE: Gem.available? is deprecated, use Specification::find_by_name. It will be removed on or after 2011-11-01.
Gem.available? called from /Users/msgehard/.rvm/gems/ruby-1.9.2-p290@rails3dev/gems/sdoc-0.3.11/lib/sdoc/generator.rb:6

Wondering if the gem can use json_pure for both JRuby and MRI or if a later version of the json gem can be used that has both JRuby and MRI support.

Should comments be considered part of documentation even when a line-break separates them from the method definition?

Hello @zzak!
Some Rails doc pages like this include weird documentation:

screen shot 2014-10-13 at 4 21 29 pm

The reason why this happens is because sdoc follows rdoc standard of considering that a comment is documenting a method even if a line-break separates them as in this case:

screen shot 2014-10-13 at 4 22 41 pm

How to solve this issue? I see two possible ways:

  1. Leave sdoc untouched, and update Rails documentation to remove all the cases like the one above.
  2. Change sdoc to ignore commented lines that do not immediately precede code.

I have been looking at Rails code, and it looks like all the comments that include documentation are already following 2. – for this reason, I think 2. makes more sense.

What's your take? Would you like a PR to implement 2.? Thanks!

Option -g doesn't work

Doesn't recognise -g option:

$ sdoc -g -o docs/rails gems/rails/
invalid options: -g
(invalid options are ignored)
$ sdoc --help

SDoc generator options:

    -g, --github                     Generate links to github.

actionpack-2.3.5 failed to build : 'to_json' nesting of 20 is too deep

Maybe there is a way to configure json to accept a nesting level of 20.

$ sdoc -o doc/actionpack-2.3.5 actionpack-2.3.5
Parsing sources...
actionpack-2.3.5/test/template/active_record_helper_test.rb:74:30: Couldn't find Post. Assuming it's a module
actionpack-2.3.5/test/template/active_record_helper_test.rb:103:30: Couldn't find User. Assuming it's a module
100% [248/248] actionpack-2.3.5/test/view/test_case_test.rb

Generating SHtml...
RDoc::RDocError is deprecated
/Users/rider/.rvm/gems/ruby-1.8.7-p249/gems/sdoc-0.2.17/lib/rdoc/../sdoc/generator/shtml.rb:126:in to_json': nesting of 20 is too deep (JSON::NestingError) from /Users/rider/.rvm/gems/ruby-1.8.7-p249/gems/sdoc-0.2.17/lib/rdoc/../sdoc/generator/shtml.rb:126:ingenerate_class_tree'
from /Users/rider/.rvm/gems/ruby-1.8.7-p249/gems/sdoc-0.2.17/lib/rdoc/../sdoc/generator/shtml.rb:125:in open' from /Users/rider/.rvm/gems/ruby-1.8.7-p249/gems/sdoc-0.2.17/lib/rdoc/../sdoc/generator/shtml.rb:125:ingenerate_class_tree'
from /Users/rider/.rvm/gems/ruby-1.8.7-p249/gems/sdoc-0.2.17/lib/rdoc/../sdoc/generator/shtml.rb:96:in generate' from /Users/rider/.rvm/gems/ruby-1.8.7-p249/gems/rdoc-2.5.8/lib/rdoc/rdoc.rb:392:indocument'
from /Users/rider/.rvm/gems/ruby-1.8.7-p249/gems/rdoc-2.5.8/lib/rdoc/rdoc.rb:388:in chdir' from /Users/rider/.rvm/gems/ruby-1.8.7-p249/gems/rdoc-2.5.8/lib/rdoc/rdoc.rb:388:indocument'
from /Users/rider/.rvm/gems/ruby-1.8.7-p249/gems/sdoc-0.2.17/bin/sdoc:7
from /Users/rider/.rvm/gems/ruby-1.8.7-p249/bin/sdoc:19:in `load'
from /Users/rider/.rvm/gems/ruby-1.8.7-p249/bin/sdoc:19

Bug with Ruby 1.9.2 invalid multibyte escape

Hi, I'm encountering an error trying to use sdoc with Ruby 1.9.2. The actual error is in a file in the rdoc gem, but I can't reproduce it unless I use sdoc.

Transcript below. Please note that if I run rdoc instead of sdoc no errors occur. This happens just running in an empty directory.

[system]test→ rvm use 1.9.2@sdoc_test --create
Using /Users/gabriel/.rvm/gems/ruby-1.9.2-p290 with gemset sdoc_test
[-ruby-1.9.2-p290@sdoc_test]test→ gem install sdoc
Fetching: rdoc-3.9.1.gem (100%)
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Fetching: json-1.5.3.gem (100%)
Building native extensions.  This could take a while...
Fetching: sdoc-0.3.0.gem (100%)
Successfully installed rdoc-3.9.1
Successfully installed json-1.5.3
Successfully installed sdoc-0.3.0
3 gems installed
[-ruby-1.9.2-p290@sdoc_test]test→ sdoc
NOTE: Gem.available? is deprecated, use Specification::find_by_name. It will be removed on or after 2011-11-01.
Gem.available? called from /Users/gabriel/.rvm/gems/ruby-1.9.2-p290@sdoc_test/gems/sdoc-0.3.0/lib/sdoc/generator.rb:5.
/Users/gabriel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': /Users/gabriel/.rvm/gems/ruby-1.9.2-p290@sdoc_test/gems/rdoc-3.9.1/lib/rdoc/ruby_lex.rb:833: invalid multibyte escape: /[\w\x80-\xFF]/ (SyntaxError)
    from /Users/gabriel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gabriel/.rvm/gems/ruby-1.9.2-p290@sdoc_test/gems/rdoc-3.9.1/lib/rdoc/parser/ruby.rb:11:in `<top (required)>'
    from /Users/gabriel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gabriel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gabriel/.rvm/gems/ruby-1.9.2-p290@sdoc_test/gems/rdoc-3.9.1/lib/rdoc/rdoc.rb:8:in `<top (required)>'
    from /Users/gabriel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gabriel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gabriel/.rvm/gems/ruby-1.9.2-p290@sdoc_test/gems/sdoc-0.3.0/lib/sdoc/generator.rb:16:in `<top (required)>'
    from /Users/gabriel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gabriel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gabriel/.rvm/gems/ruby-1.9.2-p290@sdoc_test/gems/sdoc-0.3.0/lib/sdoc.rb:7:in `<top (required)>'
    from /Users/gabriel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gabriel/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/gabriel/.rvm/gems/ruby-1.9.2-p290@sdoc_test/gems/sdoc-0.3.0/bin/sdoc:2:in `<top (required)>'
    from /Users/gabriel/.rvm/gems/ruby-1.9.2-p290@sdoc_test/bin/sdoc:19:in `load'
    from /Users/gabriel/.rvm/gems/ruby-1.9.2-p290@sdoc_test/bin/sdoc:19:in `<main>'

pushState when page open

When click item in panel, it's better to pushState for the current page. Well user knows the url for the current page and copy it to do something.

badges

For what purpose badge on current item differs in color from same badge on another item? It is harder to understand that badge is same

Cleanup for 0.2 and 0.3 branch

I've created branches cleanup-0.2 and cleanup-0.3 for cleanup of respective versions.

Most important commit in both version is one which removes $:.unshift File.dirname(__FILE__) from sdoc.rb. For the first this change of load path is useless as loading sdoc rubygem already adds it to load path. Secondly, as it is required from rdoc/discover.rb which is in turn loaded by rdoc for all versions of all gems, so if multiple versions of sdoc are present, than load path is broken with lib of different versions of sdoc.

Other points: cleanup of require calls including json gem, unification of indentation and some other stuff

Notification message on the webapp on custom build

The notification message on building the custom api at http://railsapi.com does not go away on successful write back to the browser. This means even after I have downloaded the .zip file the notification message is still there and there is no way to get rid of it unless ofcourse you refresh the page. Seems like an easy fix to me.

Relax json dependency

I believe it's not necessary to jump from json 1.1.3 automatically to 1.8 [1]. For instance, in Fedora we have json 1.7.7 and it works just fine. But this way we have to patch the requires for json which is far from ideal.

I haven't yet tested other versions. I will try to when I have time. Thanks.

[1] 8d76e6a

diagram= NoMethodError when rdoc > 2.5.0

As soon as I install sdoc when the rdoc is at version 2.5.0 (or greater) then the rdoc generation fails on this:

 ERROR:  While executing gem ... (NoMethodError)
 undefined method `diagram=' for #<RDoc::Options:0xa32511c>

SDoc appears to violate the RDoc and Darkfish licenses

Extra <p> tags appear in results snippet

Extracted from a search index created by rdoc (4.1.1)

["assert_equal",
   ...
   "<p>Tests if <code>expected</code> is equal to <code>actual</code>.\n<p>An optional failure message may be provided as the final argument. …\n",
null,0]

Those extra p tags appear in the search results (they wouldn't in the past). I tried to look into rdoc why but that gem is quite intricate. The source lines that appear for snippet are treated as RDoc::Markup::Paragraph, I think that's why rdoc add those p tag.
I don't have enough knowledge to fix the source of the problem, but I have a workaround:
In searchdoc.js, change this line (in renderItem):

if (result.snippet) html += '<p class="snippet">' + escapeHTML(result.snippet) + '</p>';

to

if (result.snippet) html += '<p class="snippet">' + result.snippet.split('\n')[0].replace('<p>','') + '</p>';

I actually prefer this since the original line escapes the html making presentation tags apparent in the result...

PS: Why aren't those p tags closed by rdoc?
PS2: http://api.rubyonrails.org is also currently showing the bug

Feature Request: Other gems

I LOVE sdoc, it’s incredible. What would be good though is if you could set one up easily for a custom list of rdocs. What I’m after is an sdoc installation for Rails and one for base Ruby (plus maybe hpricot, nokogiri, redcloth, etc).

GitHub project URL goes nowhere

When clicking the project link, the URL goes nowhere. Did the URL move?

If there is no site for the project, I would be happy to help contribute to one. 😄

Feature Request: TextMate URLs (code provided)

Great app. I just added in TextMate integration for my own benefit, maybe you could offer it as a command line option? I put this into _context right after the github link..

| <a href="txmt://open/?url=file://<%= File.join(@baseDir, path) %>&line=<%= line %>&column=1">in TextMate</a>

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.