docs/Handlers.md in yard-0.5.8 vs docs/Handlers.md in yard-0.6.0

- old
+ new

@@ -2,18 +2,18 @@ ===================== Handlers allow the processing of parsed source code. Handling is done after parsing to abstract away the implementation details of lexical and semantic analysis on source and to only deal with the logic regarding recognizing -source statements as {file:CodeObjects.md code objects}. +source statements as {file:docs/CodeObjects.md code objects}. ![Handlers Architecture Class Diagram](images/handlers-class-diagram.png) The Pipeline ------------ -After the {file:Parser.md parser component} finishes analyzing the +After the {file:docs/Parser.md parser component} finishes analyzing the source, it is handed off for post-processing to the {YARD::Handlers::Processor} class, which is responsible for traversing the set of statements given by the parser and delegating them to matching handlers. Handlers match when the {YARD::Handlers::Base.handles?} method returns true for a given statement. The handler can then perform any action after being invoked by the `process` @@ -49,11 +49,11 @@ puts "Handling a module named #{statement[0].source}" end end For details on what nodes are, and what node types are, see the -{file:Parser.md parser architecture document}. +{file:docs/Parser.md parser architecture document}. In this case the node type being handled is the `:module` type. More than one node type or `handles` declarations may describe a single handler, for instance, a handler that handles class definitions should handle the `:class` and `:sclass` node types respectively (the latter refers to classes defined as `class << Something`). @@ -87,11 +87,11 @@ Creating a new Code Object -------------------------- Usually (but not always) handling is performed to create new code objects to add -to the registry (for information about code objects, see {file:CodeObjects.md this document}). +to the registry (for information about code objects, see {file:docs/CodeObjects.md this document}). Code objects should simply be created and added to the existing `namespace`. This will be enough to add them to the registry. There is also a convenience {YARD::Handlers::Base#register register} method which quickly sets standard attributed on the newly created object, such as the file, line, source and docstring of the object. This method will be seen in the next example. @@ -130,10 +130,10 @@ Because the legacy handler uses the legacy parser and therefore a different kind of AST, there are subtle differences in the handler API. Most importantly, the `handles` method usually deals with either lexical tokens or source code as a string or RegExp object. The statement object, similarly, is made up of lexical tokens instead -of semantically parsed nodes (this is described in the {file:Parser.md parser document}). +of semantically parsed nodes (this is described in the {file:docs/Parser.md parser document}). The module example above can be rewritten as a legacy handler as follows: class YARD::Handlers::Ruby::Legacy::ModuleHandler < YARD::Handlers::Ruby::Legacy::Base handles TkMODULE