From joshua.dunham at gmail.com Thu Apr 25 20:46:30 2013 From: joshua.dunham at gmail.com (Joshua Dunham) Date: Thu, 25 Apr 2013 16:46:30 -0400 Subject: [txmt-dev] Extending LaTeX Bundle with custom google web scrape Message-ID: Hi Everyone, I'm trying to add a bit of functionality to the LaTeX bundle by making a glossary builder that scrapes from google definitions. Essentially what I would like to do is mimic the behavior of the 'Hyperlink Helper' bundle which allows one to select a word and (for instance) do a wikipedia search on the word and have it paste a link into the editor window (only I want some page text). Ideally what I would like to do is grab the definition (or few defs) from the page and paste them into the editor wrapped in glossary syntax. My first stumbling block is that when I try and execute the Hyperlink Helper for any word / macro it returns a "(this language is not supported, see ? for more info)" error message. I've tried using some fancy shell scripting with the 'dict' app (queries dictionaries) but the output is not 100% standardized. Google is a much better resource but a bit more difficult to code for. Could anyone provide insight how to make such an extension to the bundle? -J From mailinglist at textmate.org Sat Apr 27 06:40:51 2013 From: mailinglist at textmate.org (Allan Odgaard) Date: Sat, 27 Apr 2013 13:40:51 +0700 Subject: [txmt-dev] Re: Extending LaTeX Bundle with custom google web scrape In-Reply-To: References: Message-ID: On Apr 26, 2013, at 3:46, Joshua Dunham wrote: > My first stumbling block is that when I try and execute the > Hyperlink Helper for any word / macro it returns a "(this language is > not supported, see ? for more info)" error message. The command reads a TM_LINK_FORMAT variable from the environment which should be an ERb template that has 3 variables: input: The search string. url: The URL found for this search string. title: The URLs title (optional). We set the TM_LINK_FORMAT variable for different scopes corresponding to the syntax of the lanugage, for example for text.html we set it to: ><%= e_sn input %> You can find most of the templates in Hyperlink Helper ? Settings. All that said, it sounds like your desired command cannot be done simply by providing the proper template for LaTeX.