You can use either the "href" or "data-doc-document_url" attributes to supply the URL and either the "title" or "data-doc-name" attributes for the name. The data attributes will always override standard attributes.

Setting default user_credentials

Default user_credentials can be set via this method...

$.fn.docraptor["user_credentials"] = 'XXXXX-USER-CREDENTIALS';

This will allow you to use doc_raptor without providing the user_credentials multiple times. Setting up elements to use doc_raptor could be as simple as this...

$(".whatever").docraptor();

Setting a default domain

DocRaptor needs to know the full URL of the document it is to convert. However, you may be dealing with dev, staging and production servers, so it can be problematic and redundant to include the full URL. Setting a default domain allows you to provide only file names.

If a specific link needs to use an alternative URL, simply provide the full URL; the default will be overridden for that instance.

Example: Automatic Defaults for Testing and Production

You will likely be running DocRaptor in test mode in development. It can be convenient to set some defaults that automatically change based upon your development, staging and production environments.

In the example below the domain is detected. With this default, DocRaptor will run in test mode unless requested from the production domain. This will also allow you to provide only file names in your links (see "Setting a default domain" above) across multiple locations.