-
Notifications
You must be signed in to change notification settings - Fork 33
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
Syntax highlighting using shebang only? #203
Comments
One could likely implement content sniffing on the first line, but I think you can solve it this way: |
I modified my copy of the code to do this. It currently works with enscript only, but I can look at the other markup language too. My solution is pretty inefficient since I don't really know the code base; just one function that does an svn cat, grabs first line, and checks if it is a shebang. All my code recently has been on my own projects (http://svn.dailydata.net), and not real clear on what I should do with the code. If someone will point me to instructions, I'll be happy to upload and/or if you want it extended to the other one (don't remember name), I'll see what I can do. Following is a diff using diff svnlook.php svnlook.php.original `
|
Add a readable patch please |
I'd love to. Just don't know how. Can you tell me the command? Sorry, I've never submitted to another project before, and mine are so focused on specific areas I've never gotten a patch. |
You can attach a patch file. |
figured it out. found bug. Perl allows #! /usr/bin/perl -w (very old school). Will fix bug, then send patch. |
It would not accept a filename with .diff, so I renamed it to .txt. I've run some tests but, if you see any problems, let me know and I'll fix them. Also, have an idea for syntax highlighting php using the php built in's. Rod |
Your patch isn't bad after all, I will get back to this next week. |
Went through the patch and the current code. There are a few issues here:
|
I wonder, is it possible to have syntax highlighting based on the shebang of a file, or is the content not known at the time Geshi/Enscript is initialized?
Examples where Syntax highlighting would be very nice:
https://svn.viathinksoft.com/websvn/filedetails.php?repname=oidplus&path=%2Ftrunk%2Fdev%2Fgenerate_example_data_access
https://svn.viathinksoft.com/websvn/filedetails.php?repname=oidplus&path=%2Ftrunk%2Fdev%2Fgenerate_wellknown_other_mysql
The text was updated successfully, but these errors were encountered: