-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotate code that is following or followed by other code #863
Conversation
I don't understand. This is already the case. |
The current default CSS theme contains this fragment: p code,
li code {
background-color: var(--li-code-background);
color: var(--li-code-color);
border-radius: 3px;
padding: 0 0.3ex;
} which introduces a |
Well by all means fix the css (for example |
I see. I'm not sure how people want to change the default theme, then. I don't think it's technically possible to select |
To be clear your classes seem to be reinventing the |
|
That sounds like a quite complicated temporary workaround to avoid implementing references inside code block (e.g |
I may not be a CSS "guru" but I have lost enough useless hours of my life into it to tell you that this:
is the beginning of a nightmare. If possible wouldn't adding a class on the Also, @Octachron's comment. |
Fair enough. I think we can use And yes, supporting references within code (but still rendering records as they are) would be wonderful! |
I'm pretty sure you could manage to make the successor background bleed into the precessor so as to cover its right round corners via a judicious use of |
Alright. I am closing this while searching for other solutions. Just to clarify, do the developers prefer links within code (which might mess up syntax highlighting...?) or magical swapping of |
Just FTR the issue that tracks that is #756 |
Closes #696. The goal of this PR is to make
(** [f][ ][x] *)
look like
(** [f x] *)
with the default theme. The motivation is to write
{!val:f}[ x]
so thatf
is linked but the text still looks like[f x]
.Technical details
This PR annotates adjacent
<code>
phrases with CSS classesfollowing-code
andfollowed-by-code
so that one can turn off the padding between<code>
via CSS. The comment[f][ ][x]
will generate something like this:and then the padding can be turned off using the CSS selectors
code.following-code
andcode.followed-by-code
. See the changes tosrc/odoc/etc/odoc.css
. The annotation algorithm does not change the asymptotic complexity and I did not notice obvious slowdown. However, a serious benchmarking might still be useful.Caveats
tyxml
would insert spaces whenindent
is true, but it's no longerodoc
's fault.