| 1 | # Third party scripts |
| 2 | |
| 3 | This folder contains various small scripts or modules for third-party softwares to use Gregorio. |
| 4 | |
| 5 | ## Scribus |
| 6 | |
| 7 | Gregorio can be used in [Scribus](http://wiki.scribus.net/canvas/Scribus) using three files: |
| 8 | |
| 9 | * `gregorio-scribus.lua` |
| 10 | * `gregorio.png` |
| 11 | * `900_gregorio.xml` |
| 12 | |
| 13 | To install Gregorio support in Scribus: |
| 14 | |
| 15 | * copy the three files in the editorconfig folder of scribus (`/usr/share/scribus/editorconfig` under Linux, `C:\Program Files\Scribus\share\editorconfig` |
| 16 | under Windows). |
| 17 | * read the comments in `900_gregorio.xml` and change some variables accordingly |
| 18 | * in Scribus: |
| 19 | * go in `File->Preferences->External Tools` |
| 20 | * click `Add` in the `Render Frames` |
| 21 | * select the file `900_gregorio.xml` |
| 22 | |
| 23 | After that you can insert a render frame using Gregorio, and simply |
| 24 | typing gabc (`right-click->edit sources`). |
| 25 | |
| 26 | For more details see [the website](http://gregorio-project.github.io/introduction-scribus.html). |
| 27 | |
| 28 | ## Syllabation checker |
| 29 | |
| 30 | The scripts in this folder allow to check the syllabation of a gabc score against syllabation rules that you must provide. |
| 31 | |
| 32 | #### Dependencies |
| 33 | |
| 34 | The main script, `checkSyllabation.py` is in Python3, so you obviously need it. It uses the [pyphen](http://pyphen.org/) package. You will also need the hyphenation of the text language in the `libhyphen` format in order to run it. |
| 35 | |
| 36 | If you want liturgical Latin hyphenation rules, you can pick those from the [hyphen-la](https://github.com/gregorio-project/hyphen-la) project. They are available in `libhyphen` format on the [webpage](http://gregorio-project.github.io/hyphen-la/). |
| 37 | |
| 38 | #### Running the scripts |
| 39 | |
| 40 | Once you have the hyphenation rules in the `libhyphen` format, you can check one score by running |
| 41 | |
| 42 | ``` |
| 43 | checkSyllabation.py -p path/to/file.dic my_file.gabc |
| 44 | ``` |
| 45 | |
| 46 | where `path/to/file.dic` is the path to the hyphenation rules file (default is `hyph_la_liturgical.dic` in the current directory). You can also analyze all gabc scores of a directory (with subdirectories) by replacing `my_file.gabc` by the name of the directory. By default, the script analyzes the current directory. The script outputs the report to `stdout` on Unix systems, and to `check-syllabation.log` on Windows systems. |
| 47 | |
| 48 | You can see more options by running |
| 49 | |
| 50 | ``` |
| 51 | checkSyllabation.py --help |
| 52 | ``` |
| 53 | |
| 54 | #### Hyphenation problems |
| 55 | |
| 56 | If you encounter problems of hyphenation, meaning you disagree with the proposed hyphenation, please contact the author of the hyphenation rules you are using ([here](https://github.com/gregorio-project/hyphen-la/issues) for `hyphen-la` for example). |
| 57 | |
| 58 | If you encounter problems because the script got confused by a gabc construct you are using or has bugs not directly related to hyphenation, please report it on the [gregorio tracker](https://github.com/gregorio-project/gregorio/issues). |
| 59 | |
| 60 | ## Kde editors (Kate, Kedit) |
| 61 | |
| 62 | You can use `gabc.xml` for syntax highlighting in kate (and Kedit, etc.). To |
| 63 | install it, copy the file in `/usr/share/apps/katepart/syntax`. This path |
| 64 | may vary according to your distribution. |
| 65 | |
| 66 | ## Gnome editors (Gedit) |
| 67 | |
| 68 | You can use `gabc.lang` for syntax highlighting in GtkSourceView (Gedit, etc.). To |
| 69 | install it, copy the file in `/usr/share/gtksourceview-3.0/language-specs`. This path |
| 70 | may vary according to your distribution. |
| 71 | |
| 72 | ## Emacs |
| 73 | |
| 74 | To use gregorio in [Emacs](https://www.gnu.org/software/emacs/), see [this script](https://github.com/cajetanus/gregorio-mode.el). |
| 75 | |
| 76 | ## Vim |
| 77 | |
| 78 | To get gabc syntax highlighting in [Vim](http://www.vim.org/): |
| 79 | |
| 80 | * copy `gabc.vim` in `/usr/share/vim/vimcurrent/syntax` |
| 81 | * add the line `au BufNewFile,BufRead *.gabc setf gabc` |
| 82 | somewhere near lines of the same type (near line 100 for example) in |
| 83 | `/usr/share/vim/vimcurrent/filetype.vim`. This will autodetect the filetypes. |
| 84 | |
| 85 | ## BBedit and TextWrangler (OSX only) |
| 86 | |
| 87 | To get gabc syntax highlight in [BBedit](http://www.barebones.com/products/bbedit/) or [TextWrangler](http://www.barebones.com/products/textwrangler/), copy `gabc-syntax.plist` into `~/Library/Application Support/TextWrangler/Language Modules/` and restart BBEdit or TextWrangler. |
| 88 | |
| 89 | ## Script to process gabc score |
| 90 | |
| 91 | `gprocess` is a perl script to instantly compile and show the result of a gabc |
| 92 | file. You can modify some variables directly into the script. |