Wie füge ich vorhandene Kommentare zu RDoc in Ruby hinzu?

original title: "How do I add existing comments to RDoc in Ruby?"


Translate

I want to format my existing comments as 'RDoc comments' so they can be viewed using ri.

What are some recommended resources for starting out using RDoc?



Ich möchte meine vorhandenen Kommentare als "RDoc-Kommentare" formatieren, damit sie mit ri angezeigt werden können. Welche Ressourcen werden für den Einstieg in RDoc empfohlen?

Dies ist die Zusammenfassung nach der Übersetzung. Wenn Sie die vollständige Übersetzung anzeigen möchten, klicken Sie auf das Symbol "Übersetzen"


Alle Antworten
  • Translate

    A few things that have bitten me:

    • :main: -- RDoc uses only the last one evaluated; best to make sure there's only one in your project and you don't also use the --main command-line argument.
    • same as previous, but for :title:
    • :section: doesn't work very well

  • Translate

    RDoc uses SimpleMarkup so it's fairly simple to create lists, etc. using *, - or a number. It also treats lines that are indented at the same column number as part of the same paragraph until there is an empty line which signifies a new paragraph. Do you have a few examples of comments you want RDoc'ed so we could show you how to do them and then you could extrapolate that for the rest of your comments?