Skip to content

Commit

Permalink
Fix treesitter formatting of inlines.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchisnall committed Jan 30, 2025
1 parent 8dd9339 commit a4444e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lua/ts-inlines.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
function process(textTree)
local builder = LuaTextBuilder.new()
local luaBuilder = LuaTextBuilder.new()
local regoBuilder = RegoTextBuilder.new()
textTree:match("lua", function(lua)
return {TextTree.new("code"):take_children(builder:process_string(lua:text(), ""))}
return luaBuilder:process_string(lua:text(), ""):extract_children()
end)
textTree:match("rego", function(lua)
return {TextTree.new("code"):take_children(builder:process_string(lua:text(), ""))}
textTree:match("rego", function(rego)
return regoBuilder:process_string(rego:text(), ""):extract_children()
end)
return textTree
end
3 changes: 3 additions & 0 deletions text/book.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ span.library,
span.compartment,
span.lua
{
font-size: 0.8rem;
font-family: "Source Code Pro", monospace;
}

span.command
{
font-weight: bold;
Expand Down Expand Up @@ -260,6 +262,7 @@ span.listing-origin:after

span.code
{
font-size: 0.8rem;
font: SourceCodePro;
font-family: monospace;
}
Expand Down

0 comments on commit a4444e6

Please sign in to comment.