Re: [Orgmode] Blorgit SVN integration
Hi Eric, Thanks for the patch. I got it working and pushed up the change to the blorgit git repository. That's cool! Thanks for that! Now all we need is an interface for reviewing/reverting previous commits, and individual username/passwords and blorgit will be a full fledged wiki! :) I was about to tell you the exact same things... :-) F. ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Blorgit SVN integration
Hi Francesco, Thanks for the patch. I got it working and pushed up the change to the blorgit git repository. Now all we need is an interface for reviewing/reverting previous commits, and individual username/passwords and blorgit will be a full fledged wiki! :) Thanks -- Eric Francesco Pizzolante f...@missioncriticalit.com writes: Hi Eric, One little question: is it possible to add a comment field when editing a file through the web interface and use that comment as the log when checking in the file in the repository? That behavior is not currently part of blorgit, but it shouldn't be hard to add. See lines 241 through 247 of blorgit.rb which are responsible for rendering the edit page. It shouldn't be hard to add a comment field, and then later access that field when committing to SVN/GIT. I've added a text input in the UI: diff --git a/blorgit.rb b/blorgit.rb index 93bea47..c7e4a92 100644 --- a/blorgit.rb +++ b/blorgit.rb @@ -245,6 +245,8 @@ __END__ %form{ :action = path_for(@blog), :method = :post, :id = :comment_form } %textarea{ :id = :body, :name = :body, :rows = 28, :cols = 82 }= @blog.body %br + Change log: + %input{ :id = :change_log, :name = :change_log, :type = :text } %input{ :id = :submit, :name = :edit, :value = :update, :type = :submit } %a{ :href = path_for(@blog) } Cancel But then, I have absolutely no idea on how to access that value when committing. It should be something like this: diff --git a/backend/blog.rb b/backend/blog.rb index 827ec05..555f12c 100644 --- a/backend/blog.rb +++ b/backend/blog.rb @@ -26,7 +26,7 @@ class Blog ActiveFile::Base index: index def after_savee Dir.chdir(Blog.base_directory) do -%x{svn add #{self.path} svn ci -m #{self.path} updated through the web interface #{self.path}} +%x{svn add #{self.path} svn ci -m #{self.path} updated through the web interface: #{self.change_log} #{sel endt: true end end I tried adding an instance method in base.rb but didn't manage to make it work. A little help would be welcome. Thanks a lot, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Blorgit SVN integration
Hi Eric, One little question: is it possible to add a comment field when editing a file through the web interface and use that comment as the log when checking in the file in the repository? That behavior is not currently part of blorgit, but it shouldn't be hard to add. See lines 241 through 247 of blorgit.rb which are responsible for rendering the edit page. It shouldn't be hard to add a comment field, and then later access that field when committing to SVN/GIT. I've added a text input in the UI: --8---cut here---start-8--- diff --git a/blorgit.rb b/blorgit.rb index 93bea47..c7e4a92 100644 --- a/blorgit.rb +++ b/blorgit.rb @@ -245,6 +245,8 @@ __END__ %form{ :action = path_for(@blog), :method = :post, :id = :comment_form } %textarea{ :id = :body, :name = :body, :rows = 28, :cols = 82 }= @blog.body %br + Change log: + %input{ :id = :change_log, :name = :change_log, :type = :text } %input{ :id = :submit, :name = :edit, :value = :update, :type = :submit } %a{ :href = path_for(@blog) } Cancel --8---cut here---end---8--- But then, I have absolutely no idea on how to access that value when committing. It should be something like this: --8---cut here---start-8--- diff --git a/backend/blog.rb b/backend/blog.rb index 827ec05..555f12c 100644 --- a/backend/blog.rb +++ b/backend/blog.rb @@ -26,7 +26,7 @@ class Blog ActiveFile::Base index: index def after_savee Dir.chdir(Blog.base_directory) do -%x{svn add #{self.path} svn ci -m #{self.path} updated through the web interface #{self.path}} +%x{svn add #{self.path} svn ci -m #{self.path} updated through the web interface: #{self.change_log} #{sel endt: true end end --8---cut here---end---8--- I tried adding an instance method in base.rb but didn't manage to make it work. A little help would be welcome. Thanks a lot, Francesco ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Blorgit SVN integration
Francesco Pizzolante f...@missioncriticalit.com writes: Hi Eric, 1) Is it possible to integrate Blorgit with SVN instead of git? If yes, how can I do it? This is what I've added to blog.rb: diff --git a/backend/blog.rb b/backend/blog.rb index 0f43728..827ec05 100644 [...] Thanks, that patch looks great. If you don't mind I'd like to apply the patch to the blorgit git repository on github. Do you have a github user name patch which I can use for patch authorship, or could I just use your name and email address? Of course, I'll be happy to contribute. I just created a fresh account on github (user name: fpz). Is this that you need? If not, you can use my name but prefer this email address: francesco.pizzola...@gmail.com. Thanks. That's great, look forward to seeing what else you come up with Thanks -- Eric ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Blorgit SVN integration
Hi Eric, First of all, I thank you very much for your useful tips. Thanks to you, I think I've made a step forward. Here's how. 1) Is it possible to integrate Blorgit with SVN instead of git? If yes, how can I do it? Yes, it should be possible to use any version control backend, the only command that will not work with svn is the option to automatically commit any edits to the git repository, however changing this command should be straightforward. You should just have to make a change in backend/blog.rb line 15. This is what I've added to blog.rb: --8---cut here---start-8--- diff --git a/backend/blog.rb b/backend/blog.rb index 0f43728..827ec05 100644 --- a/backend/blog.rb +++ b/backend/blog.rb @@ -17,6 +17,20 @@ class Blog ActiveFile::Base end end + # if the svn_commit option is set then add a hook to automatically + # commit any changes from the web interface to svn. + if $global_config[:config]['svn_commit'] +puts adding svn commit hooks Blog.after_save + +add_hooks(:save) + +def after_save + Dir.chdir(Blog.base_directory) do +%x{svn add #{self.path} svn ci -m #{self.path} updated through the web interface #{self.path}} + end +end + end + def self.files(path) base = (File.directory?(self.expand(path)) ? self.expand(path) : File.dirname(self.expand(path))) self.entries(path). --8---cut here---end---8--- You simply need to add the svn_commit: true options to the blorgit.yml config file and make your blogs directory a SVN working copy for this to work. I do a svn add (in case this is a new file) followed by an svn commit. This works very well. One little question: is it possible to add a comment field when editing a file through the web interface and use that comment as the log when checking in the file in the repository? 2) If I have comments in an org file, as soon as I edit the file through the web interface, the comments disappear (they're still present as * COMMENT lines in the org file though, but no longer displayed in the browser). Hmm, not sure about that, are you sure that you are creating the comment outline headings exactly how they are created when blorgit adds them through the web interface? Well, the comments were added by the web interface itself (the org file was completely edited by the web interface) and were correctly displayed as soon as you add them. But then, they disappeared once you edited the page. When looking at the org file, the comments were still there but no longer displayed through the web interface. But, this issue went away from the moment I created a brand new blogs folder. I cannot reproduce it. I don't have any more details about this for the moment. I will come back to you with more details if needed. Thanks for your help. 3) I would like to add a .pdf link (next to edit .org .tex) in order to download the PDF coming from the compilation (pdflatex) of the .tex file. Is it possible? Yes, this should certainly be possible (and please let me know if you succeed and I would like to add that change to the main repo). See line 70 in backend/acts_as_org/lib/acts_as_org.rb, it should be fairly straight forward to create a to_pdf command similar to the to_tex command defined therein. Here's what I did for this. First I added the .pdf link: --8---cut here---start-8--- diff --git a/blorgit.rb b/blorgit.rb index 077b5d9..93bea47 100644 --- a/blorgit.rb +++ b/blorgit.rb @@ -197,6 +197,8 @@ __END__ %a{ :href = path_for(@blog, :format = 'org'), :title = 'download as org-mode' } .org %li %a{ :href = path_for(@blog, :format = 'tex'), :title = 'download as LaTeX' } .tex + %li +%a{ :href = path_for(@blog, :format = 'pdf'), :title = 'download as PDF' } .pdf #title_separator @@ sidebar : --8---cut here---end---8--- I had to remove the first dot in the exported filenames as pdflatex doesn't like it: --8---cut here---start-8--- diff --git a/Rakefile b/Rakefile index 7c6d202..129b952 100644 --- a/Rakefile +++ b/Rakefile @@ -13,7 +13,7 @@ end Dir[File.join(File.dirname(__FILE__), themes, *, *.rake)].each { |ext| load ext } # handle exported files -def all_exported(dir) Dir.chdir($blogs){ Dir['**/.exported_*'].each{ |path| yield(path) } } end +def all_exported(dir) Dir.chdir($blogs){ Dir['**/exported_*'].each{ |path| yield(path) } } end namespace :exported do desc list all temporary exported files task :list do diff --git a/elisp/org-interaction.el b/elisp/org-interaction.el index 2311156..78373df 100644 --- a/elisp/org-interaction.el +++ b/elisp/org-interaction.el @@ -23,7 +23,7 @@ evaluating BODY. (kill-buffer ,temp-file) ,temp-result))) -(defvar org-interaction-prefix .exported_) +(defvar org-interaction-prefix
Re: [Orgmode] Blorgit SVN integration
Hi Francesco, I have comments in-line below. Francesco Pizzolante f...@missioncriticalit.com writes: Hi Eric, First of all, I thank you very much for your useful tips. Thanks to you, I think I've made a step forward. Here's how. 1) Is it possible to integrate Blorgit with SVN instead of git? If yes, how can I do it? Yes, it should be possible to use any version control backend, the only command that will not work with svn is the option to automatically commit any edits to the git repository, however changing this command should be straightforward. You should just have to make a change in backend/blog.rb line 15. This is what I've added to blog.rb: diff --git a/backend/blog.rb b/backend/blog.rb index 0f43728..827ec05 100644 --- a/backend/blog.rb +++ b/backend/blog.rb @@ -17,6 +17,20 @@ class Blog ActiveFile::Base end end + # if the svn_commit option is set then add a hook to automatically + # commit any changes from the web interface to svn. + if $global_config[:config]['svn_commit'] +puts adding svn commit hooks Blog.after_save + +add_hooks(:save) + +def after_save + Dir.chdir(Blog.base_directory) do +%x{svn add #{self.path} svn ci -m #{self.path} updated through the web interface #{self.path}} + end +end + end + def self.files(path) base = (File.directory?(self.expand(path)) ? self.expand(path) : File.dirname(self.expand(path))) self.entries(path). You simply need to add the svn_commit: true options to the blorgit.yml config file and make your blogs directory a SVN working copy for this to work. I do a svn add (in case this is a new file) followed by an svn commit. This works very well. Thanks, that patch looks great. If you don't mind I'd like to apply the patch to the blorgit git repository on github. Do you have a github user name patch which I can use for patch authorship, or could I just use your name and email address? One little question: is it possible to add a comment field when editing a file through the web interface and use that comment as the log when checking in the file in the repository? That behavior is not currently part of blorgit, but it shouldn't be hard to add. See lines 241 through 247 of blorgit.rb which are responsible for rendering the edit page. It shouldn't be hard to add a comment field, and then later access that field when committing to SVN/GIT. 2) If I have comments in an org file, as soon as I edit the file through the web interface, the comments disappear (they're still present as * COMMENT lines in the org file though, but no longer displayed in the browser). Hmm, not sure about that, are you sure that you are creating the comment outline headings exactly how they are created when blorgit adds them through the web interface? Well, the comments were added by the web interface itself (the org file was completely edited by the web interface) and were correctly displayed as soon as you add them. But then, they disappeared once you edited the page. When looking at the org file, the comments were still there but no longer displayed through the web interface. But, this issue went away from the moment I created a brand new blogs folder. I cannot reproduce it. I don't have any more details about this for the moment. I will come back to you with more details if needed. Thanks for your help. fair enough :) 3) I would like to add a .pdf link (next to edit .org .tex) in order to download the PDF coming from the compilation (pdflatex) of the .tex file. Is it possible? Yes, this should certainly be possible (and please let me know if you succeed and I would like to add that change to the main repo). See line 70 in backend/acts_as_org/lib/acts_as_org.rb, it should be fairly straight forward to create a to_pdf command similar to the to_tex command defined therein. Here's what I did for this. First I added the .pdf link: diff --git a/blorgit.rb b/blorgit.rb index 077b5d9..93bea47 100644 --- a/blorgit.rb +++ b/blorgit.rb @@ -197,6 +197,8 @@ __END__ %a{ :href = path_for(@blog, :format = 'org'), :title = 'download as org-mode' } .org %li %a{ :href = path_for(@blog, :format = 'tex'), :title = 'download as LaTeX' } .tex + %li +%a{ :href = path_for(@blog, :format = 'pdf'), :title = 'download as PDF' } .pdf #title_separator @@ sidebar : I had to remove the first dot in the exported filenames as pdflatex doesn't like it: diff --git a/Rakefile b/Rakefile index 7c6d202..129b952 100644 --- a/Rakefile +++ b/Rakefile @@ -13,7 +13,7 @@ end Dir[File.join(File.dirname(__FILE__), themes, *, *.rake)].each { |ext| load ext } # handle exported files -def all_exported(dir) Dir.chdir($blogs){ Dir['**/.exported_*'].each{ |path| yield(path) } } end +def all_exported(dir) Dir.chdir($blogs){ Dir['**/exported_*'].each{ |path| yield(path) } } end
Re: [Orgmode] Blorgit SVN integration
Francesco Pizzolante f...@missioncriticalit.com writes: Hi, I've started playing with Blorgit and it really looks very promising... I have a few questions: 1) Is it possible to integrate Blorgit with SVN instead of git? If yes, how can I do it? Yes, it should be possible to use any version control backend, the only command that will not work with svn is the option to automatically commit any edits to the git repository, however changing this command should be straightforward. You should just have to make a change in backend/blog.rb line 15. 2) If I have comments in an org file, as soon as I edit the file through the web interface, the comments disappear (they're still present as * COMMENT lines in the org file though, but no longer displayed in the browser). Hmm, not sure about that, are you sure that you are creating the comment outline headings exactly how they are created when blorgit adds them through the web interface? 3) I would like to add a .pdf link (next to edit .org .tex) in order to download the PDF coming from the compilation (pdflatex) of the .tex file. Is it possible? Yes, this should certainly be possible (and please let me know if you succeed and I would like to add that change to the main repo). See line 70 in backend/acts_as_org/lib/acts_as_org.rb, it should be fairly straight forward to create a to_pdf command similar to the to_tex command defined therein. 4) Is it possible to add a button in order to create a new file directly from the web interface? Yes, with the edit-able option set to true, you will just need to type the path to the new file as a url into your web browser. If blorgit can't find a file there it will offer to let you create one. Many thanks in advance for your help! Hope it works well for you. Best of luck -- Eric F. ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode