Giter Club home page Giter Club logo

grunt-docs's Introduction

grunt-docs

A grunt plugin to compile using DocPad.

Getting Started

Install this grunt plugin next to your project's Gruntfile.js gruntfile with: npm install grunt-docs

Then add this line to your project's Grunfile.js gruntfile:

grunt.loadNpmTasks('grunt-docs');

Documentation

This plugin provides the task: docs. You can pass in your DocPad configuration directly:

docs: {
  srcPath: 'src/',
  outPath: 'build/',
}

Please view the example for an example folder structure for converting file types.

Contributing

Please use the issue tracker and pull requests.

Release History

  • 1.0.0 Update docpad and tag peer deps >=.
  • 0.8.0 Update docpad to latest v6.64.3. Docpad now installed as peerDep and set the correct Grunt working directory (@kasperisager).
  • 0.7.0 Update docpad to latest v6.63.3.
  • 0.6.0 Update docpad to latest v6.46.3.
  • 0.5.1 Update docpad to latest.
  • 0.5.0 Now just a wrapper for docpad generate.
  • 0.4.0 Support for Grunt v0.4. Update docpad version.
  • 0.3.1 Ability to set DocPad config with options.
  • 0.3.0 Update to DocPad 6.6.6. Refactor for migration to Grunt 0.4.
  • 0.2.0 Convert to use DocPad
  • 0.1.1 More testable structure of module
  • 0.1.0 Initial release

License

Copyright (c) 2016 Kyle Robinson Young
Licensed under the MIT license.

grunt-docs's People

Contributors

iammerrick avatar jrussell-ivantage avatar kasperisager avatar scott-laursen avatar shama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

grunt-docs's Issues

npm installed version seems broken

As of the moment I'm writing, the version installed by npm install grunt-docs is broken.
The task didn't do anything, and after a inspection in tasks/docs.js it seems to have some debugging console.logs with a quick return.

You might want to make an update.

For people who have the same issue now, install from master:

npm install https://github.com/shama/grunt-docs/tarball/master

Documentation: How to set options e.g. for Markdown (marked)

In marked, I should be able to chose 'github flavoured markdown' css.

Like this: markedOptions: { gfm: true }.

Unfortunately, I cannot find out, how to set it up in grunt. I tried this:

docs: {
  build: {
    options: {
      markedOptions: {
        gfm: true
      }
    },
    src: ['source/docs/*.md'],
    dest: './'
  }
}

and this

docs: {
    options: {
      markedOptions: {
        gfm: true
      }
    },
  build: {
    src: ['source/docs/*.md'],
    dest: './'
  }
}

and this

docs: {
    options: {
      marked: {
        gfm: true
      }
    },
  build: {
    src: ['source/docs/*.md'],
    dest: './'
  }
}

But non of these work.

On the marked github page it is said, that gfm is true on default. But the rendered html does not contain any styles.

Any idea?

Thank you very much!

  • Jerry

Grunt 0.4 Release

I'm posting this issue to let you know that we will be publishing Grunt 0.4 on Monday, February 18th.

If your plugin is not already Grunt 0.4 compatible, would you please consider updating it? For an overview of what's changed, please see our migration guide.

If you'd like to develop against the final version of Grunt before Monday, please specify "grunt": "0.4.0rc8" as a devDependency in your project. After Monday's release, you'll be able to use "grunt": "~0.4.0" to actually publish your plugin. If you depend on any plugins from the grunt-contrib series, please see our list of release candidates for compatible versions. All of these will be updated to final status when Grunt 0.4 is published.

Also, in an effort to reduce duplication of effort and fragmentation in the developer community, could you review the grunt-contrib series of plugins to see if any of your functionality overlaps significantly with them? Grunt-contrib is community maintained with 40+ contributors—we'd love to discuss any additions you'd like to make.

Finally, we're working on a new task format that doesn't depend on Grunt: it's called node-task. Once this is complete, there will be one more conversion, and then we'll never ask you to upgrade your plugins to support our changes again. Until that happens, thanks for bearing with us!

