You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#90 made almost everything legaldown-render needs public. After adopting 0.3.0, the renderer still imports these from private modules (its validator_bridge.py):
Import
Used for
legaldown.parser.quote_content, MAX_QUOTE_DEPTH
A block quote's content blocks, as the validator reads them. Block holds a quote only as text.
A code block's content and info string, read the way the parser reads a fence.
legaldown.cli._read_answers
Reading an answers file (YAML/JSON) for assemble(), with the same errors as legaldown assemble.
One more gap: a block's line. Since #85, the validator's diagnostics name their line. The renderer's own diagnostics (render-ref-ambiguous, ref-not-enumerated, render-not-processed) can't, because the SourceMap/Locator that finds a block's line is private. PlacedMarker.line covers markers only.
Expose a code block's info string and content, either as Block fields or through one public helper, so a consumer needs no fence helpers.
Export a public read_answers(path).
Give a public way to find the line of a block or a list item in a parsed document. For example: ValidationResult.line_of(section, block, item=None), or line on Block/ListItem.
The drafting-note content (#88) is related; the rest of U3 is done.
Summary
#90 made almost everything
legaldown-renderneeds public. After adopting 0.3.0, the renderer still imports these from private modules (itsvalidator_bridge.py):legaldown.parser.quote_content,MAX_QUOTE_DEPTHBlockholds a quote only as text.legaldown.markdown.FENCE_OPEN_RE,closes_fence,dedent,indent_widthlegaldown.cli._read_answersassemble(), with the same errors aslegaldown assemble.One more gap: a block's line. Since #85, the validator's diagnostics name their line. The renderer's own diagnostics (
render-ref-ambiguous,ref-not-enumerated,render-not-processed) can't, because theSourceMap/Locatorthat finds a block's line is private.PlacedMarker.linecovers markers only.Proposal
quote_contentandMAX_QUOTE_DEPTHfromlegaldown. Better still, give a quote block its content blocks in the model, the way Keep nested list structure in the model and when serializing (#16) #61 did for list items.Blockfields or through one public helper, so a consumer needs no fence helpers.read_answers(path).ValidationResult.line_of(section, block, item=None), orlineonBlock/ListItem.The drafting-note content (#88) is related; the rest of U3 is done.
Found while adopting 0.3.0 in legaldown-render.