Lexpedite / blawx

A user-friendly web-based tool for Rules as Code.
MIT License
100 stars 9 forks source link

Make it possible to sub-divide text for defeasibility purposes. #192

Closed Gauntlet173 closed 2 years ago

Gauntlet173 commented 2 years ago

Legislative text will often contain defaults and exceptions, and other parts and sub-parts that it is useful for testing purposes to be able to identify separately, inside an undivided paragraph of text.

We need a way of being able to divide that text into named pieces, and adding those named pieces to the interface in a way consistent with how the divisions of legislation are used. This means either making changes in the code editor to allow people to create sub-names associated with outside blocks, or some way of enhancing the CLEAN tool to allow for arbitrarily deeply nested named hierarchical elements inside paragraphs. The former complicates the interface. The latter might be difficult to do in a way that is LegalDocML compliant.

Gauntlet173 commented 2 years ago

It seems like the logical place to do this is in the rule editor, not the code editor, and to re-use the analogies we already have in the interface. The challenge there is representing it inside AkomaNtoso in a standards-compliant way. Because in Akoma Ntoso we need to be able to sub-divide paragraphs, it seems like the compliant way to do that is with nested elements, which AN allows to carry eId attributes.

So we would need to modify CLEAN to be able to allow you to specify spans inside a block of text, with a name, recursively.

Then we would need to modify Blawx to use spans in addition to hierarchical elements when generating the navigation tree. the selectors would need to be placed inline with the text, because the

elements will be mixed-mode.

Then we would need to update the known sections drawer to use spans.

Gauntlet173 commented 2 years ago

Required changes have been made in Clean v0.0.2. Started the add_spans branch to implement.

Gauntlet173 commented 2 years ago

Known sections drawer should work fine, as long as the lawspan class is applied to the span elements. The only required changes are to the parse_an.py file.

Gauntlet173 commented 2 years ago

There was a problem with spans at the start of a line that was solved in clean 0.0.3. The tree is now being generated based on all the relevant spans.

Gauntlet173 commented 2 years ago

I have the known sections drawer loading properly. Next is the selecting spans part.

Gauntlet173 commented 2 years ago

Problem with the dropdowns is solved by making only the arrows clickable. Next is the span naming.

Gauntlet173 commented 2 years ago

Span naming is fixed by using clean 0.0.4 in add_spans.

Gauntlet173 commented 2 years ago

CSS is fixed. Going to leave demos until after the integration with legal text is working.