Raku / doc-website

Tooling to build/run the documentation website
Artistic License 2.0
7 stars 10 forks source link

Pod documentation that use :allow< > does not highlight as Raku code but as Pod #274

Open samcv opened 7 years ago

samcv commented 7 years ago

Pod documentation that is: =begin code :allow<B L> highlights as Pod not Perl 6 code. It is the :allow which causes this.

htmlify.p6 passes these as Pod to the highlighter, and so it gets highlighted as such (this is to allow us to make things bold/other styles).

Proposed solution from the docs side: we need to parse this Pod and strip it of Pod tags, and insert special Unicode control codes which nobody will have in normal text. These control codes can then be removed in the htmlify.p6 side once the highlighter highlights them.

From the highlighter https://github.com/perl6/atom-language-perl6 side, we will tag these differently than normal code, so we can add that effect in the CSS.

rafaelschipiura commented 6 years ago

Possibly part of Raku/doc#1823.

JJ commented 6 years ago

I'll see what goes on with this one. I'm not sure I understand it completely, but first I'll see how many pieces of code are affected. If there are not too many, I'll try the solution proposed.

samcv commented 6 years ago

What I was meaning about adding special Unicode codepoints was so we know where to add bold html tags, but I don't know if that approach would be best.

Essentially what the code currently does afaik for =begin code :allow is to not put it through the highlighter but instead renders it to html with pod, so we get links and bold but not syntax highlighting. We need some way to take out the POD tags, highlight it, and then add the bold and links in afterword.

JJ commented 6 years ago

Do you really think it is worth the while? Looks like a good amount of work for something we could achieve in some other way...

2colours commented 1 year ago

@coke this is definitely a website issue. Moreover, I think this has been at least approached by @finanalyst and it sparked a lot of discussion at other places.