If you have any questions about how to proceed, please respond here, or join us in #grunt on irc.freenode.net.

Thanks, we really appreciate your work!

Path structure not duplicated

Everything seems to work well except my source dir/sub dir hierarchy is not preserved - all files are dumped in the dest folder:

Source files:

src/
  foo/
    bar/
      snapper.html.md
  foobar.html.md

Expected output:

dest/
  foo/
    bar/
      snapper.html
  foobar.html

Actual output:

dest/
  snapper.html
  foobar.html

Gruntfile:

module.exports = function(grunt) {
  grunt.initConfig({
    docs: {
      all: {
        src: ["src/**/*"],
        dest: "dest/"
      }
    }
  });
  grunt.loadNpmTasks( "grunt-docs" );
  grunt.registerTask('default', ['docs']);
};

Node Modules:

  • docpad-plugin-marked @2.1.0
  • grunt @0.4.0
  • grunt-docs @0.4.0
  • marked @0.2.8

grunt-contrib-lib

FYI: we're changing the name of grunt-contrib-lib to grunt-lib-contrib. Please update your deps!

Could not find the specified layout: default

Hi,

To begin thanks for developing this Grunt module!

I just have an issue when running my Grunt build, here's the output:

Running "docs:www" (docs) task
info: Welcome to DocPad v6.6.8
info: Environment: development
info: Plugins: eco
>> undefined: [Lundefined:Cundefined] Could not find the specified layout: default
<WARN> Error compiling with docpad. Use --force to continue. </WARN>

My layout file is located here: docs/layouts/default.html.eco
My content files: docs/documents/*.html

And the interesting part of my grunt.js file:

docs: {
    www: {
        src: ["docs/**/*"],
        dest: "./"
    }
}

Perhaps I must set options, but how to do that?

Thanks a lot,

Fred

Unable to install grunt-docs when running npm v2.13.2

After updating Node.js I have been unable to install grunt-docs

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (
x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--save-dev" "grunt-
docs"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] preinstall: npm run-script ./cyclic.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script 'npm run-script ./cycli
c.js'.

I believe there have been a number of people with this issue with other packages where they need to update the version of js2coffee so that it can install on npm 2.*

Only after down grading my npm version to npm 1.* does this start to install properly

Grunt Task is Not Using Directory Named in src Property

I can't seem to get this task working correctly. I'm using the latest version of grunt-docs, although it's notifying me that my DocPad version is old:

notice: There is a new version of docpad available, you should probably upgrade...
current version:  6.1.3
new version:      6.6.6
grab it here:     https://github.com/bevry/docpad

Here's my task in my grunt.js file:

docs: {
    md: {
        src: 'md-docs/*',
        dest: 'html-docs/'
    }
}

When I run the task, it uses all the files in the root directory as source files instead of the md-docs directory. No matter what I do, I can't get it to use the directory declared in the src property.

Thoughts?

Question

I am dealing with the dependency on docpad and ran into the following:
peerinvalid The package docpad does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants docpad@~6.64.3
npm ERR! peerinvalid Peer [email protected] wants docpad@6
npm ERR! peerinvalid Peer [email protected] wants docpad@6
npm ERR! peerinvalid Peer [email protected] wants docpad@6

Do those plugins have to be upgraded or be looser about which version they accept?

Broke last few days...

I'm concerned that one your dependencies changed beneathe you causing this module to break.

Registering "grunt-docs" local Npm module tasks.
Reading /Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt-docs/package.json...OK
Parsing /Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt-docs/package.json...OK
Loading "docs.js" tasks...ERROR
>> TypeError: Object 0 has no method 'bind'
>>     at Object.<anonymous> (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt-docs/node_modules/docpad/node_modules/safeps/node_modules/safefs/out/lib/safefs.js:118:27)
>>     at Object.<anonymous> (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt-docs/node_modules/docpad/node_modules/safeps/node_modules/safefs/out/lib/safefs.js:124:4)
>>     at Module._compile (module.js:456:26)
>>     at Object.Module._extensions..js (module.js:474:10)
>>     at Module.load (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/karma/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36)
>>     at Function.Module._load (module.js:312:12)
>>     at Module.require (module.js:364:17)
>>     at require (module.js:380:17)
>>     at Object.<anonymous> (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt-docs/node_modules/docpad/node_modules/safeps/out/lib/safeps.js:12:12)
>>     at Object.<anonymous> (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt-docs/node_modules/docpad/node_modules/safeps/out/lib/safeps.js:589:4)
>>     at Module._compile (module.js:456:26)
>>     at Object.Module._extensions..js (module.js:474:10)
>>     at Module.load (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/karma/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36)
>>     at Function.Module._load (module.js:312:12)
>>     at Module.require (module.js:364:17)
>>     at require (module.js:380:17)
>>     at Object.<anonymous> (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt-docs/node_modules/docpad/node_modules/lazy-require/out/lib/lazy-require.js:4:10)
>>     at Module._compile (module.js:456:26)
>>     at Object.Module._extensions..js (module.js:474:10)
>>     at Module.load (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/karma/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36)
>>     at Function.Module._load (module.js:312:12)
>>     at Module.require (module.js:364:17)
>>     at require (module.js:380:17)
>>     at Object.<anonymous> (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt-docs/node_modules/docpad/out/lib/docpad.js:11:15)
>>     at Module._compile (module.js:456:26)
>>     at Object.Module._extensions..js (module.js:474:10)
>>     at Module.load (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/karma/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36)
>>     at Function.Module._load (module.js:312:12)
>>     at Module.require (module.js:364:17)
>>     at require (module.js:380:17)
>>     at Object.<anonymous> (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt-docs/node_modules/docpad/out/main.js:6:8)
>>     at Module._compile (module.js:456:26)
>>     at Object.Module._extensions..js (module.js:474:10)
>>     at Module.load (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/karma/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36)
>>     at Function.Module._load (module.js:312:12)
>>     at Module.require (module.js:364:17)
>>     at require (module.js:380:17)
>>     at Object.module.exports (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt-docs/tasks/docs.js:12:16)
>>     at loadTask (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt/lib/grunt/task.js:318:10)
>>     at /Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt/lib/grunt/task.js:354:7
>>     at Array.forEach (native)
>>     at loadTasks (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt/lib/grunt/task.js:353:11)
>>     at Task.task.loadNpmTasks (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt/lib/grunt/task.js:401:5)
>>     at Object.module.exports (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/Gruntfile.js:182:9)
>>     at loadTask (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt/lib/grunt/task.js:318:10)
>>     at Task.task.init (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt/lib/grunt/task.js:430:5)
>>     at Object.grunt.tasks (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt/lib/grunt.js:113:8)
>>     at Object.module.exports [as cli] (/Users/Merrick/Developer/Domo/DomoWeb/DomoWeb/node_modules/grunt/lib/grunt/cli.js:38:9)
>>     at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:41:20)
>>     at Module._compile (module.js:456:26)
>>     at Object.Module._extensions..js (module.js:474:10)
>>     at Module.load (module.js:356:32)
>>     at Function.Module._load (module.js:312:12)
>>     at Function.Module.runMain (module.js:497:10)
>>     at startup (node.js:119:16)
>>     at node.js:902:3

support for docpad-plugin-partials

Trying to use this to generate my docpad build however it crashes when it gets to the partials:

Running "docs:debug" (docs) task
info: Welcome to DocPad v6.6.8
info: Environment: development
info: Plugins: eco, partials
warning: Something went wrong while rendering: src/documents/index.html.eco

undefined: [Lundefined:Cundefined] Object # has no method 'partial'
Error compiling with docpad. Use --force to continue.

Aborted due to warnings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.