gEdit Browser Preview plugin
Wednesday, 14. November 2007, 20:56:01
On my way bringing SweeTS - delicious TypoScript development to Linux, i wrote another plugin called "Browser Preview". This plugin showing the current webpage you are editing in gEdit directly in Firefox, Opera, Midori or Konquerer and the Internet Explorer 6. This plugin is completely localized in german and english.
How it works:
* you have to install all the browsers on your system
* Internet Explorer 6 support is done by IEs4Linux in standard configuration and includes path converting
* Copy the files browser.gedit-plugin and browser.py into ~/.gnome2/gedit/plugins
* Start gEdit and enable the plugin "Browser Preview" in the preferences
* After a restart the plugin appears in the View menu
* Assign the typical shortcuts "F12", "Ctrl+F12" etc. to the different Browsers in the menu
Download:
http://files.myopera.com/area42/files/gedit_browser_plugin.zip
gEdit plugins i wrote too:
http://my.opera.com/area42/blog/gedit-language-reference-plugin
http://my.opera.com/area42/blog/gedit-template-plugin
A lot of other gEdit plugins can be found here.
How it works:
* you have to install all the browsers on your system
* Internet Explorer 6 support is done by IEs4Linux in standard configuration and includes path converting
* Copy the files browser.gedit-plugin and browser.py into ~/.gnome2/gedit/plugins
* Start gEdit and enable the plugin "Browser Preview" in the preferences
* After a restart the plugin appears in the View menu
* Assign the typical shortcuts "F12", "Ctrl+F12" etc. to the different Browsers in the menu
Download:
http://files.myopera.com/area42/files/gedit_browser_plugin.zip
gEdit plugins i wrote too:
http://my.opera.com/area42/blog/gedit-language-reference-plugin
http://my.opera.com/area42/blog/gedit-template-plugin
A lot of other gEdit plugins can be found here.


Thanks, usefull plugin!
But...
...is not possible realtime preview like textmate?
By anonymous user, # 17. April 2008, 10:33:00
Nice idea but then i have to add a panel and there i have to integrate webkit or gecko and then i have to build a pip for realtime changes - huh man that's very hard ro code
By area42, # 17. April 2008, 11:01:38
the link is broken, it points to the reference plugin
By anonymous user, # 20. May 2008, 01:44:33
thanx, fixed.
By area42, # 20. May 2008, 07:59:15
How do I set up shortcuts for each browser?
Thanks
By anonymous user, # 23. May 2008, 17:32:21
By area42, # 23. May 2008, 17:54:23
How do I enable dynamic shortcuts? I can't seem to get it to work?
By anonymous user, # 24. May 2008, 20:05:52
http://blogs.gnome.org/thos/files/2007/05/Screenshot-Appearance%20Preferences-4.png
Activate the checkbox "Editable ..."
By area42, # 25. May 2008, 11:07:19
very good thank you. works great
By anonymous user, # 25. May 2008, 15:13:14
Thank you so much for your great plugin.
Under firefox, i refresh automatically the tabs with "tab mix plus,
and if gedit was able of having an autosave feature for each modification to the document (gedit would be like the excellent textmate with its best feature "autopreview function".
Or maybe is it possible to choose an autosave period much shorter (because 1 minute... is not like real time
Do you know a way for this?
Thank you
By anonymous user, # 15. June 2008, 00:46:04
About Autosave, there is no way using secounds. I tried modify it using gconf but its defined as an integer. May something for the bug tracker > Feature request
Here are two other tips about gEdit:
add to "/apps/gedit-2/preferences/editor/save" at the key "writable_vfs_schemes" the entry "ftp" to allow ftp connection from gEdit.
set "max_recents" at "/apps/gedit-2/preferences/ui/recents" up 15 to get a longer list of rescent opened files.
Happy computing
By area42, # 15. June 2008, 08:59:32
Thank you for the tips.
My .gconf/apps/gedit-2/preferences/editor/save/%gconf.xml
Is now like that :
<?xml version="1.0"?>
<gconf>
<entry name="writable_vfs_schemes" mtime="1213546043" type="list" ltype="string">
<li type="string">
<stringvalue>ssh</stringvalue>
<li type="string">
<stringvalue>sftp</stringvalue>
<li type="string">
<stringvalue>smb</stringvalue>
<li type="string">
<stringvalue>dav</stringvalue>
<li type="string">
<stringvalue>davs</stringvalue>
<li type="string">
<stringvalue>ftp</stringvalue>
</entry>
<entry name="create_backup_copy" mtime="1213490459" type="bool" value="true">
</entry>
<entry name="auto_save_interval" mtime="1213546351" type="int" value="1">
</entry>
<entry name="auto_save" mtime="1213490459" type="bool" value="false">
</entry>
</gconf>
And... It's greeat
By anonymous user, # 15. June 2008, 16:15:58
So you have to install all of the browsers, even if you won't use all of them? I followed the instructions (except for installing all of the browsers), but nothing happens when I click View > View in > Firefox or when I press F9 (the shortcut I assigned to Firefox). Also, does this plugin display the given file within a browser embedded in Gedit, or does it simply display the given file in a regular, separate browser window?
By anonymous user, # 23. September 2008, 01:54:24
thanks for your feedback. First of all you must not have all these browsers installed. The plugins calls a browser and did not embed it in the bottom panel. There is another plugin that tried that (but just one browser).
What is the output when you start gEdit via the shell? Is there any error message?
By area42, # 23. September 2008, 20:37:59
Sorry for the late reply--yes, the following is output when I try to view in Firefox (I do not have the other browsers installed):
Traceback (most recent call last):
File "/home/chris/.gnome2/gedit/plugins/browser.py", line 93, in <lambda>
lambda a: self._plugin.on_browser_activate(self._window)),
File "/home/chris/.gnome2/gedit/plugins/browser.py", line 151, in on_browser_activate
parts = string.split(url,"//")
File "/usr/lib/python2.5/string.py", line 290, in split
return s.split(sep, maxsplit)
AttributeError: 'NoneType' object has no attribute 'split'
By anonymous user, # 27. September 2008, 00:12:04
thanks for the trace, i will try to debug it.
By area42, # 27. September 2008, 19:35:01