docpadUtil Class
The DocPad Util Class. Collection of DocPad utility methods
Constructor
docpadUtil
()
static
Item Index
Methods
- action
- getBasename
- getDefaultLogLevel
- getDirPath
- getExtension
- getExtensions
- getFilename
- getLocalDocPadExecutable
- getLocalDocPadExecutableExistance
- getOutFilename
- getSlug
- getUrl
- inspect
- isLocalDocPadExecutable
- isStandalone
- isStandardEncoding
- isTravis
- isTTY
- isUser
- startLocalDocPadExecutable
- wait
- writeError
- writeStderr
Methods
action
-
action
-
opts
-
next
Perform an action next(err,...), ... = any special arguments from the action this should be it's own npm module as we also use the concept of actions in a few other packages. Important concept in DocPad.
Parameters:
-
action
Object -
opts
Object -
next
Function
getBasename
-
filename
get a filename without the extension
Parameters:
-
filename
String
Returns:
base name
getDefaultLogLevel
()
Number
private
Get Default Log Level
Returns:
default log level
getDirPath
-
path
Get the directory path. Wrapper around the node.js path.dirname method
Parameters:
-
path
String
Returns:
getExtension
-
extensions
Get the extension from a bunch of extensions
Parameters:
-
extensions
Array
Returns:
the extension
getExtensions
-
filename
Get the extensions of a filename
Parameters:
-
filename
String
Returns:
array of string
getFilename
-
path
Get the file name. Wrapper around the node.js path.basename method
Parameters:
-
path
String
Returns:
getLocalDocPadExecutable
()
String
private
Get Local DocPad Installation Executable - ie not the global installation
Returns:
the path to the local DocPad executable
getLocalDocPadExecutableExistance
()
Boolean
private
Does the local DocPad Installation Exist?
Returns:
getOutFilename
-
basename
-
extension
Get the DocPad out file name
Parameters:
-
basename
String -
extension
String
Returns:
getSlug
-
relativeBase
Get the post slug from the URL
Parameters:
-
relativeBase
String
Returns:
the slug
getUrl
-
relativePath
Get the URL
Parameters:
-
relativePath
String
Returns:
inspect
-
obj
-
opts
Wrapper for the node.js method util.inspect
Parameters:
-
obj
Object -
opts
Object
Returns:
isLocalDocPadExecutable
()
Boolean
private
Is Local DocPad Installation
Returns:
isStandalone
()
Object
private
Is Standadlone
Returns:
isStandardEncoding
-
encoding
Are we using standard encoding?
Parameters:
-
encoding
String
Returns:
isTravis
()
String
private
Are we executing on Travis
Returns:
The travis node version
isTTY
()
Boolean
private
Is this TTY
Returns:
isUser
()
Boolean
private
Is user
Returns:
startLocalDocPadExecutable
-
next
Spawn Local DocPad Executable
Parameters:
-
next
Function
Returns:
don't know what
wait
-
time
-
fn
Wait. Wrapper for setTimeout
Parameters:
-
time
Number -
fn
Function
writeError
-
err
Write an error
Parameters:
-
err
Object
writeStderr
-
data
Write to stderr
Parameters:
-
data
String