Explorar el Código

Automatically set up docs symlink

This also adds some docs about building the documentation.
[ci skip]
Kevin Brown hace 10 años
padre
commit
766d9f05e0
Se han modificado 3 ficheros con 32 adiciones y 1 borrados
  1. 15 1
      Gruntfile.js
  2. 16 0
      docs/README.md
  3. 1 0
      package.json

+ 15 - 1
Gruntfile.js

@@ -122,6 +122,19 @@ module.exports = function (grunt) {
       }
     },
 
+    symlink: {
+      docs: {
+        cwd: 'dist',
+        expand: true,
+        overwrite: false,
+        src: [
+          '*'
+        ],
+        dest: 'docs/dist',
+        filter: 'isDirectory'
+      }
+    },
+
     requirejs: {
       'dist': {
         options: {
@@ -219,6 +232,7 @@ module.exports = function (grunt) {
   grunt.loadNpmTasks('grunt-contrib-jshint');
   grunt.loadNpmTasks('grunt-contrib-qunit');
   grunt.loadNpmTasks('grunt-contrib-requirejs');
+  grunt.loadNpmTasks('grunt-contrib-symlink');
   grunt.loadNpmTasks('grunt-contrib-uglify');
   grunt.loadNpmTasks('grunt-contrib-watch');
 
@@ -232,7 +246,7 @@ module.exports = function (grunt) {
   grunt.registerTask('minify', ['uglify', 'sass:dist']);
   grunt.registerTask('test', ['qunit', 'jshint']);
 
-  grunt.registerTask('docs', ['jekyll:serve']);
+  grunt.registerTask('docs', ['symlink:docs', 'jekyll:serve']);
 
   grunt.registerTask('docs-release', ['default', 'clean:docs', 'gh-pages']);
 };

+ 16 - 0
docs/README.md

@@ -2,6 +2,9 @@ Select2 Documentation
 =====================
 This repository holds the latest documentation for [Select2][select2].
 
+What is this?
+-------------
+
 The documentation is automatically extracted from the `docs` directory at the
 [Select2 source repository][select2-source]. This is done periodically by
 the maintainers of Select2.
@@ -11,5 +14,18 @@ the source repository.** We _may_ accept pull requests if they match the
 source `docs` directory, but for the most part pull requests will be closed on
 sight.
 
+How can I build these docs manually?
+------------------------------------
+In the [main Select2 repository][select2-source], you can build the
+documentation by executing
+
+```bash
+grunt docs
+```
+
+Which will start up the documentation on port 4000. You will need
+[Jekyll][jekyll] installed to build the documentation.
+
+[jekyll]: http://jekyllrb.com/
 [select2]: https://select2.github.io
 [select2-source]: https://github.com/select2/select2

+ 1 - 0
package.json

@@ -46,6 +46,7 @@
     "grunt-contrib-nodeunit": "~0.3.3",
     "grunt-contrib-qunit": "~0.4.0",
     "grunt-contrib-requirejs": "^0.4.4",
+    "grunt-contrib-symlink": "^0.3.0",
     "grunt-contrib-uglify": "~0.4.0",
     "grunt-contrib-watch": "~0.6.0",
     "grunt-gh-pages": "^0.9.1",