2

Iam using yard for documentation in my project but i don't want to show my source source to the users. Is there a way to hide source code in yard.

Mothirajha
  • 1,033
  • 1
  • 10
  • 18
  • 1
    You realize that your code is totally available to the users when they use it. They can just open it and read. So what's the point in hiding this in the documentation, besides irritating the users? – Sergio Tulentsev May 14 '15 at 09:58
  • 1
    it is not a open source project, it just a document for api so users(developers) can understand what are request parameters and response. – Mothirajha May 14 '15 at 10:22
  • We're using rspec_api_documentation for this purpose. – Sergio Tulentsev May 14 '15 at 10:24
  • ya it is preety cool i will go into it, but if i know how to hide source code in yard it would be much better – Mothirajha May 14 '15 at 10:37
  • Did you find a solution? We also need to hide the source - as it's not something our API users need to see. (Nor can we allow it - proprietary source.) Our API is defined in C so no-one would otherwise be able to inspect it. – thomthom Nov 13 '15 at 12:38
  • @thomthom Didn't find any solution for yard, but https://github.com/richhollis/swagger-docs was cool, u can try it once. – Mothirajha Nov 16 '15 at 04:55

1 Answers1

1

From the YARD mailing list:

[my_templates/default/method_details/setup.rb]

def source
  return
end

[…]

Then run with 'yard -p my_templates'

Christoph Lupprich
  • 1,170
  • 8
  • 16