Closed (fixed)
Project:
Grammar Parser Library
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
6 Apr 2012 at 15:23 UTC
Updated:
14 Sep 2012 at 01:31 UTC
Suggestion: The README.txt file could include instructions on how to include the Grammar Parser library in a module.
I think all it needs to say is something like this:
Using Grammar Parser in a module
-----------------------------------------------
To use the Grammar Parser library in a module:
1. In your module's .info file:
dependencies[] = libraries
dependencies[] = grammar_parser_lib
2. Before any calls to Grammar Parser library code:
$library = libraries_load($name));
if (empty($library['loaded']) {
// If this is empty, it's an error and the Grammar Parser has not been installed properly.
}
At least, I think that's right... I'm working on the D7 port of API module right now and that seems to be what I need to do, but I'm not exactly sure. Anyway, some instructions would be helpful to have in the README, I think.
Comments
Comment #1
solotandem commentedOn the theory that more is better, sure.
There are README files in both the Grammar Parser and the Lib modules that refer to these things, and the latter project includes drush make files. The Libraries documentation page includes the same example code. In order not to duplicate documentation, I would prefer to refer to that page.
I believe it is more proper to only include the grammar_parser_lib as your module dependency as it defines it own dependencies (currently only the libraries dependency).
Comment #2
jhodgdonTrue, regarding dependencies. :)
The reason that I suggested adding that to the README is that I had to open up the grammar_parser_lib.module file to find out what the libraries API name for the module was (I probably could have guessed, but prefer not to leave things to chance). So I thought that should have been in the README.
Oh, I see, I pasted the wrong thing into my issue report. My (hopefully better) suggestion is this:
[Edit: the U in Using got cut off, sorry]
Comment #3
jhodgdonOh, and another correction. Although this project is at grammar_parser_lib and the directory is grammar_parser_lib, the file is gplib.module, so you need to do:
Hmph.
Comment #4
drupalnesia commentedLook like we need Drush Make module also as a dependency one?
Comment #5
jhodgdonYou do not need to use Drush Make. That is optional.
Comment #6
solotandem commentedAdded a usage section to the README.txt file.
Comment #8
nancydruFor those who don't Drush, how about some real instructions, please?
Comment #9
jhodgdonSuggested text to add to the Installation part of the README file (right after where it says "To use this module, install it in a modules directory. See http://drupal.org/node/895232 for further information.):
---
To use this module, you will also need to download the Grammar Parser library from http://drupal.org/project/grammar_parser and extract its files in your sites/all/libraries directory (or a site-specific sites/*/libraries directory). You will also need to install the Libraries module (http://drupal.org/project/libraries).
---
I think that would be sufficient. Thoughts?
Comment #10
nancydruSee my comments in #1672782: Installation clear as mud
Comment #11
solotandem commentedSee http://drupalcode.org/project/grammar_parser_lib.git/commit/f6c784dfc61d....