-
-
Notifications
You must be signed in to change notification settings - Fork 732
Code highlight markup causes link text to not be colored #546
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
Comments
The discussion present on asciidoctor/asciidoctor#1555 |
asciidoctor/asciidoctor#1555 doesn't seem to be relevant as it's about code blocks. As for the "Differences between Asciidoctor and AsciiDoc" links, there's a lot of information there. Would you mind pointing out which specific part of it you think is relevant? If you think you have a solution to this issue, post a snippet of markup here and I'll check it out. |
For this part, I meant that I understood how both works and how they differ in their working part. From the link posted, I mainly understood about Markdown-style syntax and Source code highlighting. Yes, I totally agree that the above-posted link is for code blocks. I thought this might fix out the issue. From the Issue Description, I understood that for:
The Asciidoc document shows it as: but on the website, we get the output: Please, can you guide me on how to check/see how my asciidoc code renders on the website?
It works fine on Asciidoc and displays link inside the code but I don't know how it will display it on a webpage. |
The system Arduino uses to generate the Language Reference website from the asciidoc files is in a private repository. I can tell you it uses Asciidoctor and Hugo. For what you want to do, I believe you would only need to use Asciidoctor. Interestingly, I understand that GitHub also uses Asciidoctor to render asciidoc, but evidently there is some difference between the way they use it and the way Arduino uses it.
I just tested, and that works! Great job! I'm so used to Markdown that I would never expect that to work. The equivalent in Markdown:
renders like this: |
Thanks a lot for this information.
I am so happy that it worked.
Yes, I totally agree, how the same render in Markdown. So, is it possible to fix this issue now? I'll love to do it. Should I compile a list of all the pages, that have a link inside code elements and then fix them? |
Yes!
I think you could do a search for `] to find all of them. My opinion is this: In cases where we want it to be obvious to the reader that there is a link, it should always have link coloration. However, there is a proposal to linkify all occurences of text that corresponds to a Language Reference page (#462). I'm in support of that, but I do think there might be cases where "convenience linkification" (where we just linkify everything so the reader can easily click on any term they might be interested in knowing more about) could lead to a "sea of teal" effect, where practically every other word in a paragraph is colored as a link. That which might harm readability. In this case, it might make sense to intentionally use the quirk of the old link formatting style causing links to not be colored to avoid the "sea of teal". Here's an example of what I mean:
Here, we are intending to direct the user to the Serial.setTimeout() link and so we should use this style of asciidoc markup so that the link will be colored:
Now consider this (made up) text:
I think you can see how certain parts of the text in the reference might become a bit too heavy on teal (blue here). In these cases, I think it would make sense to allow the first instance of each term to be colored, but then use the old markup style to cause subsequent occurrences of the term to not be colored (though still linkified):
|
Yes, I understood your point that we should use teal colour inside the code for functions only for their first occurrences and leave the rest occurrences following the old fashion where they are a link without the teal colour, to avoid "sea of teal" effect. I'll work out to find and compile a list of all the pages and post it here and then work on them to fix this issue. Thanks a lot for the valuable suggestion. |
Code Highlight markup and Link colouration fix. Ref: arduino#546
arduino#546 Line 16: **Grouped together** creates a tautology
Wuha :D @animeshsrivastava24 You must be crazy, haha 👍 |
@SeppPenner 😅 . I'll make sure after this Issue gets fixed, I'll send single PR for multiple file changes. I know it creates a lot of PR which might not be good. |
If a reference page uses code highlight markup on link text:
reference-en/Language/Structure/Further Syntax/include.adoc
Line 27 in 15e183f
it is rendered on the Language Reference like this:
The reference pages contain many links that use a code term as the link text and it's nice to use the code markup on these terms to clearly differentiate them from regular text but it's not worth doing so if it results in a link that is not visually noticeable.
I wonder whether it would be possible to change this (perhaps via a stylesheet?) so that the text is still colored as a link, similar to how GitHub renders the following Markdown:
as:
define
The text was updated successfully, but these errors were encountered: