Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easiest way to insert a comment at the beginning of a file? #569

Closed
brexmatt opened this issue Sep 20, 2023 · 3 comments
Closed

Easiest way to insert a comment at the beginning of a file? #569

brexmatt opened this issue Sep 20, 2023 · 3 comments

Comments

@brexmatt
Copy link

No description provided.

@ayushsgithub
Copy link

Screenshot 2023-09-22 122151

The first comment is in Python.
The second comment is in HTML.
The third comment is in CSS.
The fourth comment is in Bash.
The fifth comment is another HTML comment.
The last comment is in Markdown (using an HTML-style comment).

@ElonVolo
Copy link
Collaborator

Putting a comment line at the beginning of the file is probably one of the few cases where I'd just do straight-up concatenation over generating code.

Just open file, read contents into string, and prepend the line to the file's string contents.

I also tried ChatGPT and it generated something convincing.

@brexmatt
Copy link
Author

Putting a comment line at the beginning of the file is probably one of the few cases where I'd just do straight-up concatenation over generating code.

Just open file, read contents into string, and prepend the line to the file's string contents.

I also tried ChatGPT and it generated something convincing.

thanks

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

No branches or pull requests

3 participants