Popular recipes tagged "relative"http://code.activestate.com/recipes/tags/relative/popular/2012-02-24T00:23:09-08:00ActiveState Code RecipesKomodo JS Macro - insert a relative path from the current editor file (JavaScript) 2012-02-24T00:23:09-08:00Todd Whitemanhttp://code.activestate.com/recipes/users/2666241/http://code.activestate.com/recipes/577306-komodo-js-macro-insert-a-relative-path-from-the-cu/ <p style="color: grey"> JavaScript recipe 577306 by <a href="/recipes/users/2666241/">Todd Whiteman</a> (<a href="/recipes/tags/javascript/">javascript</a>, <a href="/recipes/tags/komodo/">komodo</a>, <a href="/recipes/tags/macro/">macro</a>, <a href="/recipes/tags/path/">path</a>, <a href="/recipes/tags/relative/">relative</a>). Revision 3. </p> <p>A <a href="http://www.activestate.com/komodo">Komodo</a> JavaScript macro that can be used to generate a relative path from the current editor file location, which works great for HTML when linking to relative style sheets, images, etc...</p> <p>Upon execution of this macro, you will be prompted to browse and select the target file, then upon selecting the target path, the relative path location will be inserted into the editor at the current position.</p> <p>To best use this macro - assign a custom key-binding to the macro and then trigger the macro at will.</p> Relative path from one directory to another without explicit string functions (unix only) (Python) 2011-04-11T13:02:32-07:00Denis Barmenkovhttp://code.activestate.com/recipes/users/57155/http://code.activestate.com/recipes/577356-relative-path-from-one-directory-to-another-withou/ <p style="color: grey"> Python recipe 577356 by <a href="/recipes/users/57155/">Denis Barmenkov</a> (<a href="/recipes/tags/path/">path</a>, <a href="/recipes/tags/relative/">relative</a>, <a href="/recipes/tags/unix/">unix</a>). Revision 4. </p> <p>I saw a <a href="http://code.activestate.com/recipes/208993/">recipe 208993</a> messed up with os.sep and '../' and decide to write near-pure-Python version. os.sep used in string expressions only for testing for root directory.</p> <p>Function deal with Unix paths (root: "/"), Windows systems are not supported (root: "C:\").</p>