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
non-standard FormatCodes in Code snippets #124
Comments
new-raku is a one off put out by @finanalyst. This looks fine on the soon-to-be-live |
Same rendering issue on my local machine. As discussed on IRC, the problem (and difference from docs-dev) seems to be the highlighter. |
Yes the highlighter has not been installed in the build environment for doc-website. It is a one-off installation, but requires a node.js install as well. There is a warning when raku-pod-render is installed by zef if node.js v14 is not present. This extra stack of software just to have highlighting is why developing a raku highlighter is important. @dontlaugh there is a separate binary when raku-pod-render is installed that will install the highlighter. |
@dontlaugh further to the above, the following is installed by raku-pod-render
Run it once in the build environment. You will need to have versions of |
Does this depend on an exact version of node? Installation fails with this error
|
@finanalyst the open PR in your raku-pod-render repo appears to explain my error |
@dontlaugh I've just merged the change. @cfa+ I've bumped the version of raku-pod-render to 4.4.1 and pushed it to fez. Please try |
@finanalyst I installed the highlighter tools into the build environments. Check the dev environment? https://docs-dev.raku.org/language/5to6-nutshell.html#constant I see some highlighted stuff. :) Update (for those unaware): note that the hourly build overwrites this public container, so anyone can pull/run the following container registry https://quay.io/repository/colemanx/raku-doc-website |
OPs original bug is now visible on docs-dev |
Just looked at the original issue. The problem is actually quite severe! The issue concerns an example snippet of Raku code.
I have only just discovered that according to S26, No extra behavior is documented according to Raku/language/pod. So the Rakudoc in the snippet above is a non-documented extension from the standard. Of the 412 Rakudoc filles in repo, only 13 contain What is the utility of re-writing the template to allow for a non-standard Rakudoc ? The use case for I would prefer to remove all the 11 examples of the redundant |
Interesting. My reading of S26 is that
(emphasis mine) So, I'm not sure Regarding
the use case seems broader than that—it's to allow for formatting. Even with syntax highlighting enabled I may still want to link a substring in a code block (as in this +1 to documenting |
@cfa I am in favour of not allowing Format codes inside a code block. IMO a code block should be Raku compilable code. A copy/paste of a snippet with Formating will lead to non compilation. Also, looking more broadly, what happens when more Format codes, such as |
But code blocks aren't necessarily Raku code. For example, =for code :lang<ruby>
foo + # In Ruby a trailing operator means parsing should continue
bar +
baz in rb-nutshell.pod6 should be highlighted as Ruby, not Raku. At the moment this is not the case (see here); perhaps this ought to be filed as a separate issue? Meanwhile (to your broader point), we have sundry formatting issues like this one where |
P.S., these are all potentially problematic at the moment due to |
We need two issues:
|
Does that discussion not affect the specification of Raku overall? In which case it would make sense to migrate it to a place where everybody can see it as a language design question. |
We can move the entire ticket to raku/doc, but not parts of it. If you want to do a partial move, please create a curated issue/discussion on raku/doc. If you want the whole thing, give this a thumbs up. |
Might be more straightforward to create a new issue there, summarising and linking this discussion? |
(The followup |
Another instance of this issue was just reported: Raku/doc#4250 |
The issue then is to revise the rendering of code-blocks so that :allow is correctly recognised. There should be an update of |
This turned out to need a change to the block-code template. Most of the work was already done by Rakudo, but getting the highlighter to work nicely with rendered HTML was more difficult.
Although it only took a change in the Code block template in `Website/plugins/ogdenwebb`, getting it to work with highlighting was not obvious. Basically all HTML tags are replaced with 0xFF chars before highlighting, then put back.
@cfa This is now resolved by a patch to the Block code template. The result can be viewed at new raku pod.
|
L<need|/language/modules#need> MyModule;
in docs/language/modules.pod6 is currently rendered as
on https://new-raku.finanalyst.org/language/modules.html#use.
The text was updated successfully, but these errors were encountered: