Automatic toctree update - directory

I'm not sure if this is possible. But I'm hoping to put multiple .rst files in a directory, and during compilation. I want these files to automatically be inserted in the toctree. How can I go about this?

You can use the glob option which enables wildcards. Like this:
.. toctree::
:glob:
*
This adds all other *.rst files in the same directory to the toctree.
Reference: "Use “globbing” in toctree directives"

Related

Atom - search by extension in selected folder

When I search for certain string ("Search in directory"), atom allows to do 2 things: specify directory or file extension (but then it searches in all directories in project). Is it possible to do both at the same time? E.g. I want to do recursive search in 'src' directory, but using only *.c and *.cpp files.
Try searching using src/**/*.c as file/directory pattern.
To search both *.c and *.cpp files, use ,:
src/**/*.c, src/**/*.cpp
To speed things up, use ! to exclude an unwanted directory:
src/**/*.c, src/**/*.cpp, !src/not_this_dir/

changing file names, how to?

I've created some forms following this approach:
iron g:template cars/create_car
and the following files were created:
create_car.css
create_car.html
create_car.js
Easy question - if I want to change the name of the files where else do I have to update to keep my changes in sync with the rest of the application?
Thank you!
Mark
You won't be out of sync by changing file's name.
The only things which would change is the file load order, according to the documentation:
HTML template files are always loaded before everything else.
Files beginning with main. are loaded last
Files inside any lib/ directory are loaded next
Files with deeper paths are loaded next
Files are then loaded in alphabetical order of the entire path
On your case It's wouldn't probably cause any issue, feel free to test.

Grunt-init copyAndProcess function: Can I pass in multiple values to 'noProcess' option?

I'm using grunt-init to build a template for a site structure I repeat regularly.
The template.js file uses the init.copyAndProcess function to customize most of files but a few of them get corrupted by the file processing (some fonts and image files) and I want to include those files in the 'noProcess' option. If these files all existed in the same directory, I could use the noProcess option as mentioned in the documentation [ See: http://gruntjs.com/project-scaffolding#copying-files ] and pass in a string like and it works:
var files = init.filesToCopy(props);
init.copyAndProcess(files, props, {noProcess: 'app/fonts/**'} );
Unfortunately the files that I need to have no processing performed on are not all in the same directory and I'd like to be able to pass in an array of them, something like the following block of code, but this does not work.
var files = init.filesToCopy(props);
init.copyAndProcess(files, props, {noProcess: ['app/fonts/**', 'app/images/*.png', 'app/images/*.jpg']} );
Any thoughts on how I can have multiple targets for the 'noProcess' option?
As soon as I posted the question, I realized that my proposed code did work. I simply had an invalid path when I'd renamed my 'app' directory to 'dev'.

Ignoring a directory using ack's .ackrc

I'm not sure what it's for, but the code I'm working on has a bunch of folders called "save.d," it looks like they're used for some sort of version control (we also have .svn folders).
How can I update my .ackrc file to ignore those directories by default?
My .ackrc is currently
--type-set=inc=.inc
--ignore-dir=pear
--type-set=tpl=.tpl
Our folder structure can look like:
program/parsers/save.d
program/modules/save.d
Adding another line --ignore-dir=save.d did the trick

What is the purpose of files[] in .info?

I've just started learning discovering the changes to Drupal 7, and I just found the files[] array now required in the mymodule.info. From what I've found, it is required to add the mymodule.module file to the list, but what other uses does it have?
From what I've read I figured I should be able to separate my code into several files, for example I wanted to make a mymodule.blocks.inc to contain all the code for my blocks, but it seems like the mymodule_block_info() function never runs.
Am I doing something wrong, or is this not how it is supposed to be used?
As the documentation says:
files (Optional) Drupal now supports a dynamic-loading code registry.
To support it, all modules must now declare any code files containing class or interface declarations in the .info file.
This is only used if the file you specify in files[] contains a class or an interface. If so, the file will be auto-loaded only when needed.
No other files should be declared using files[].
At the beginning it was to make a files registry for each module, but it's not longer used as Drupal do it by himself.
If you want separate your module in multiple files, you should include them in the top of your .module file.
The way I see it, files specified as files[] are meant to be supporting files and called upon when needed. Implemented default Drupal hooks should be specified in the .module file or in the $module.$group.inc file in order for Drupal to recognize them. See hook_hook_info().
Also, see the note in the documentation under files at http://drupal.org/node/542202.

Resources