Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Rocco ignores JS code/comments #77

Open
jm3 opened this issue Jan 9, 2012 · 5 comments
Open

Rocco ignores JS code/comments #77

jm3 opened this issue Jan 9, 2012 · 5 comments

Comments

@jm3
Copy link

jm3 commented Jan 9, 2012

Is Javascript not one of the languages Rocco will generate docs for? Test run with two trivial example files:

$ cat javascript.js  
/* something */
function f() {
  // a comment
  alert( "hi" );
}   

$ cat ruby.rb 
module SpanishHarlem
  # purple drank
  def meth_od(code)
    puts "sup"
  end 

  # stuff
  puts "yo"
end 

$ bundle exec rocco ruby.rb javascript.js  
WARNING: Pygments not found. Using webservice.
pygmentize not in PATH; using pygments.appspot.com instead
rocco: ruby.rb -> ruby.html
rocco: javascript.js -> javascript.html

$ open ruby.html javascript.html

RESULT: generated HTML for ruby file looks fine, generated HTML for js file = no code / comments

ruby works, js doesn't

@rtomayko
Copy link
Owner

rtomayko commented Jan 9, 2012

It should work with anything supported by pygments. Perhaps it's something with the webservice. Mind installing pygments locally and giving that shot?

@jm3
Copy link
Author

jm3 commented Jan 9, 2012

Ah, ok, will get a local pygmentization going.

Any recommended way for me to simply test the web service for parsing JS, first?

yumitsu added a commit to forgotten-labors/rocco that referenced this issue Jan 10, 2012
@yumitsu
Copy link

yumitsu commented Jan 10, 2012

@jm3 Rocco doesn't detect input file language without pygments installed locally:

  def detect_language
    @_language ||=
      if pygmentize?
        %x[pygmentize -N #{@file}].strip.split('+').first
      else
        "text"
      end
  end

I suggest (forgotten-labors/rocco@13b7975) a basic language detection, since some of defined code styles has keys similar to file extensions.

@jm3
Copy link
Author

jm3 commented Jan 10, 2012

It did indeed work with a local pygments install [1]. If there's anything I can do here to help test / verify / document the above, please let me know!

[1] http://jm3.github.com/thunderous-configs/en.wikipedia.org.html

@yumitsu
Copy link

yumitsu commented Jan 10, 2012

@jm3 You still can generate documentation without pygments installed locally. Just pass the --language option to rocco:

$ bundle exec rocco --language=js javascript.js

or

$ bundle exec rocco -l js javascript.js

yumitsu added a commit to forgotten-labors/rocco that referenced this issue Jan 10, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants