Open finanalyst opened 9 months ago
My proposal would be for:
RakuAST::Doc::Directive
node
name
field/attribute would be the directive namemeta
would contain any metadata option associated with the directiveobject
would contain the first argumentpredicate
would contain the second oneRakuAST::Doc::Markup
)RakuAST::Doc::Block
node
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.
Closing, since the discussion is in now in https://github.com/Raku/RakuDoc-GAMMA . Please re-open if you disagree.
Revise the compiler output (API?) for RakuDoc instructions.
Currently Rakudo produces a tree of
Pod::Block
s, 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 proposeSince 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):Pod::Block::Code
Pod::Block::Input
-- since v2023.04Pod::Block::Output
-- since v2023.04Pod::Block::Comment
Pod::Block::Declarator
Pod::Block::Named
Pod::Block::Para
Pod::Block::Table
Pod::Defn
Pod::Heading
Pod::Item
Pod::Raw
Pod::Config
Pod::FormattingCode
These are not consistent because=defn
,=head
,=item
,=config
are all described by RakuDoc v1 as blocks. There is no description ofPod::Raw
.RakuDoc instructions have three basic forms
=xxx
(extended to=for xxx
and=begin xxx
/=end xxx
-- these are called blocks or directivesL< ... >
where L is a unicode codepoint with Upper property -- these are called FormattingCodes#|
or#=
-- these are called declarator blocks.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
=
but do not have the=for
or=begin/end
form=
and have=for
and=begin/end
forms and three types are defined: