Skip to content

Commit 63eabe3

Browse files
committed
Adjusted rtd config to not use BlockDiag on the rtd server. Added a python script, kotti_blockdiag.py, to generate PNGs for diagrams, which are defined in .diag files. The .diag files are read from scripts/blockdiag/ and the images are saved to docs/images in the same way that kotti_capture.py works. Updated readme with new instructions.
1 parent f94e2b1 commit 63eabe3

18 files changed

+315
-70
lines changed

README.rst

+71-12
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,23 @@ Make a virtualenv and prepare to use Kotti and selenium::
1818

1919
pip install kotti_docs_theme
2020

21-
wget http://sourceforge.net/projects/dejavu/files/dejavu/2.33/dejavu-fonts-ttf-2.33.tar.bz2
21+
pip install BlockDiag
2222

23-
Run Kotti::
23+
PIL is already installed by Kotti requirements, and BlockDiag needs it. Check
24+
that you have freetype2 on your system and that the installation of PIL sees
25+
it.
26+
27+
Visit http://dejavu-fonts.org/wiki/Download and download into the /scripts
28+
directory a set of fonts to use. We should probably try to use a given set.
29+
So far, the set used is::
30+
31+
wget http://sourceforge.net/projects/dejavu/files/dejavu/2.33/dejavu-fonts-ttf-2.33.tar.bz2
32+
33+
After exploding the fonts, you should have the ttf files in::
34+
35+
scripts/dejavu-fonts-ttf-2.33/ttf/
36+
37+
Run Kotti from the kotti_user_manual virtualenv directory::
2438

2539
pserve app.ini
2640

@@ -41,23 +55,68 @@ http://code.google.com/p/chromedriver/downloads/list, then download the
4155
chromedriver to the scripts directory. You do not have to download a
4256
driver for using the Firefox webdriver.
4357

44-
Then run the script::
58+
Then run the script from the kotti_user_manual/scripts/ directory::
4559

4660
python kotti_capture.py
4761

48-
This script saves images in the scripts/ directory, and stores a
49-
chromedriver.log locally.
62+
This script saves screen capture images made with Selenium in the docs/images/
63+
directory, and stores a chromedriver.log locally.
64+
65+
Then run the script::
66+
67+
python kotti_blockdiag.py
68+
69+
This script uses the BlockDiag python package to generate PNG images for use in
70+
the docs. It is possible to embed the BlockDiag diagram definitions in the rst
71+
docs as directives. However, so far at least, to take advantage of ttf fonts as
72+
this script does, we need to generate the PNG files on our own machines that
73+
have PIL installed with freetype2 installed.
5074

51-
Using the Script
52-
----------------
75+
Working with the kotti_capture.py Script
76+
----------------------------------------
5377

54-
In docs/ .rst files, add images as you normally would, according to Sphinx
55-
documentation. The entries will have the form ``.. Image::
56-
../images/add_menu.png``. The script reads the docs files, looking for such
57-
image entries, then calls the matching function, as with ``add_menu()``.
78+
In docs/ .rst files, add images as you normally would for Sphinx, according to
79+
its documentation. The entries will have the form::
80+
81+
``.. Image:: ../images/add_menu.png``
82+
83+
You need to add a matching function, e.g. add_menu(), which must be made
84+
through study of existing functions and experimentation. It is very much a
85+
system where success is found by trial and error, combining attempts in the
86+
Python code to use Selenium to find elements and do the screen captures with
87+
element inspection using Browser tools to find ids, class names, and other
88+
targets for Selenium.
5889

5990
Write functions that are dedicated to producing a given image, using whatever
6091
steps are needed in python-selenium operations. It can be necessary to perform
6192
several find, text and key entry, and click operations to achieve the desired
6293
state before capturing the image. See existing functions for the pattern,
63-
paying attention to the passing and order of creation for the browser object.
94+
paying attention to the order of steps. Little things matter.
95+
96+
Working with the kotti_blockdiag.py Script
97+
------------------------------------------
98+
99+
Add image directives for diagrams in the same way as you would for screen
100+
captures, e.g. a diagram PNG image might be::
101+
102+
``.. Image:: ../images/anonymous_vs_authenticated.png``
103+
104+
Add a corresponding BlockDiag diagram definition in scripts/blockdiag, e.g.
105+
106+
scripts/blockdiag/anonymous_vs_authenticated.diag
107+
108+
See existing examples and the BlockDiag docs, and experiment.
109+
110+
Overall Routine
111+
---------------
112+
113+
* Change / Run kotti_capture.py when something about Kotti changes, and fresh
114+
screen captures are needed, or when something is added or removed.
115+
* Likewise, run kotti_blockdiag.py as needed when existing diagrams are
116+
modified or new ones added.
117+
* Update docs files as needed for image directives from either kotti_capture.py
118+
or kotti_blockdiag.py.
119+
* Update text of docs as needed.
120+
* Rerun docs/make html.
121+
* Push to github.com/Kotti/kotti_user_manual.
122+
* Log in to readthedocs.org and manually click the Build button.

docs/DejaVuSerif.ttf

-355 KB
Binary file not shown.

docs/conf.py

-8
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,3 @@
253253
'mailing_list_url': 'http://groups.google.com/group/kotti',
254254
'irc_channel_url': 'irc://irc.freenode.net/#kotti',
255255
}
256-
257-
# Enabled extensions
258-
extensions = ['sphinxcontrib.blockdiag']
259-
260-
# Fontpath for blockdiag (truetype font)
261-
blockdiag_fontpath = os.path.join(os.path.abspath('.'), 'DejaVuSerif.ttf')
262-
263-
blockdiag_antialias = True
10.9 KB
Loading

docs/images/manufacturer_workflow.png

19.2 KB
Loading

docs/images/newspaper_workflow.png

46.3 KB
Loading

docs/images/roles_music_agency.png

21.2 KB
Loading

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Searching
7171
searching/searching
7272

7373
Publishing
74-
---------
74+
----------
7575

7676
.. toctree::
7777
:maxdepth: 2

docs/introduction/overview.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ Document content type is the most important part of this concept. Documents are
4545
added to a Kotti website in the way word-processor documents are created, but
4646
in the context of the web. Documents contain text and may include images,
4747
files, and links to other documents. Kotti's design makes linking documents to
48-
one another easy.
48+
one another happen automatically as the site structure is built. Plus, there
49+
are easy tools to make custom links between content items, or to other
50+
websites.

docs/introduction/users_and_roles.rst

+8-34
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ typical website, and private, for restricting viewing to the "logged in" user.
1515
Once a user has logged in, they can be called an ``authenticated`` user,
1616
because they have given their correct username and password.
1717

18+
.. Image:: ../images/anonymous_vs_authenticated.png
19+
1820
In its simplest form, Kotti allows a special user, called the Admin user, to
1921
log in and add and edit content. If the Kotti website is so simple that only
2022
one person will be adding content, that user will be the Admin user. The Admin
@@ -40,37 +42,7 @@ then emails her about the new account and her responsibilities. Judy and
4042
Xavier will both have rights to add and edit content in the Legal Affairs
4143
section. Joe, Sally, Xavier, and Judy share responsibilities like this:
4244

43-
.. blockdiag::
44-
45-
blockdiag {
46-
Joe -- Sally -- Xavier;
47-
48-
// set default shape
49-
default_shape = roundedbox; // default value is 'box'
50-
51-
// set default colors
52-
default_node_color = lightblue;
53-
default_group_color = "#C0C0C0";
54-
default_linecolor = "#808080";
55-
56-
group {
57-
orientation = portrait;
58-
label = 'Prospects';
59-
Joe;
60-
}
61-
62-
group {
63-
orientation = portrait;
64-
label = 'Existing Clients';
65-
Sally;
66-
}
67-
68-
group {
69-
orientation = portrait;
70-
label = 'Legal Affairs';
71-
Xavier -- Judy;
72-
}
73-
}
45+
.. Image:: ../images/roles_music_agency.png
7446

7547
Kotti includes a user registration system that can be open for general users to
7648
sign up. This is useful for social media websites that seek out membership. It
@@ -85,9 +57,11 @@ that organization. Rights can be assigned so that users in one group are
8557
restricted in what they can view, what they can add and edit. In the classic
8658
example, a newspaper could have user groups for reporters, photographers,
8759
editors, managers, etc. Each would have specific responsibilities and rights.
88-
A reporter can only write and compile articles, together with photographers. An
89-
editor can edit their work, but is not allowed to publish. Only managers can
90-
publish content.
60+
A reporter can only write and compile articles, along with photographers.
61+
Together they could belong to a "Creators" group. An editor can edit their
62+
work, but is not allowed to publish. Only managers can publish content.
63+
64+
.. Image:: ../images/newspaper_workflow.png
9165

9266
Even a small business with a handful of employees, or a small non-profit with
9367
just a few members, can benefit from some form of structure like this. Kotti

docs/introduction/workflow.rst

+44-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,47 @@
11
Workflow Policies
22
=================
33

4-
The term used for the setup for user and roles is ``workflow``. A workflow is a
5-
set of policies created for a given CMS setup, wherein user groups and roles
6-
are defined, and relationships and responsibilities are set. Additional
7-
states, augmenting the default Public and Private, such as Pending, Postponed,
8-
Scheduled, Ready-For-Circulation, Needs-Full-Review, etc., may be added,
9-
depending on specific needs. As these state names suggest, this is an area
10-
where creativity can help to build a fine-grained system.
11-
12-
You do not need to create a workflow policy to use a Kotti website. As user
13-
groups are created manually by the Admin user, a defacto workflow is created.
14-
A saved workflow is only created when there is a need to reuse a given set of
15-
policies.
4+
The term used for the setup for user and roles and related functionality is
5+
``workflow``. You do not need to create a workflow policy to use a Kotti
6+
website. If you are the sole user of the website, then you can set up your own
7+
system, but when multiple people are involved, at least roles can be useful.
8+
But even then, a custom workflow is not needed, because as user groups are
9+
created by the Admin user, a simple defacto workflow is created using the
10+
built-in states, Private and Public. So, read about workflow for general
11+
interest, and for at least knowing the potential of workflows, should a need
12+
arise.
13+
14+
A custom workflow is needed when there is more involved in the process of
15+
creating and editing content items in a succession.
16+
17+
A workflow is constituted by a set of policies created for a given CMS setup,
18+
wherein user groups and roles are defined, and relationships and
19+
responsibilities established by creation of workflow states that expand upon
20+
Private and Public. These could include Pending, Postponed, Scheduled,
21+
Ready-For-Circulation, Needs-Full-Review, etc., depending on specific needs. As
22+
these state names suggest, this is an area where creativity can help to build a
23+
fine-grained system.
24+
25+
For example, a manufacturing operation, e.g. for custom clothing, could have an
26+
in-house Kotti CMS for documenting and controlling flow of project work. The
27+
designers of the workflow would need to understand the physical layout and work
28+
schedules and constraints. They would create user roles for different stages of
29+
manufacture and assembly work, and custom content types with web forms that
30+
people would use to enter data into computer terminals on the work floor. A
31+
sequential flow of work stages would develop, starting with the initial work on
32+
the project piece, followed by quality control checks before it moves to the
33+
next workstation area. A given workstation could check a list of project pieces
34+
and where they are in the queue. The names of the workflow states and
35+
transitions might look like this:
36+
37+
.. Image:: ../images/manufacturer_workflow.png
38+
39+
Think of documents tied to individual project pieces by serial number, that
40+
would be marked as the items are carried through the process.
41+
42+
For a similar example, Kotti could be used for a video production shop, which
43+
might have roles in the workflow such as "Ingestion," which would have people
44+
working with raw video in the first processing steps, along with roles for
45+
"Color Correcting," "Titles," "Special Effects," etc. And the states used along
46+
the way could include "Raw footage," "Initial Compression Good,", "Initial
47+
Compression Failed," "Color Corrected," "Ending Credits Added," etc.

rtd.txt

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
Sphinx
2-
hg+https://bitbucket.org/Surgo/blockdiag
3-
sphinxcontrib-blockdiag==1.1.1
42
kotti_docs_theme
53
repoze.sphinx.autointerface
64
repoze.lru
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
blockdiag {
2+
orientation = landscape;
3+
4+
default_shape = roundedbox;
5+
default_node_color = lightblue;
6+
default_group_color = "#C0C0C0";
7+
default_linecolor = "#808080";
8+
9+
Anonymous -> Authenticated [label="Log In", thick=3, color=black, fontsize=12, fontfamily='sansserif-normal'];
10+
11+
Anonymous [fontsize=14, fontfamily='sansserif-normal'];
12+
Authenticated [fontsize=14, fontfamily='sansserif-normal'];
13+
14+
}
15+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
blockdiag {
2+
orientation = landscape;
3+
4+
default_shape = roundedbox;
5+
default_node_color = lightblue;
6+
default_group_color = "#C0C0C0";
7+
default_linecolor = "#808080";
8+
9+
node_width = 170; // default value is 128
10+
node_height = 100; // default value is 40
11+
12+
span_width = 140; // default value is 64
13+
span_height = 120; // default value is 40
14+
15+
Workstation-1 -> Workstation-2 [label="1-A-OK\n1-Has-Flaw-Fix\n1-Has-Flaw-Cull", thick=3, color=black, fontsize=12, fontfamily='sansserif-normal'];
16+
Workstation-2 -> Workstation-3 [label="2-A-OK\n2-Has-Flaw-Fix\n2-Has-Flaw-Cull", thick=3, color=black, fontsize=12, fontfamily='sansserif-normal'];
17+
18+
Workstation-1 [fontsize=14, fontfamily='sansserif-normal'];
19+
Workstation-2 [fontsize=14, fontfamily='sansserif-normal'];
20+
Workstation-3 [fontsize=14, fontfamily='sansserif-normal'];
21+
22+
}
23+
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
blockdiag {
2+
orientation = landscape;
3+
4+
default_shape = roundedbox;
5+
default_node_color = lightblue;
6+
default_group_color = "#C0C0C0";
7+
default_linecolor = "#808080";
8+
9+
Reporter [fontsize=14, fontfamily='sansserif-normal'];
10+
Photographer [fontsize=14, fontfamily='sansserif-normal'];
11+
Cartoonist [fontsize=14, fontfamily='sansserif-normal'];
12+
Statistician [fontsize=14, fontfamily='sansserif-normal'];
13+
Artist [fontsize=14, fontfamily='sansserif-normal'];
14+
15+
Editor [fontsize=14, fontfamily='sansserif-normal'];
16+
Manager [fontsize=14, fontfamily='sansserif-normal'];
17+
Newspaper [shape=box, fontsize=14, fontfamily='sansserif-normal'];
18+
19+
Reporter -> Editor [label="Submit", thick=3, color=black, fontsize=12, fontfamily='sansserif-normal'];
20+
Editor -> Manager [label="Submit", thick=3, color=black, fontsize=12, fontfamily='sansserif-normal'];
21+
Manager -> Newspaper [label="Publish", thick=3, color=black, fontsize=12, fontfamily='sansserif-normal'];
22+
23+
group {
24+
orientation = portrait;
25+
label = 'Creators';
26+
fontsize = 14;
27+
fontfamily = 'sansserif-bold';
28+
color = 'none';
29+
30+
Reporter -- Photographer -- Cartoonist -- Statistician -- Artist;
31+
}
32+
33+
group {
34+
label = 'Editors';
35+
fontsize = 14;
36+
fontfamily = 'sansserif-bold';
37+
color = 'none';
38+
39+
Editor;
40+
}
41+
42+
group {
43+
label = 'Managers';
44+
fontsize = 14;
45+
fontfamily = 'sansserif-bold';
46+
color = 'none';
47+
48+
Manager;
49+
}
50+
51+
}
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
blockdiag {
2+
orientation = landscape;
3+
4+
default_shape = roundedbox;
5+
default_node_color = lightblue;
6+
default_group_color = "#C0C0C0";
7+
default_linecolor = "#808080";
8+
9+
Joe -- Sally -- Xavier;
10+
11+
Joe [fontsize=14, fontfamily='sansserif-normal'];
12+
Sally [fontsize=14, fontfamily='sansserif-normal'];
13+
Xavier [fontsize=14, fontfamily='sansserif-normal'];
14+
Judy [fontsize=14, fontfamily='sansserif-normal'];
15+
16+
group {
17+
label = 'Prospects';
18+
fontsize = 14;
19+
fontfamily = 'sansserif-bold';
20+
color = 'none';
21+
22+
Joe;
23+
}
24+
25+
group {
26+
label = 'Existing Clients';
27+
fontsize = 14;
28+
fontfamily = 'sansserif-bold';
29+
color = 'none';
30+
31+
Sally;
32+
}
33+
34+
group {
35+
orientation = portrait;
36+
label = 'Legal Affairs';
37+
fontsize = 14;
38+
fontfamily = 'sansserif-bold';
39+
color = 'none';
40+
41+
Xavier -- Judy;
42+
}
43+
}

0 commit comments

Comments
 (0)