Documentation: How to Integrate ReviewUIs via Extensions

Review Request #3596 — Created Nov. 30, 2012 and submitted

Information

Review Board
master

Reviewers

A how-to guide for creating and integrating ReviewUIs through ReviewBoard Extensions.

Content adds to http://www.reviewboard.org/docs/codebase/dev/extending/extensions/
Ran `make html` in reviewboard/docs/codebase/

No error output from sphinx.

Rendered HTML pass visual inspection.
Description From Last Updated

To reference a file, you can use :file:`extension.py`.

chipx86chipx86

Instead of this, an alternative is to create: self.reviewui_hooks = ReviewUIHook(self, [XMLReviewUI]) in the extension's __init__. I think that's a …

chipx86chipx86

Blank line after this.

chipx86chipx86

While nice to demonstrate, we should keep this as simple as possible to follow and not make people wonder if …

chipx86chipx86

Two blank lines.

chipx86chipx86

"syntax highlighted"

chipx86chipx86

Blank line between these.

chipx86chipx86

And here.

chipx86chipx86

And here.

chipx86chipx86

I think this should just be a :file:`...`. You won't get the bold, but I don't think that's a problem.

chipx86chipx86

Can you put a blank line around each block? Helps with readability.

chipx86chipx86

We don't use MEDIA_URL or MEDIA_SERIAL anymore. It should all be {% static %}, in theory. Have you tried that …

chipx86chipx86

:file:

chipx86chipx86

:file:

chipx86chipx86

Blank line between these.

chipx86chipx86
chipx86
  1. 
      
  2. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
    Show all issues
    To reference a file, you can use :file:`extension.py`.
  3. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
     
     
     
     
    Show all issues
    Instead of this, an alternative is to create:
    
    self.reviewui_hooks = ReviewUIHook(self, [XMLReviewUI])
    
    in the extension's __init__. I think that's a better model in general for us to document, as it's less code and achieves the same thing. That can then more easily be merged into the code below.
  4. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
    Show all issues
    Blank line after this.
  5. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
     
    Show all issues
    While nice to demonstrate, we should keep this as simple as possible to follow and not make people wonder if they need these or what they're for.
  6. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
     
    I'm actually not familiar with this format. What are we doing?
    1. This is for creating a list when items in the list need to span multiple lines in the .txt file. See Line #350 / #354 for an existing example.
  7. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
     
     
    Show all issues
    Two blank lines.
  8. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
    Show all issues
    "syntax highlighted"
  9. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
     
    Show all issues
    Blank line between these.
  10. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
     
    Show all issues
    And here.
  11. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
     
    Show all issues
    And here.
  12. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
    Show all issues
    I think this should just be a :file:`...`. You won't get the bold, but I don't think that's a problem.
  13. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
    Show all issues
    Can you put a blank line around each block? Helps with readability.
  14. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
     
     
     
     
    Show all issues
    We don't use MEDIA_URL or MEDIA_SERIAL anymore. It should all be {% static %}, in theory. Have you tried that with your extension?
    1. Fixed: Removed {{MEDIA_SERIAL}} as it is no longer used, but kept {{MEDIA_URL}} as it's the only way to access static files uploaded through extensions.
  15. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
    Show all issues
    :file:
  16. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
    Show all issues
    :file:
  17. docs/codebase/extending/extensions.txt (Diff revision 1)
     
     
     
    Show all issues
    Blank line between these.
  18. 
      
SL
chipx86
  1. Looks good. I made a few changes:
    
    * Removed trailing whitespace
    * ReviewUI now subclasses FileAttachmentReviewable{View}
    * Added syntax highlighting for the template and JavaScript
  2. 
      
SL
Review request changed
Status:
Completed
Change Summary:
Pushed to release-1.7.x (eeddea2)