forked from domenkozar/Products.TinyMCE
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDEVELOP.txt
202 lines (139 loc) · 6.39 KB
/
DEVELOP.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
Developing TinyMCE
==================
First start
-----------
Before you start, `http://help.github.com/mac-set-up-git/ <set up your git>`_.
Then fork both https://github.com/iElectric/Products.TinyMCE and
https://github.com/iElectric/Products.TinyMCE. Continue with cloning your fork
of ``Products.TinyMCE`` to your local machine::
$ git clone [email protected]:<your_git_username>/Products.TinyMCE.git
$ cd Products.TinyMCE
Now you need to tell buildout to use your fork of ``tinymce``. Do that by
opening up ``buildout.cfg`` with your favorite editor and changing the
``tinymce = ...`` line in ``[sources]`` section so it points to your fork::
- tinymce = git https://github.com/iElectric/tinymce.git egg=false branch=3.4.7-plone
+ tinymce = git https://github.com/<your_git_username>/tinymce.git egg=false branch=3.4.7-plone
Cool, you are now ready to build your development environment::
$ python2.6 bootstrap.py
$ bin/buildout
What follows is going into src/tinymce, running some scripts to build TinyMCE
and copy them in place where Plone can use them. Luckily, these steps are all
covered for by a convenience script - ``upgrade_tinymce.sh`` - which you
just need to run::
$ ./upgrade_tinymce.sh
Ok, ready to start Zope and apply upgrade steps to your site. Once started go to
http://localhost:8080/Plone/portal_setup/manage_upgrades and choose
``Products.TinyMCE:TinyMCE`` as a profile. If upgrades are available, run them.
If you see ``No upgrade avaiable`` you don't need to run anything.
After each change
-----------------
If you change something you need to rerun the tinymce builder script and
restart Plone
$ ./upgrade_tinymce.sh
$ bin/instance fg
Updating translations
---------------------
We use two domains of translations:
* tinymce.po files which contain TinyMCE core translations and which are only
updated when we upgrade to a new version of TinyMCE (see below) - no touchy!
* plone.tinymce.po files which contain translations for our custom code.
If you change some of our templates or control panels, make sure you rebuild our
plone.tinymce.pot file and re-sync all language files::
$ cd Products/TinyMCE/locales
$ i18ndude rebuild-pot --exclude utils --pot plone.tinymce.pot --merge plone.tinymce-manual.pot --create plone.tinymce ../
$ i18ndude sync --pot plone.tinymce.pot ./*/LC_MESSAGES/plone.tinymce.po
After this (or if you only change a translation string itself), you need to
recompile .mo files::
$ cd Products/TinyMCE/locales/<your_language>/LC_MESSAGES
$ msgfmt -o plone.tinymce.mo plone.tinymce.po
Common pitfalls
---------------
If your TinyMCE is not working as excpected or is not displayed at all,
first check you haven't fallen in one of the following pits.
Building TinyMCE failed
"""""""""""""""""""""""
Maybe the ``upgrade_tinymce.sh`` script failed halfway through its
process. Stop Zope and rerun the script until you see an output like this::
...
BUILD SUCCESSFUL
Total time: 4 seconds
*** Cleaning old tinymce version ...
*** Copying files ...
*** Removing unneeded files ...
*** Removing unneeded plugins ...
*** Removing unneeded skins ...
*** Updating language files ...
*** Translations already there, copy them over ***
Use correct tinymce branch
""""""""""""""""""""""""""
Go to ``src/tinymce/`` and make sure you are using the latest plone branch
of TinyMCE. The output should look something like this, with ``*`` indicating
which branch you are on::
$ git branch
* 3.4.3-plone
master
/Products.TinyMCE/tinymce_language_pack/langs/: No such file or directory
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This happens sometimes when running ``./upgrade_tinymce.sh``. Remove the ``xml``
folder in utils and re-run the script::
$ rm -rf Products/TinyMCE/utils/xml
$ ./upgrade_tinymce.sh
Getting a new upstream version
==============================
Let's say current version in Products.TinyMCE is 3.4.3 and upstream is 3.4.7::
$ cd src/tinymce
$ git checkout 3.4.3
$ git checkout -b 3.4.7
$ git rebase --ignore-whitespace --onto 3.4.7-plone 3.4.3 3.4.7
Ignore whitespace makes sure different lineendings are not an issue while merging.
PS: It is highly recommended to use meld for merging::
$ git config --global merge.tool meld
Set new branch in buildout
--------------------------
Open up ``buildout.cfg`` and fix the ``tinymce`` directive in ``[sources]``
section to use the new plone branch of tinymce.
Update language files for TinyMCE core
--------------------------------------
Whenever we upgrade to a new version of TinyMCE, we also need to fetch
the latest language files for TinyMCE core and convert them to .po files,
that Plone can use. You do that by using the scripts in
``Products/TinyMCE/utils``::
# download XML language files
$ cd Products/TinyMCE/utils
$ python wget-xml.py
# convert downloaded xml files into .po files
$ python generate-po.py
# compile .mo files out of .po files
$ python compile-po.py
# create tinymce.pot which is needed for pobuddy.py support
$ cp ../locales/en/LC_MESSAGES/tinymce.po ../locales/tinymce.pot
Compile translation files
-------------------------
A one-liner to compile all translation files goes a little something like this::
$ cd Products/TinyMCE/locales
$ for po in `find . -name "*.po"` ; do msgfmt -o `dirname $po`/`basename $po .po`.mo $po; done
Releasing TinyMCE
=================
* run ./upgrade_tinymce.sh
* rebuild pot and sync (look above)
* compile translation files (look above)
* commit all changes in skins directory with message like "sync with tinymce at revision x"
* increment version in setup.py
* run python setup.py sdist
Known local fixes which need to be merged
=========================================
- fixes in skins/tinymce/tiny_mce_src.js
- fixes in skins/tinymce/plugins/paste/pastetext.html.pt and
skins/tinymce/plugins/paste/js/pastetext.js
- others?
Javascript coding standards
===========================
- use jslint, if you don't have it integrated with editor yet, use http://www.jslint.com/
Prerequisites
=============
If you are on a Mac, install `apache-ant` from macports. Otherwise:
- Install the Java JDK or JRE packages
- Install Apache Ant
- Add Apache Ant to your systems path environment variable. This is not
required but makes it easier to issue commands to Ant without having to type
the full path for it.