docpad-archive / extras Goto Github PK
View Code? Open in Web Editor NEWA test runner for all of DocPad's officially supported extensions
Home Page: https://docpad.org/docs/plugins
A test runner for all of DocPad's officially supported extensions
Home Page: https://docpad.org/docs/plugins
Hi.
Since docpad 6.7.3, warnings about naming convention are raised :
docpad/docpad#313
The related plugin has this issue :
The plugin related is using a different name (relations) for its prototype name.
https://github.com/bevry/docpad-extras/tree/master/plugins/related
Hi,
I'm trying to use @import in a LESS stylesheet within Docpad. The stylesheet is called 'style.css.less' and is located in the /src/documents directory. In that directory, I also have a file 'grid.less' that I try to import into 'style.css.less' with the following line:
@import 'grid.less';
This however doesn't seem to achieve the import. When I generate the site (docpad generate), the 'grid.less' file is in the /out directory, which I would like to avoid, and the style.css, does not include the contents of 'grid.less.'
My question is two-fold then. How do I achieve the import of grid.less, and how do I make grid.less available for import without it being transfered to the /out directory.
I tried only the bootstrap-skeleton, but at least here the sanitize option doesn't allow to embed html.
Note: I added this to the docpad.coffee file:
# Markdown settings
markedOptions:
sanitize: false
See the following stack trace from a $ docpad run
warning: Failed to load the plugin docpad-plugin-autoupdate at /code/canvas.docpad/node_modules/docpad-plugin-autoupdate. The error follows
warning: An error occured: Cannot find module 'now' Error: Cannot find module 'now'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at new AutoUpdatePlugin (/code/canvas.docpad/node_modules/docpad-plugin-autoupdate/autoupdate.plugin.coffee:17:20)
at PluginLoader.create (/usr/local/lib/node_modules/docpad/lib/plugin-loader.coffee:169:26)
at /usr/local/lib/node_modules/docpad/lib/docpad.coffee:812:31
at PluginLoader.load (/usr/local/lib/node_modules/docpad/lib/plugin-loader.coffee:150:11)
at /usr/local/lib/node_modules/docpad/lib/docpad.coffee:808:29
at /usr/local/lib/node_modules/docpad/lib/plugin-loader.coffee:136:47
info: Welcome to DocPad v5.0.4
info: Didn't place the skeleton as the desired structure already exists
info: Generating...
error: An error occured: Cannot read property 'docpadSync' of undefined TypeError: Cannot read property 'docpadSync' of undefined
at AutoUpdatePlugin.writeAfter (/code/canvas.docpad/node_modules/docpad-plugin-autoupdate/autoupdate.plugin.coffee:49:21)
at /usr/local/lib/node_modules/docpad/lib/plugin.coffee:44:34
at /usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/events.coffee:273:18
at _Class.nextTask (/usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/flow.coffee:96:11)
at _Class.complete (/usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/flow.coffee:115:20)
at /usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/flow.coffee:127:33
at CachrPlugin.writeAfter (/code/canvas.docpad/node_modules/docpad-plugin-cachr/cachr.plugin.coffee:118:47)
at /usr/local/lib/node_modules/docpad/lib/plugin.coffee:44:34
at /usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/events.coffee:273:18
at _Class.run (/usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/flow.coffee:171:15)
Got latest versions via npm with npm update docpad -g
for cmd line and npm update
for package.json
app dependencies.
package.json
"dependencies": {
"coffee-script": "1.3.x",
"express": "2.5.x",
"docpad": "5.0.x",
"docpad-plugin-autoupdate": "latest",
"docpad-plugin-coffee": "latest",
"docpad-plugin-eco": "latest",
"docpad-plugin-haml": "latest",
"docpad-plugin-hogan": "latest",
"docpad-plugin-jade": "latest",
"docpad-plugin-less": "latest",
"docpad-plugin-markdown": "latest",
"docpad-plugin-stylus": "latest",
"docpad-plugin-sass": "latest",
"docpad-plugin-cachr": "latest",
"docpad-plugin-cleanurls": "latest",
"docpad-plugin-feedr": "latest",
"docpad-plugin-partials": "latest",
"docpad-plugin-related": "latest"
},
Except for the obvious info: Welcome to DocPad v5.0.5
, identical results.
Great app, thanks for all your hard work!
After a discussion with @chase earlier about submodules, I want to gather some feedback on the following.
Currently we have all the plugins as part of the the docpad-extras
repo, this is good for collaboration, management, testing, but bad for tagging, isolation.
It was proposed earlier that the plugins should be owned by the respective authors, and have submodules inside the docpad-extras repo, this is good for tagging, isolation, but bad for collaboration, management, testing.
Thinking about this more, what about plugins should be owned by the docpad organisation, and have submodules inside the docpad-extras repo for officially support plugins, this is good for tagging, isolation, collaboration, management, and testing. And bad for none.
If no one has an objection to this, lets do this right away. Happy to give the appropriate access to whoever is willing to make this change.
Important things for this change:
/cc @chase @ncrohn @georgeOsdDev @iammerrick @pismute @DjebbZ
As described in the wiki, layouts should have access to variables set in both documents and the layout itself. This is true, for example, of eco
templates. The php plugin appears to discard most of templateData
, saving only file metadata (i.e. the layout itself) to the $document
variable.
A naive patch is include below, mostly for illustrative purposes. I'll admit to not having sufficiently examined docpad's source to be able to offer a more elegant solution yet.
index db5a3ae..b513c65 100644
--- a/plugins/php/php.plugin.coffee
+++ b/plugins/php/php.plugin.coffee
@@ -30,6 +30,16 @@ module.exports = (BasePlugin) ->
#{data}
EOF;
$document = json_decode($document,true);
+
+ $templateHeader = <<<EOF
+ #{templateData.document.header}
+ EOF;
+ $templateHeader = explode("\n", trim($te
+ foreach ($templateHeader as $header)
+ {
+ $headerline = explode(":", $head
+ $document[trim($headerline[0])]
+ }
?>
#{content}
I'm trying to use a variable from docpad.cson in my src/partial/header.html.eco
by typing <%= @conf.name %>
, but I receive this error:
warning: Something went wrong while rendering: /Users/zeno/Projects/braziljs/conf-boilerplate-docpad/src/partials/header.html.eco
warning: Rendering partial failed: header.html.eco. The error follows:
warning: An error occured: Cannot read property 'conf' of undefined TypeError: Cannot read property 'conf' of undefined
This does not happen when I use this variable in my src/layouts/default.html.eco
for example.
So, can I access data from docpad.cson in partials @balupton?
if I try to include a partial from a partial it fails with the error:
error: An error occured: Object #<Object> has no method 'partial' TypeError: Object #<Object> has no method 'partial'
at Object.<anonymous> (eval at <anonymous> (/Users/santip/newttt/node_modules/docpad-plugin-eco/node_modules/eco/lib/compiler.js:19:12))
at Object.<anonymous> (eval at <anonymous> (/Users/santip/newttt/node_modules/docpad-plugin-eco/node_modules/eco/lib/compiler.js:19:12))
at eval at <anonymous> (/Users/santip/newttt/node_modules/docpad-plugin-eco/node_modules/eco/lib/compiler.js:19:12)
at Function.render (/Users/santip/newttt/node_modules/docpad-plugin-eco/node_modules/eco/lib/index.js:26:24)
at EcoPlugin.render (/Users/santip/newttt/node_modules/docpad-plugin-eco/eco.plugin.coffee:26:30)
at /usr/local/lib/node_modules/docpad/lib/plugin.js:45:34
at /usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/events.js:274:18
at _Class.nextTask (/usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/flow.js:97:11)
at _Class.complete (/usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/flow.js:116:20)
at /usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/flow.js:128:33�[22m
I tried passing in { partial: @partial } as templateData to workaround the limitation and it removes the error message but the inner partial is not included.
The first problem I encountered was with:
database.findAll(outPath: $endsWith: '.html')
https://github.com/bevry/docpad-extras/blob/master/plugins/cleanurls/src/cleanurls.plugin.coffee#L16
The query does not return any results. When I examine the underlying collection, the outPath property was undefined. I queried using extensionRendered = html and that returned results.
Also, the forEach was directly off the query. It looks like it should be off the models property.
I'd like to submit a pull request, but I am unsure about the following:
Currently the compass support lacks the ability to specify a configuration file. I believe it loads one from the current directory by default but currently leveraging the compass config.rb files is messy at best. This is necessary for the images support, perhaps compass should be a separate plugin?
Thanks!
Got this: Unexpected token : SyntaxError: Unexpected token :
when pulling this:
twit3:
url: "http://search.twitter.com/search.json?q=asd"
Solved it by adding replace to line 81 feedr.plugin.coffee:
body = body.replace(" "," ")
Read here that tab causes problems in chrome - replaced tabs with space. Might be a bad fix, but it is at least a starting point to understand the problem.
http://stackoverflow.com/questions/3143698/uncaught-syntaxerror-unexpected-token
Full error below:
An error occured: Unexpected token : SyntaxError: Unexpected token :
at Request._callback (/Users/madshobye/Dropbox/nodeLive/hobyedk_docpad5/node_modules/docpad-plugin-feedr/feedr.plugin.coffee:81:29)
at Request.callback (/Users/madshobye/Dropbox/nodeLive/hobyedk_docpad5/node_modules/docpad-plugin-feedr/node_modules/request/main.js:119:22)
at Request. (native)
at Request.emit (events.js:70:17)
at Request. (/Users/madshobye/Dropbox/nodeLive/hobyedk_docpad5/node_modules/docpad-plugin-feedr/node_modules/request/main.js:521:16)
at Request.emit (events.js:67:17)
at IncomingMessage. (/Users/madshobye/Dropbox/nodeLive/hobyedk_docpad5/node_modules/docpad-plugin-feedr/node_modules/request/main.js:483:14)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.onMessageComplete (http.js:137:23)
at Socket.ondata (http.js:1147:24)
I started using the stylus plugin which promises out-of-box nib support, but nib functions have no effect, they remain unprocessed in the css output (built-in stylus functions work as expected).
The Images Plugin could do better documentation, and perhaps could even be changed to be a bit more generic - e.g. call it readdir or something.
Your thoughts @msutherl ?
The REST plugin searches for document using QueryEngine. I'm rewriting it (just updating it to DocPad v6), and I'm placing various docpad.log <something>
. I followed your advice (@balupton) of adding docpad = @docpad
at the beginning. I rewrote the querying line to
docpad.getCollection('documents').findOne url: req.url, (err,document) ->
to match the new API.
Problem : logging docpad.getCollection('documents')
returns an empty array ([]
), whereas I do have one index.html.md
document in src/documents
, that uses a basic default
layout. Since there's no collection, I think the callback function of findOne
never gets executed, because all log statements inside never show. And so the call to res.send JSON.stringify {success:true}
never happens, and the POST query times out. I tried to POST both with jQuery.post
(jQuery 1.7.2 is included in the layout) and Curl with this basic command :
curl -v -X POST -d '{"title":"Title","content":"Hello World"}' http://localhost:9778/
and Curl answers this :
* About to connect() to localhost port 9778 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 9778 (#0)
> POST / HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3
> Host: localhost:9778
> Accept: */*
> Content-Length: 41
> Content-Type: application/x-www-form-urlencoded
>
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
* Closing connection #0
Note that the last lines starting with *
appear some time after issueing the command, that's the time out.
In both POST queries (jQuery and Curl), no error appears neither in the console nor the terminal that launched the server.
Not sure if it's a problem with the plugin or docpad.getCollection('documents')
itself...
To re-create this problem create a new docpad project with marked and highlightjs docpad plugins. Then set the marked configuration options to sanitize: false. This is useful for embedding iframes and other markup in your otherwise markdown post. Then JSHighlight will no longer highlight the your code.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.