-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
1,613 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
class AddLineNumbers: | ||
def __init__(self): | ||
self.font_size = 14 | ||
self.padding = 10 | ||
self.line_height = self.font_size + 4 | ||
self.gutter_width = 50 # Width for line numbers | ||
|
||
@classmethod | ||
def INPUT_TYPES(cls): | ||
return { | ||
"required": { | ||
"text": ("STRING", {"multiline": True, "forceInput": True}), | ||
} | ||
} | ||
|
||
RETURN_TYPES = ("STRING",) | ||
FUNCTION = "add_line_numbers" | ||
CATEGORY = "Bjornulf" | ||
|
||
def add_line_numbers(self, text): | ||
lines = text.split('\n') | ||
|
||
# Add line numbers | ||
numbered_lines = [] | ||
for i, line in enumerate(lines, 1): | ||
numbered_lines.append(f"{i:4d} | {line}") | ||
# Join back into a single string | ||
result = '\n'.join(numbered_lines) | ||
|
||
return (result,) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.