1

I am writing documentation using Pandoc, with a view to having it be viewed in HTML eventually on my web site. During development I want to test how the results look locally, so I have a build command set up in Geany like this:

pandoc --toc --smart --standalone %f -o %e.htm && firefox %e.htm

This all works fine, except that every time I hit the function key to run this, a new tab opens in Firefox, and eventually I have lots of them with older versions of my test document.

My question ...

Can I make Firefox reopen (or reload) a particular tab, from the command line?


Environment:

  • Ubuntu 14.04
  • Firefox 39.0
  • pandoc 1.13.2.1
  • geany 1.23.1
Nick Gammon
  • 483
  • 1
  • 3
  • 12
  • Close the old tab when you are finished with it? – waltinator Jul 29 '15 at 04:22
  • I'm not sure when I'm finished with it. I review the rendered output, change the markup, review, change etc. Finally I re-test. My point is that the "I'm finished with it" moment is not an easy decision to make. Sure, it's a couple of keystrokes to go back to the older tab and close it, but aren't computers supposed to save us effort? Having said that, certainly that is my current workflow. :) – Nick Gammon Jul 29 '15 at 04:35

2 Answers2

1

Maybe you should add a new Firefox profile, eg with the name development, for the following solution and start this profile (via -P development) for your development process.

With this profile open about:config and search for browser.link.open_newwindow.

Change the value to 1 to open links that would normally open in a new tab in the current tab.

Source

A.B.
  • 89,123
  • 21
  • 245
  • 323
  • 1
    Just to expand on this solution, which worked perfectly (thanks!) - I added `-P foo` to my command to open Firefox which opens the profile `foo`. With that profile open I did as suggested, and all seems to be well. – Nick Gammon Jul 29 '15 at 05:15
0

If you don't need to use Firefox, you could also use the WebHelper plugin. It adds an minimal browser widget based on WebKit to Geany and can e.g. reload the page when saving the document. It's quiet handy on hacking CSS for a webapplication or other HTML related stuff.

frlan
  • 1,030
  • 5
  • 17