Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sometimes I want to develop WordPress themes when I have no internet connection. I need the Function Reference and Template Tags to be productive.

I searched for a downloadable or SVN copy of the Codex but could not find one. I ended up trying to mirror it using wget, but the results were spotty (it's too huge!).

Is there a better way?

share|improve this question
    
Get an iPad with 3G access? ;-) –  MikeSchinkel Aug 12 '10 at 17:05

7 Answers 7

up vote 14 down vote accepted
+100

I Use a much faster and easier way to create a local copy of the codex without installing a local server and without installing copy of mediawiki, its called ScrapBook which is a Firefox extension, that helps you to save Web pages and manage the collection. Key features are lightness, speed, accuracy and multi-language support.

using it's Save Web site (In-depth Capture)feature you can set the directories you want to save , which in your case would be Function Reference and Template Tags

enter image description here

you can also organize your collections just like bookmarks, edit saved files and highlight key parts of pages and the best thing about it is the built in full text search.

share|improve this answer
    
This is pretty great. Is there a way to feed it a list of urls to capture for later viewing? And is there a way to say "go refresh this list of urls"? –  artlung Mar 13 '12 at 22:57
    
Yes and as for refreshing I'm not sure yet. –  Bainternet Mar 13 '12 at 23:39
    
Just tried it and it has a capture again feature. –  Bainternet Mar 13 '12 at 23:46
    
This is a great lightweight way to quickly save a large group of files. I was hoping for self-contained, but I've been testing this since I opened the bounty and this is the easiest quickest way to get a local copy of the relevant docs. –  artlung Mar 16 '12 at 0:21
    
Is there any way to search the pages you've saved? –  Tom Dworzanski Aug 1 at 0:16

I did this for myself using HTTrack (http://www.httrack.com/). It wound up being a handful of megabytes (not sure of the exact number now, I lost my local copy to a hard drive failure, and haven't bothered to rebuild it yet), but it worked pretty well.

share|improve this answer
    
:-( Man, there has to be a better way. Thanks for the answer though. Hopefully there's something else! –  artlung Aug 12 '10 at 15:16
    
is there anything like this for mac? –  Mild Fuzz Oct 11 '10 at 8:35
    
There's an app called BlueCrab that does something similar, but I can't speak to it's use, as I've never used it. –  Keith S. Oct 12 '10 at 18:33

I think the best thing would be to create bug report and ask the WP foundation to install this extension http://www.mediawiki.org/wiki/Extension:PdfBook If nothing else, mark it for private use and then provide the generated PDF for the users.

share|improve this answer

Cool idea,

There's a few ways to make it "local".

  • You could do a recursive wget on it. This takes a long time. As you mentioned.
  • You could use a screen scraper: http://scraperwiki.com
  • You could write a script that just saves it locally every time you connect to the internet.
  • You could get down right dirty and every time you visit the codex you could just save that to a folder.

In short there's no repository for this at the moment. Although making one would be cool.

Maybe I'll write that...


I'll post back later tonight. I might actually have this done in a little bit.

I'll put it on GitHub.

Update: The MediaWiki answer is how this should really be done.

share|improve this answer

Your best bet is to set up a local copy of MediaWiki. This is the same software that runs Wikipedia, but it's also the application that powers the Codex.

After you've got that installed, you can tell the Codex to export the pages you want and you can import the XML docs into your local installation. It's not automated, but it should give you enough information to work with for quick references.

Get MediaWiki

All of the documentation for downloading, installing, and configuring MediaWiki is available online.

If you can run WordPress locally, you should be able to run MediaWiki locally as well (you need both PHP and MySQL to set things up).

Export the Codex

Make a list of the pages you want to export. I'd love if there were an automated tool to export everything, but in the absence of that let's stick with the manual process.

Navigate to http://codex.wordpress.org/Special:Export. This page lets you mark which pages and categories you want to export.

Lets say you just want to export the Function Reference page. You'd enter "Function_Reference" in the large box for page names. Place one page name per line to export multiple pages at once.

But since that one page isn't very useful ... export the entire Functions category instead. Enter "Functions" in the category box and click add. The Codex will automatically list all 964 function pages for you. Then just add a line for "Function_Reference" so you get the index as well.

Codex with Function Reference pages pre-selected

You can see a list of all available pages at http://codex.wordpress.org/Special:AllPages. The list is quite extensive, so I won't cover it here ... but add every page you want exported anc click away.

Once you've clicked "Export," the Codex will generate a (rather large) XML file containing all of the content.

Import the Codex

Now navigate back to your local MediaWiki installation. You can now import the XML doc and create your local "clone" of the WordPress Codex.

Detailed import instructions are available on MediaWiki's website.

share|improve this answer
4  
Great answer! I just started looking at the MediaWiki API and didn't even realize the Codex had an export. –  Chris_O Mar 10 '12 at 0:17
    
Excellent answer. –  dunc Mar 12 '12 at 18:37

You can use the MediaWiki API. There is complete documentation on how to mirror a wiki using the API and other methods.

share|improve this answer
    
Is it possible to store into a static set of html, or do I need to be running Apache/PHP (or whatever current MediaWiki requirements are) on the target device? The Implementation details lack a simple set of instructions, they instead point to other solutions in various stages of completeness. sciencemedianetwork.org/wiki/… –  artlung Mar 10 '12 at 0:25
    
If you're using it to develop WordPress locally, then you're already running Apache/PHP and meet the requirements to run MediaWiki locally. –  EAMann Mar 10 '12 at 15:57
    
@EAMann actually I know a few folks using IIS but I take your point. I will say again that the instructions linked to lack detail. There's no "recipe" created to actually run the backup. –  artlung Mar 14 '12 at 0:15
    
Running MediaWiki under IIS would be a separate issue entirely. But I see your point. Even on a Windows box, I'd just install XAMPP or a similar solution to run things locally. –  EAMann Mar 14 '12 at 1:13

You can use Dash (OS X) or Zeal (Linux, Windows) applications which have scrape of Codex function reference available as documentation set.

It is easy to install and use, however a little fuzzy how up to date the sets are kept.

share|improve this answer
1  
I'm Dash's developer. I update the WordPress docset each time a new release of WordPress comes out. –  bogdansrc May 13 at 21:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.