Raku / problem-solving

🦋 Problem Solving, a repo for handling problems that require review, deliberation and possibly debate
Artistic License 2.0
70 stars 16 forks source link

API for RakuDoc v2 #412

Open finanalyst opened 9 months ago

finanalyst commented 9 months ago

Revise the compiler output (API?) for RakuDoc instructions.

Currently Rakudo produces a tree of Pod::Blocks, providing it as the variable $=pod. The naming of the Pod-Blocks is inconsistent (more below). The RakuAST compiler's statement tree mimics the inconsistent block names. I propose

Since RakuDoc v2 was written so that it would be parsable as RakuDoc v1, there is no need - IMHO - to change the $=pod output. …

What we get at the moment (to the best of my knowledge, because I don't know if this documented elsewhere, & these are the blocks Raku::Pod::Render handles):

RakuDoc instructions have three basic forms

RakuDoc v2 distinguishes between code oriented and text oriented perspectives. I do not think this needs to carry into the API.

RakuDoc v2 clearly distinguishes between

finanalyst commented 9 months ago

My proposal would be for:

Currently, RakuAST provides a RakuAST::Doc::DeclaratorTarget node for the declarator blocks, which is consistent with the code/text distinction.

If this code/text distinction is carried through to the API, then there should be separate nodes for the =finished directive and =data block.

lizmat commented 3 months ago

Closing, since the discussion is in now in https://github.com/Raku/RakuDoc-GAMMA . Please re-open if you disagree.