Closed seancarroll closed 1 year ago
We recently made a change so that we could support attribute values other than string however []
will likely cause issues with our regex to extract attributes. Even if that wasn't an issue we would have to make additional changes to appropriately convert array into a serde_json::Value::Array
and our currently logic isn't very good. To improve our logic it might make sense us for attributes to be JSON e.g.
{"omit_source_links": true, "selected_lines": ["1", "5-7"]}
While this would be a larger change I think it would improve the overall attribute code related to rendering
We may also want to support a string format e.g. "1,5-7" which we could appropriately parse which would look like the following (assuming we went the JSON attribute configuration route)
{"omit_source_links": true, "selected_lines": "1,5-7"}
Add snippet configuration to allow users to specify which lines of a snippet are rendered. Users should be able to specify a list of lines which include individual lines "1" as well as a range of lines "5-7". An example of what that would look like in a target file would be