Open skalee opened 5 years ago
@lsegal How about this one? Can I implement such feature, or is it something what doesn't fit to YARD for some reason?
@lsegal Few more ideas with different background colors:
Using background color #efeff1
(which is exactly 3% darker than listings' background, i.e. #f7f7f9
):
![Zrzut ekranu 2019-12-12 o 03 33 16](https://user-images.githubusercontent.com/154287/70677713-36e3f980-1c90-11ea-8c52-43be5ffd7067.png) |
Using background color #eeeeee
(which is widely used in the default theme):
![Zrzut ekranu 2019-12-12 o 03 26 06](https://user-images.githubusercontent.com/154287/70677368-49116800-1c8f-11ea-9165-4667fd9284c8.png) |
Using background color #e1e1e8
(same as border color):
![Zrzut ekranu 2019-12-12 o 03 30 16](https://user-images.githubusercontent.com/154287/70677561-cd63eb00-1c8f-11ea-97f8-4dca5e946892.png) |
Achieved by adding a few lines to templates/default/fulldoc/html/css/style.css
:
/* code block titles (supported in AsciiDoc) */
#filecontents .listingblock .title {
padding: 9px 14px 9px 14px;
margin-top: 4px;
border: 1px solid #e1e1e8;
background: #e1e1e8;
border-radius: 4px;
font-size: 1em;
overflow-x: auto;
line-height: 1.2em;
margin-bottom: -9px;
}
AsciiDoc allows code listings to have titles (typically file name). However, they look ugly and confusing in YARD documentation. In particular, they are difficult to distinguish from regular paragraphs.
Obviously, using a custom template may help a lot. However, this issue should be addressed in a default template IMO.
I am not sure if this issue belongs to this repository or rather to https://github.com/docmeta/rubydoc.info.
Steps to reproduce
Following AsciiDoc document was used to illustrate the issue:
With default settings, YARD translates it to a following piece of HTML:
Actual Output