Skip to content

Conversation

@Cyberistic
Copy link

@Cyberistic Cyberistic commented Nov 2, 2025

I've found the function should_ignore_comment and have been relying on it to add user comments inside presentations by abusing the <!-- vim: comment here --> since I don't use vim for this anyways.

This isn't clean and a dedicated way to comment should be added IMO. Also, there is an issue with the hacky vim solution above, it adds a newline where the comment should be ignored; fixed by using self.slide_state.ignore_element_line_break = true on ignored comments.

Current comments:
image

PR with ignore line breaks:
image

Copy link
Owner

@mfontanini mfontanini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I've been out for a while and this slipped through. A couple of comments but looks good overall!


// Ignore user comments with Comment: prefix (case-insensitive)
// e.g., <!-- Comment: This is a comment -->
if trimmed_comment.len() >= 8 {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment: case is better handled if you add it to the CommentCommand enum, e.g.

enum CommentCommand {
     // ....
    Comment(String)
}

Which is then ignored in the match that handles this. I also don't think making this case insensitive makes sense here given no other comment command is case insensitive.


Customizability
---
<!-- Comment: You can add comments like this that won't show up in the presentation -->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't touch the demo presentation for this feature. The docs are the ultimate guide, this is just here to show the most commonly used features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants