Skip to content

Commit 1c9d251

Browse files
committedJan 6, 2012
Trying out the manual with separate chapters in files.
1 parent 133c4c4 commit 1c9d251

File tree

9 files changed

+56
-53
lines changed

9 files changed

+56
-53
lines changed
 

‎.dexy

+5
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
{
2+
"*.tex|jinja" : { "allinputs" : true },
3+
"*.py|pyg|l": {},
4+
"*.sh|pyg|l": {},
5+
"*.conf|dexy": {},
6+
"*.cfg": {}
27
}

‎docs/manual/.dexy

-6
This file was deleted.

‎docs/manual/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WEBSITE=$(USER)@mongrel2.org:/var/www/mongrel2.org/static/
44
FINAL=book-final
55

66
draft: book-final.dvi
7-
htlatex book-final.tex
7+
htlatex book-final.tex "book,index=1,2,next,fn-in"
88

99
book-final.dvi:
1010
cp $(SOURCE).tex book-final.tex

‎docs/manual/book.cfg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
\Preamble{html}
2+
\begin{document}
3+
\Css{}
4+
\EndPreamble

‎docs/manual/deploying.tex

+15-15
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ \subsection{Installing procer}
133133
totally from scratch as if you hadn't even build Mongrel2 yet:
134134

135135
\begin{code}{Install procer}
136-
<< d['docs/manual/inputs/install_procer.sh|pyg|l'] >>
136+
<< d['inputs/install_procer.sh|pyg|l'] >>
137137
\end{code}
138138

139139
That's the entire install process, and now procer is in \file{/usr/local/bin}
@@ -169,7 +169,7 @@ \section{Step 1: The Deployment Area}
169169
but feel free to change this up later if you find a better way.
170170

171171
\begin{code}{Make Deployment Directories}
172-
<< d['docs/manual/inputs/make_deployment_directories.sh|pyg|l'] >>
172+
<< d['inputs/make_deployment_directories.sh|pyg|l'] >>
173173
\end{code}
174174

175175
Hopefully, you're starting to see how you could easily automate this so that you don't
@@ -218,7 +218,7 @@ \section{Step 2: The mongrel2.org Configuration}
218218
did with these commands:
219219

220220
\begin{code}{Testing The Initial Configuration}
221-
<< d['docs/manual/inputs/testing_initial_config.sh|pyg|l'] >>
221+
<< d['inputs/testing_initial_config.sh|pyg|l'] >>
222222
\end{code}
223223

224224
That's enough to make sure it runs, but you've got nothing running,
@@ -240,13 +240,13 @@ \section{Step 3: Setup procer}
240240
and make sure procer can run everything:
241241

242242
\begin{code}{Skeleton procer Setup}
243-
<< d['docs/manual/inputs/skeleton_procer_setup.sh|pyg|l'] >>
243+
<< d['inputs/skeleton_procer_setup.sh|pyg|l'] >>
244244
\end{code}
245245

246246
With all of that, you can then try to run \shell{procer} to watch
247247
it fail but still try to run everything:
248248

249-
<< d['docs/manual/inputs/run_procer_first_time.sh|pyg|l'] >>
249+
<< d['inputs/run_procer_first_time.sh|pyg|l'] >>
250250

251251
This is assuming that you are still in the \file{profiles} directory.
252252
You should see the file \file{error.log} get created and
@@ -290,7 +290,7 @@ \section{Step 3: Setup procer}
290290
Next up, let's get Mongrel2 running inside \shell{procer}:
291291

292292
\begin{code}{procer Config For Mongrel2}
293-
<< d['docs/manual/inputs/procer_config_for_mongrel2.sh|pyg|l'] >>
293+
<< d['inputs/procer_config_for_mongrel2.sh|pyg|l'] >>
294294
\end{code}
295295

296296
Obviously, you don't have to use a series of \shell{echo} commands to
@@ -303,7 +303,7 @@ \section{Step 3: Setup procer}
303303

304304

305305
\begin{code}{Using procer To Run Mongrel2}
306-
<< d['docs/manual/inputs/using_procer_to_run_mongrel2.sh|pyg|l'] >>
306+
<< d['inputs/using_procer_to_run_mongrel2.sh|pyg|l'] >>
307307
\end{code}
308308

309309
To watch \shell{procer} in action, try doing \shell{m2sh stop -db config.sqlite
@@ -322,7 +322,7 @@ \subsection{The Python Examples}
322322
you will change \file{profiles/chat/run} to be like this:
323323

324324
\begin{code}{Run Script For Chat Demo}
325-
<< d['docs/manual/inputs/procer_script_for_chat_demo.sh|pyg|l'] >>
325+
<< d['inputs/procer_script_for_chat_demo.sh|pyg|l'] >>
326326
\end{code}
327327

328328
This little script uses some funky features you might not be familiar
@@ -345,13 +345,13 @@ \subsection{The Python Examples}
345345

346346
When you run this manually, you should see something like this:
347347

348-
<< d['docs/manual/inputs/run_procer_chat_demo.sh|pyg|l'] >>
348+
<< d['inputs/run_procer_chat_demo.sh|pyg|l'] >>
349349

350350
After all that, you can then try out \shell{procer} again to see if it
351351
properly runs the chat demo as well as mongrel2:
352352

353353
\begin{code}{Running procer With Chat Demo}
354-
<< d['docs/manual/inputs/running_procer_with_chat_demo.sh|pyg|l'] >>
354+
<< d['inputs/running_procer_with_chat_demo.sh|pyg|l'] >>
355355
\end{code}
356356

357357
If you go look at \file{profiles/error.log}, you'll see that \shell{procer}
@@ -365,17 +365,17 @@ \subsection{The Python Examples}
365365
\file{profiles/handlertest/run}
366366
\hrule
367367

368-
<< d['docs/manual/inputs/procer_handlertest_run.sh|pyg|l'] >>
368+
<< d['inputs/procer_handlertest_run.sh|pyg|l'] >>
369369

370370
\file{profiles/mp3stream/run}
371371
\hrule
372372

373-
<< d['docs/manual/inputs/procer_mp3stream_run.sh|pyg|l'] >>
373+
<< d['inputs/procer_mp3stream_run.sh|pyg|l'] >>
374374

375375
\file{profiles/web/run}
376376
\hrule
377377

378-
<< d['docs/manual/inputs/procer_web_run.sh|pyg|l'] >>
378+
<< d['inputs/procer_web_run.sh|pyg|l'] >>
379379
\end{code}
380380

381381

@@ -385,7 +385,7 @@ \subsection{Testing The New Setup}
385385
just need to see if things work. Here's some curl commands to try:
386386

387387
\begin{code}{Testing With Curl}
388-
<< d['docs/manual/inputs/testing_procer_setup.sh|pyg|l'] >>
388+
<< d['inputs/testing_procer_setup.sh|pyg|l'] >>
389389
\end{code}
390390

391391

@@ -421,7 +421,7 @@ \section{Step 4: Static Content}
421421
out the chat demo:
422422

423423
\begin{code}{Setting Up Static Content}
424-
<< d['docs/manual/inputs/setting_up_static_content.sh|pyg|l'] >>
424+
<< d['inputs/setting_up_static_content.sh|pyg|l'] >>
425425
\end{code}
426426

427427
If you get a good response then you should be able to go to

‎docs/manual/hacking.tex

+12-12
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ \subsection{Complete Message Examples}
355355
To parse this in Python we simply do this:
356356

357357
\begin{code}{Parsing Mongrel2 Requests In Python}
358-
<< d['docs/manual/inputs/parsing_mongrel2_reqs.py|pyg|l'] >>
358+
<< d['inputs/parsing_mongrel2_reqs.py|pyg|l'] >>
359359
\end{code}
360360

361361
This is actually all of the code needed to parse a request, and is
@@ -374,7 +374,7 @@ \subsection{Complete Message Examples}
374374
this is very easy in Python:
375375

376376
\begin{code}{Generating Responses}
377-
<< d['docs/manual/inputs/generating_responses.py|pyg|l'] >>
377+
<< d['inputs/generating_responses.py|pyg|l'] >>
378378
\end{code}
379379

380380
That, again, is all there is to it. The \ident{send} method is the
@@ -419,7 +419,7 @@ \subsection{TNetStrings Alternative Protocol}
419419

420420

421421
\begin{code}{Parsing TNetStrings Requests In Python}
422-
<< d['docs/manual/inputs/parsing_reqs_tnetstrings.py|pyg|l'] >>
422+
<< d['inputs/parsing_reqs_tnetstrings.py|pyg|l'] >>
423423
\end{code}
424424

425425
Our tests also show that TNetStrings are a good compromise between
@@ -453,7 +453,7 @@ \section{Basic Handler Demo}
453453
file, but with extraneous prints removed for simplicity.}
454454

455455
\begin{code}{http.py example}
456-
<< d['examples/http_0mq/http.py|pyg|l'] >>
456+
<< d['/examples/http_0mq/http.py|pyg|l'] >>
457457
\end{code}
458458

459459
All this code does is print back a simple little dump of what it received, and
@@ -481,7 +481,7 @@ \section{Basic Handler Demo}
481481
just syntactic sugar on crafting a decent HTTP response. Here's the actual method that is crafting these replies:
482482

483483
\begin{code}{HTTP Response Python Code}
484-
<< d['docs/manual/inputs/http_response_python_code.py|pyg|l'] >>
484+
<< d['inputs/http_response_python_code.py|pyg|l'] >>
485485
\end{code}
486486

487487
Which is then used by \ident{Connection.reply\_http} and
@@ -517,7 +517,7 @@ \section{Async File Upload Demo}
517517
you how to do it:
518518

519519
\begin{code}{Async Upload Example}
520-
<< d['examples/http_0mq/upload.py|pyg|l'] >>
520+
<< d['/examples/http_0mq/upload.py|pyg|l'] >>
521521
\end{code}
522522

523523
You can test this with something like
@@ -561,7 +561,7 @@ \section{MP3 Streaming Demo}
561561
streaming thread right:
562562

563563
\begin{code}{Base mp3stream Code}
564-
<< d['examples/mp3stream/handler.py|pyg|l'] >>
564+
<< d['/examples/mp3stream/handler.py|pyg|l'] >>
565565
\end{code}
566566

567567
Walking through this example is fairly easy, assuming you just trust
@@ -607,10 +607,10 @@ \section{Chat Demo}
607607
to look:
608608

609609
\begin{description}
610-
\item [JavaScript] Look at \file{examples/chat/static/*.js} for the goodies.
610+
\item [JavaScript] Look at \file{/examples/chat/static/*.js} for the goodies.
611611
The key is to see how \file{chat.js} works with the JSSocket stuff,
612612
and then look at how I did \file{app.js} using \file{fsm.js}.
613-
\item [Python] Look at the \file{examples/chat/chat.py} file to see how
613+
\item [Python] Look at the \file{/examples/chat/chat.py} file to see how
614614
the chat states are maintained and how messages are sent around.
615615
\item [config] The configuration you created in the last chapter
616616
actually works with the demo, and if you've been following along
@@ -633,7 +633,7 @@ \section{Writing A Filter (BETA)}
633633

634634

635635
\begin{code}{The Basic null Filter}
636-
<< d['tools/filters/null.c|pyg|l'] >>
636+
<< d['/tools/filters/null.c|pyg|l'] >>
637637
\end{code}
638638

639639
In this code you are basically creating a .so file that Mongrel2
@@ -735,14 +735,14 @@ \section{Config From Anything: Experimental}
735735
inputs to the configuration system. Here's the code to the module:
736736

737737
\begin{code}{The null Config Module}
738-
<< d['tools/config_modules/null.c|pyg|l'] >>
738+
<< d['/tools/config_modules/null.c|pyg|l'] >>
739739
\end{code}
740740

741741
You can then get Mongrel2 to load this module directly by passing it as a
742742
fourth parameter to the \file{mongrel2} executable:
743743

744744
\begin{code}{Loading The null Config}
745-
<< d['docs/manual/inputs/null_config_run.sh|pyg|l'] >>
745+
<< d['inputs/null_config_run.sh|pyg|l'] >>
746746
\end{code}
747747

748748
In this run, Mongrel2 detected that you gave it a fourth option and

‎docs/manual/installing.tex

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ \section{Install Dependencies}
3232
install required packages for your OS, but here's how I did it on my computer:
3333

3434
\begin{code}{Installing Dependencies on ArchLinux}
35-
<< d['docs/manual/inputs/install_dependencies.sh|pyg|l'] >>
35+
<< d['inputs/install_dependencies.sh|pyg|l'] >>
3636
\end{code}
3737

3838
If you run into parts that your OS is missing, which is likely on
@@ -81,7 +81,7 @@ \subsection{Using git}
8181
Once you have git you can then get the Mongrel2 source and open it up:
8282

8383
\begin{code}{Cloning the Mongrel2 Source}
84-
<< d['docs/manual/inputs/cloning_mongrel2_source.sh|pyg|l'] >>
84+
<< d['inputs/cloning_mongrel2_source.sh|pyg|l'] >>
8585
\end{code}
8686

8787
Make sure you do this in order (just like with every set of instructions you follow)
@@ -127,7 +127,7 @@ \subsection{Other platforms than Linux}
127127
So for example you would probably install zeromq and sqlite3 as ports and then compile it like so:
128128
129129
\begin{code}{Installing Mongrel2 on FreeNSD}
130-
<< d['docs/manual/inputs/install_freebsd.sh|pyg|l'] >>
130+
<< d['inputs/install_freebsd.sh|pyg|l'] >>
131131
\end{code}
132132
133133
\section{Testing The Installation}
@@ -137,15 +137,15 @@ \section{Testing The Installation}
137137
use to try it out:
138138
139139
\begin{code}{First Test Run}
140-
<< d['docs/manual/inputs/first_mongrel2_run.sh|pyg|l'] >>
140+
<< d['inputs/first_mongrel2_run.sh|pyg|l'] >>
141141
\end{code}
142142
143143
That's it. Just hit CTRL-c for now and we'll get into playing with this
144144
setup later.
145145
146146
\section{Upgrading from trunk}
147147
\begin{code}{Update your checkout}
148-
<< d['docs/manual/inputs/updating_your_checkout.sh|pyg|l'] >>
148+
<< d['inputs/updating_your_checkout.sh|pyg|l'] >>
149149
\end{code}
150150
151151

‎docs/manual/managing.tex

+14-14
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ \section{Trying m2sh}
8080
After you have that, do this:
8181

8282
\begin{code}{Sample m2sh Commands}
83-
<< d['docs/manual/inputs/sample_m2sh_commands.sh|pyg|l'] >>
83+
<< d['inputs/sample_m2sh_commands.sh|pyg|l'] >>
8484
\end{code}
8585

8686
At this point, you should have seen lists of servers and hosts, seen that mongrel2 is
@@ -91,7 +91,7 @@ \section{Trying m2sh}
9191
to exit from the previous start command):
9292

9393
\begin{code}{Starting, Stopping, Reloading}
94-
<< d['docs/manual/inputs/starting_stopping_reloading.sh|pyg|l'] >>
94+
<< d['inputs/starting_stopping_reloading.sh|pyg|l'] >>
9595
\end{code}
9696

9797
Awesome, right? Using just this one little management tool you
@@ -142,7 +142,7 @@ \section{A Simple Configuration File}
142142

143143
\begin{code}{Simple Little Config Example}
144144
\begin{lstlisting}
145-
<< d['examples/configs/sample.conf|dexy'] >>
145+
<< d['/examples/configs/sample.conf|dexy'] >>
146146
\end{lstlisting}
147147
\end{code}
148148

@@ -151,7 +151,7 @@ \section{A Simple Configuration File}
151151
we would just do this:
152152

153153
\begin{code}{Loading The Simple Config}
154-
<< d['docs/manual/inputs/load_simple_config.sh|pyg|l'] >>
154+
<< d['inputs/load_simple_config.sh|pyg|l'] >>
155155
\end{code}
156156

157157
Notice that we didn't have to tell m2sh that the database was \file{config.sqlite}.
@@ -345,7 +345,7 @@ \section{A More Complex Example}
345345

346346
\begin{code}{Mongrel2.org Config Script}
347347
\begin{lstlisting}
348-
<< d['examples/configs/mongrel2.conf|dexy'] >>
348+
<< d['/examples/configs/mongrel2.conf|dexy'] >>
349349
\end{lstlisting}
350350
\end{code}
351351

@@ -577,7 +577,7 @@ \subsection{JSON/XML Message Routing Syntax}
577577
full, but the meat of it is:
578578

579579
\begin{code}{BBS Client JSON Socket Handling}
580-
<< d['docs/manual/inputs/bbs_client_socket.py|pyg|l'] >>
580+
<< d['inputs/bbs_client_socket.py|pyg|l'] >>
581581
\end{code}
582582

583583
In that code, notice how (for historical reasons due to Flash sucking) the
@@ -589,7 +589,7 @@ \subsection{JSON/XML Message Routing Syntax}
589589
Finally, here's the grammar rules in the parser for handling these messages:
590590

591591
\begin{code}{JSON/XML Message Grammar}
592-
<< d['docs/manual/inputs/json_xml_socket_grammar.py|pyg|l'] >>
592+
<< d['inputs/json_xml_socket_grammar.py|pyg|l'] >>
593593
\end{code}
594594

595595
If you read that carefully, you'll see you can actually pass query strings
@@ -686,14 +686,14 @@ \section{Control Port}
686686

687687
You then use the control port by running \ident{m2sh}:
688688

689-
<< d['docs/manual/inputs/sample_m2sh_run.sh|pyg|l'] >>
689+
<< d['inputs/sample_m2sh_run.sh|pyg|l'] >>
690690

691691
The protocol to and from the control socket is a simple tnetstring in and out that
692692
any langauge can read. Here's a nearly complete Python client that is using
693693
the control port:
694694

695695
\begin{code}{Python Control Port Example}
696-
<< d['docs/manual/inputs/python_control_port.py|pyg|l'] >>
696+
<< d['inputs/python_control_port.py|pyg|l'] >>
697697
\end{code}
698698

699699
You obviously don't need to do this, but should you want to do
@@ -759,7 +759,7 @@ \section{Tweakable Expert Settings}
759759

760760
\begin{code}{Changing Settings}
761761
\begin{lstlisting}
762-
<< d['docs/manual/inputs/changing_settings.conf|dexy'] >>
762+
<< d['inputs/changing_settings.conf|dexy'] >>
763763
\end{lstlisting}
764764
\end{code}
765765

@@ -804,7 +804,7 @@ \section{Tweakable Expert Settings}
804804

805805
\begin{code}{Changing Mimetypes}
806806
\begin{lstlisting}
807-
<< d['docs/manual/inputs/changing_mimetypes.conf|dexy'] >>
807+
<< d['inputs/changing_mimetypes.conf|dexy'] >>
808808
\end{lstlisting}
809809
\end{code}
810810

@@ -820,7 +820,7 @@ \section{SSL Configuration}
820820
and setup your certs directory:
821821

822822
\begin{code}{Making A Self-Signed Certificate}
823-
<< d['docs/manual/inputs/makecert.sh|pyg|l'] >>
823+
<< d['inputs/makecert.sh|pyg|l'] >>
824824
\end{code}
825825

826826
I actually have a shell script kind of like this since I can never remember how
@@ -845,7 +845,7 @@ \section{SSL Configuration}
845845

846846
\begin{code}{Minimal SSL Configuration}
847847
\begin{lstlisting}
848-
<< d['docs/manual/inputs/mini_ssl_settings.conf|dexy'] >>
848+
<< d['inputs/mini_ssl_settings.conf|dexy'] >>
849849
\end{lstlisting}
850850
\end{code}
851851

@@ -878,7 +878,7 @@ \section{Configuring Filters (BETA)}
878878

879879
\begin{code}{Minimal Filter Configuration}
880880
\begin{lstlisting}
881-
<< d['docs/manual/inputs/filters.conf|dexy'] >>
881+
<< d['inputs/filters.conf|dexy'] >>
882882
\end{lstlisting}
883883
\end{code}
884884

‎docs/ru/.nodexy

Whitespace-only changes.

0 commit comments

Comments
 (0)
Please sign in to comment.