-
Notifications
You must be signed in to change notification settings - Fork 1
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
How to signal customisation #15
Comments
The A generic renderer processor handles the RakuDoc source, and each RakuDoc instruction is handled using templates. The templates define how the source for each block is formatted into the output. The renderer for a particular output, eg. HTML, generates an instance of the generic processor, then attaches templates to the processor, then passes the RakuAST rakudoc statement list to the processor. Customisation can be handled by attaching templates for customisations to the processor instance. If the terminal invocation is used, eg
A programmatic implementation for an HTML file would be
The question is where to find the information for a custom block. If the information is in a 'DOC use' statement, then the |
I finally got a couple of minutes on this.
Ignored. Here is the point: it is only the compiler which can handle all of a language. No IDE could do it without compiler support.
Here I just repeat what we discussed earlier in person: any
A rendered, apparently, knows nothing about document source. It deals with RakuAST where block representation depends on the parser in first place. If a Slightly different case is if the block gets some special representation in the AST. In this case it is up to the renderer to decide how to handle it and where to get the necessary modules or whatever it takes to render the block correctly. Say, a config file would do. On the documentation creator side they may leave a note in distribution README about recommended renderer, modules, etc. needed to produce best expected output. The parser module from It is also up to the renderer to chose how to manage unknown/unsupported AST nodes. Simply skip; or insert as verbatims; or die. To sum up, my point remains the same: we must clearly separate parsing from rendering with no way for a RakuDOC document to be in charge of its own rendering. It may provide hints by setting configuration values that can be understood by renderers. Or even be specific to a particular renderer. But they would remain nothing more but hints. |
@vrurg I understand your points, but it takes a bit of re-reading.
Currently, RakuDoc v2 specifies that if a Renderer does not recognise a custom block, then it does a minimal renderering and issues an error message How does the developer, who will only use RakuAST::Render for her own purposes? Current strategy with
|
I'd rather be a config file zealot where customizations are explicitly mentioned. There are ways how to do it, like referring to installed module names; or, for totally private projects – paths to customization distributions, like Overall, most used scenario is likely to be the one where a distro developer provides their own rendering. It could be available through managers like But, at the same time, raku.land, for example, may use their own rendering with their own configs for producing unified look for all docs. This is where the problem of different customizations could hurt. But it's not unsolvable. |
@vrurg Where would the config file be placed? In the same directory as the One of my goals is to create a web-site served locally that shows all of the documentation of all the modules installed locally. If as in Problem-solving 393 the module developer can place documentation in arbitrary places, where would the config file be? |
To me this is a technical detail. Let's say, a project provides their own local config or configs in project's root, a typical setup. The question is how the renderer, you're going to use to produce your local site, takes these configs into account? Or doesn't take, if necessary. I'm not ready to get into these details right now, and they'd be mostly off-topic here anyway. Out of the box I foresee a couple of technical problems to be resolved. But it is barely possible to be prepared for all of them anyway. |
Summarising before closing:
Closing issue as resolved |
Intro
=LeaflletMap
, which exposes the Leaflet js library for maps.M<pay here|PayPal; user-token;product-info>
DOC use XXX
, where XXX is a module. The currentRakuAST
compiler triggers an error whenDOC use ...
is encountered.How should customisation be signalled to the renderer?
Problems
DOC use
is included, then where is it used? Consider:This indicates that code from
Some::Module
needs to be executedSome::Module
is not a part of the RakuDoc sourceDOC use
to be interpretted by eg Podlite, which is not Raku based?Some::Module
related to the way in which the AST is created, or the way in which the AST data structures are rendered?To keep the issue separate from the plan for
RakuDoc::Render
, I'll outline the plan for the Renderer below.Thoughts? @thoughtstream @codesections @vrurg @lizmat @zag
The text was updated successfully, but these errors were encountered: