Code Monkey home page Code Monkey logo

Comments (3)

drbrain avatar drbrain commented on May 29, 2024

I'm not sure what you mean by decouple the doucementation from the code. Can you give an example?

I'll guess at what you mean through the following:

RDoc generates documentation from the RDoc::CodeObject tree (https://github.com/rdoc/rdoc/blob/master/lib/rdoc/code_object.rb) so one could be constructed manually to build documentation. This would be work, though.

You can also transform text into HTML (or other supported output formats) directly:

@html = RDoc::Markup::ToHtml.new

out = @html.convert $stdin.read

$stdout.write out

There's also rdoc-data (https://github.com/rdoc/rdoc-data) which contains ri data for several versions of ruby. The driver in the Rakefile could be modified to produce HTML instead without much work (I think '--ri' would need to be dropped from line 74 of the Rakefile).

from rdoc.

zimbatm avatar zimbatm commented on May 29, 2024

hi drbrain, thanks for all the pointers. You got my idea. rdoc-data could be a good vector to distribute my hypothetical ruby@doc branch but I want to try something different.

Just to make it clear for me and in case you get some ideas: I intend to add --overlay=PATH to the rdoc command-line. If defined, it would start looking for rdoc files in that folder that have the same basename as the source files during the tree construct. Say optparse.rb.rdoc for example would contain new definitions for optparse.rb. I'm not sure yet how I could split that rdoc file to say: section xy overrides OptionParser class doc, or OptionParser.new class method, but that shouldn't be too difficult.

In the grand scheme of things, this approach would allow new interesting opportunities: separate documentation from code, allow localization of the doc, simplify the implementation of some crazy wiki-like rdoc editor.

from rdoc.

drbrain avatar drbrain commented on May 29, 2024

I would reuse the directives preexisting in RDoc like Document-class, Document-method, :method:, :attr_accessor: etc.

Until you need some new features I am going to close this bug.

from rdoc.

Related Issues (20)

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.