Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best wiki syntax for documentation in ruby code and project README files

Tags:

ruby

wiki

rdoc

Are there any wiki syntax like rdoc, markdown, ... recommended in the ruby world? I write sometimes open source code and have no glue which syntax I should use in Code documents and in README files. What be helpful for me which and why you use it.

like image 467
gustavgans Avatar asked Dec 31 '25 08:12

gustavgans


2 Answers

RDoc is the default documentation tool. The RDoc syntax is the default one allowed inside Ruby files and libraries.

You might find TextTile or Markdown used outside Ruby classes for text files such as the README or the CHANGELOG files. But this isn't the standard sintax so you would need a way to tell the parser which syntax the file is written with, usually this way is the file extension.

GitHub, for example, follows exactly this convenction. Unless a .textile or .markdown extension is specified, the file is parsed as RDoc.

  • http://github.com/weppos/whois (.rdoc == Rdoc)
  • http://github.com/rails/rails/tree/master/railties/ (no extension == Rdoc, but not for GitHub)
  • http://github.com/technoweenie/restful-authentication/blob/master/README.textile (.textile == Textile)

Remember: AFAIK, inline documentation is always parsed as RDoc.

like image 74
Simone Carletti Avatar answered Jan 02 '26 02:01

Simone Carletti


On Github, people mostly use Rdoc or Textile as format for their README-files. Rdoc is also very useful for API-documenting your code, as the syntax integrates really nice into the code and is pleasant to read.

like image 22
Marcel de Graaf Avatar answered Jan 02 '26 01:01

Marcel de Graaf