-
For the documentation of my packages I would like to show in the home page the recommended command to install the package, but centred and with the width adjusted to the actual size, not the full window. Something like this: The Doxygen implementation wraps the code fragment with a new @htmlonly
<div class="command">
<div class="fragment">
<div class="line">xpm install @micro-os-plus/utils-lists@latest --verbose</div>
</div>
</div>
@endhtmlonly The CSSs are: div.command {
padding-top: 16px;
display: flex;
justify-content: center;
}
div.command div.fragment {
padding-left: 3em;
padding-right: 3em;
}
div.command div.fragment div.line {
text-align: center;
} Unfortunately there are several things not going according to plan:
ilg@wksi ~ % echo "[
xpm install @micro-os-plus/utils-lists@latest --verbose
]" I took a look at the I would highly appreciate any help to fix this issue. Thank you, Liviu |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Regarding he off-centered button: I figured out that the absolute positioning of the button doesn't work well with the flexbox environment. .command .fragment {
margin: 0;
} The extra whitespace and newline in the copied content seems to be caused by the formatting of the raw HTML. If you change the HTML to a version without newlines and indentation, the additional whitespace is gone: <div class="command">
<div class="fragment"><div class="line">xpm install @micro-os-plus/utils-lists@latest --verbose</div></div>
</div> Doxygen seems to not indent the generated HTML properly, so this never was a problem. But I agree that the copy functionality should not be affected by indentation of the HTML. The JS code doing the copy may need some polishing. |
Beta Was this translation helpful? Give feedback.
-
Indeed! This fixed the alignment.
Again, spot on!
You mean adding a Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Regarding he off-centered button: I figured out that the absolute positioning of the button doesn't work well with the flexbox environment.
This needs further investigation, but a quick fix should be:
The extra whitespace and newline in the copied content seems to be caused by the formatting of the raw HTML. If you change the HTML to a version without newlines and indentation, the additional whitespace is gone:
Doxygen seems to not indent the generated HTML properly, so this never was a problem. But I agree that the co…