How to represent square brackets ([]) in RDoc?

I am trying to document some rake tasks that I wrote using RDoc comments in my class, and I ran into a problem representing square brackets. I want to add some examples of how to start my tasks using parameter faces and therefore have an rdoc line like this:

#, eg. rake build[MyProject]

The problem is that converting the RDoc parser creates a link instead of printing square brackets. I tried all kinds of escape sequences: [; [[; #{[My project]}; & Amp; # 91; MyProject & # 93; but nothing works.

Is there any way to avoid these square brackets so that they do not convert to a link?

Thanks Aaron

+3
source share
3 answers

Well, with further experiments, I discovered a way to do this. If I put two spaces in front of each line, RDoc treats the line as text in formatting format and displays the brackets. Good enough for me.

Resulting RDoc string:

# eg. rake build [MyProject]
+2
source

The tag <tt>avoids the link-text [hyperlink] syntax (and also puts the text in a monospaced font).

So this rdoc

# eg. <tt>rake build[MyProject]</tt>

will create this documentation:

eg. rake build[MyProject]

+1
source

.

text[par] . text [par], .

[]:

* [par] labeled list
* x[par] x is linked with par
* x [par] Text as is (space between x and par)
* []  brackets disapear
* x _[par]_  Content between[] disapears.

text<space>[par] , <em>...</em> ( _..._).

0

Source: https://habr.com/ru/post/1775626/


All Articles