erbook 6.0.1 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/doc/intro.erb CHANGED
@@ -21,7 +21,7 @@
21
21
  * [Grutatxt](http://www.triptico.com/software/grutatxt.html)
22
22
 
23
23
  <% section "Logistics" do %>
24
- * <%= xref "history", "Release notes" %> --- history of project releases.
24
+ * <%= xref "History", "Release notes" %> --- history of project releases.
25
25
  * [Source code](http://github.com/sunaku/<%= $program %>) --- obtain via [Git](http://git.or.cz) or browse online.
26
26
  * [API reference](api/index.html) --- documentation for source code.
27
27
 
@@ -74,12 +74,25 @@
74
74
  <%# include ../LICENSE #%>
75
75
  <% end %>
76
76
 
77
- <% section "Credits" do %>
78
- <%= $logo = "![#{$project} logo](#{$program}.png)".to_inline_xhtml %>
77
+ <% section "Credits" do |n| %>
78
+ <%= $logo = n.xref_link("![#{$project} logo](#{$program}.png)".to_inline_xhtml) %>
79
79
  <%# include README #%>
80
+
81
+ **<%= $project %>** is made possible by
82
+ <%= xref "History", "contributions" %>
83
+ from users like you:
84
+
85
+ * Jens Vierbuchen
86
+ * Maunika Gosike
87
+ * [Zhang Chiyuan](http://lifegoo.pluskid.org)
80
88
  <% end %>
81
89
 
82
90
  <% section "Reviews" do %>
91
+ Tom Cloyd in [ruby-talk](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/327499):
92
+
93
+ > This documentation is simply gorgeous!
94
+
95
+
83
96
  Vitor Peres in [ruby-talk](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/283052):
84
97
 
85
98
  > I actually felt like printing \[this manual], because it's just so well-thought typographically... Even if \[**<%= $project %>**] weren't great by itself, I'd feel good just looking at the manual.
@@ -87,7 +100,7 @@
87
100
 
88
101
  Ara T. Howard in [ruby-talk](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/282949):
89
102
 
90
- > \[this manual is] a insanely complete and nice looking bit of documentation \[... **<%= $project %>**] looks like a great project
103
+ > \[This manual is] a insanely complete and nice looking bit of documentation \[... **<%= $project %>**] looks like a great project
91
104
 
92
105
 
93
106
  Martin DeMello in [ruby-talk](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/283304):
data/doc/usage.erb CHANGED
@@ -1,17 +1,17 @@
1
1
  <% chapter "Usage" do %>
2
2
  <% section "Command-line interface" do %>
3
- <pre><%= `ruby bin/erbook -h` %></pre>
3
+ <pre><%= `ruby bin/#{$program} -h` %></pre>
4
4
 
5
- The first command-line argument to erbook is either the name of a predefined format (FormatName) or the path to a <%= xref "SpecFile", "format specification file" %> (FormatFile).
5
+ The first command-line argument to **<%= $project %>** is either the name of a predefined format (FormatName) or the path to a <%= xref "SpecFile", "format specification file" %> (FormatFile).
6
6
 
7
- Predefined formats are simply short-hand names of format specification files located in the <tt>fmt/</tt> subdirectory of the erbook installation directory (see <%= xref "Manifest" %>).
7
+ Predefined formats are simply short-hand names of format specification files located in the <tt>fmt/</tt> subdirectory of the **<%= $project %>** installation directory (see <%= xref "Manifest" %>).
8
8
 
9
9
  <% section "Saving the output to a file" do %>
10
10
  Simply redirect the standard ouput stream (STDOUT) to a file like this:
11
11
 
12
- erbook > YOUR_PATH_HERE
12
+ <%= $program %> > YOUR_PATH_HERE
13
13
 
14
- In the above example, **YOUR\_PATH\_HERE** is the path of the file in which the output should be saved.
14
+ In the above example, *YOUR\_PATH\_HERE* is the path of the file in which the output should be saved.
15
15
 
16
16
  <% important "Save XHTML output as <tt>.xhtml</tt>" do %>
17
17
  When you use the XHTML format, ensure that the file extension of your saved output document is either <tt>.xhtml</tt> or <tt>.xml</tt>. Alternatively, ensure that your saved output document is served to web browsers under the <tt>application/xhtml+xml</tt> mime type.
@@ -26,14 +26,14 @@
26
26
 
27
27
  <%%# include YOUR_PATH_HERE #%>
28
28
 
29
- In the above example, **YOUR\_PATH\_HERE** is the path of the file whose content you wish to insert into the input document.
29
+ In the above example, *YOUR\_PATH\_HERE* is the path of the file whose content you wish to insert into the input document.
30
30
 
31
31
  You can divide a large document into separate files for easier editing and stitch them together, dynamically, into a single document using the **include** directive.
32
32
  <% end %>
33
33
 
34
34
  <% section "Unindenting nodes hierarchically" do %>
35
- When writing erbook documents, I prefer to indent the content of nodes according to their depth because my [text editor of choice](http://jedit.org) automatically folds blocks of text based on indentation.
35
+ When writing **<%= $project %>** documents, I prefer to indent the content of nodes according to their depth because my [text editor of choice](http://jedit.org) automatically folds blocks of text based on indentation.
36
36
 
37
- If you also prefer to write documents in this way, be sure to pass the <tt>--unindent</tt> option to **erbook** so that the indentation will not affect the resulting output.
37
+ If you also prefer to write documents in this way, be sure to pass the <tt>--unindent</tt> option to **<%= $project %>** so that the indentation will not affect the resulting output.
38
38
  <% end %>
39
39
  <% end %>
data/fmt/xhtml.yaml CHANGED
@@ -90,7 +90,7 @@ code: |
90
90
  #
91
91
 
92
92
  def type_label #:nodoc:
93
- type.to_s.capitalize
93
+ ERBook::PHRASES[type.to_s.capitalize]
94
94
  end
95
95
 
96
96
  # Returns the title of this node as XHTML.
@@ -151,16 +151,21 @@ code: |
151
151
  PREV_SIGN = '&#x25B3;' # white up-pointing triangle
152
152
  NEXT_SIGN = '&#x25BD;' # white down-pointing triangle
153
153
 
154
+ LIST_TEXT = ERBook::PHRASES['Reverse jump to listing']
155
+ HERE_TEXT = ERBook::PHRASES['Jump to this segment']
156
+ PREV_TEXT = ERBook::PHRASES['Jump to previous segment']
157
+ NEXT_TEXT = ERBook::PHRASES['Jump to next segment']
158
+
154
159
  # Calculates a local navigation menu containing links
155
160
  # to the given URI fragments (which can be nil).
156
161
  def self.navigation here_frag, list_frag, prev_frag, next_frag
157
- list_link = list_frag ? %{<a title="Reverse jump to listing" href="##{list_frag}">#{LIST_SIGN}</a>} : LIST_SIGN
162
+ list_link = list_frag ? %{<a title="#{LIST_TEXT}" href="##{list_frag}">#{LIST_SIGN}</a>} : LIST_SIGN
158
163
 
159
- here_link = here_frag ? %{<a title="Jump to this segment" href="##{here_frag}">#{HERE_SIGN}</a>} : HERE_SIGN
164
+ here_link = here_frag ? %{<a title="#{HERE_TEXT}" href="##{here_frag}">#{HERE_SIGN}</a>} : HERE_SIGN
160
165
 
161
- prev_link = prev_frag ? %{<a title="Jump to previous segment" href="##{prev_frag}">#{PREV_SIGN}</a>} : PREV_SIGN
166
+ prev_link = prev_frag ? %{<a title="#{PREV_TEXT}" href="##{prev_frag}">#{PREV_SIGN}</a>} : PREV_SIGN
162
167
 
163
- next_link = next_frag ? %{<a title="Jump to next segment" href="##{next_frag}">#{NEXT_SIGN}</a>} : NEXT_SIGN
168
+ next_link = next_frag ? %{<a title="#{NEXT_TEXT}" href="##{next_frag}">#{NEXT_SIGN}</a>} : NEXT_SIGN
164
169
 
165
170
  %{<a name="#{here_frag}"/><div class="nav" id="#{here_frag}">#{list_link}#{prev_link}#{next_link}#{here_link}</div>}
166
171
  end
@@ -180,7 +185,7 @@ code: |
180
185
  if type == 'reference'
181
186
  prefix
182
187
  else
183
- [prefix, title].compact.join('. ')
188
+ [prefix, (%{"#{title}"} if title)].compact.join('. ')
184
189
  end
185
190
 
186
191
  title_xhtml =
@@ -499,19 +504,12 @@ nodes:
499
504
  inline: true
500
505
  output: |
501
506
  <%=
502
- target = @nodes_by_type['reference'].find {|n| n.title == @node.args[0]}
507
+ target = @nodes_by_type['reference'].find {|n| n.title == @node.title }
503
508
 
504
509
  if target
505
510
  '<sup>[%s]</sup>' % [
506
-
507
- '<a class="%s" href="#%s">%s</a>' % [
508
- @node.type,
509
- target.here_frag,
510
- target.number
511
- ],
512
-
511
+ target.xref_link(target.number),
513
512
  *@node.args[1..-1]
514
-
515
513
  ].join(', ')
516
514
  else
517
515
  raise ArgumentError, "invalid citation for #{@node.title.inspect}", @node.trace
@@ -571,7 +569,7 @@ output: |
571
569
  %{<li><a id="#{n.list_frag}" href="##{n.here_frag}">#{n.title.to_s.to_inline_xhtml}</a></li>}
572
570
  end
573
571
 
574
- label = type.capitalize << 's' # TODO: pluralize this properly
572
+ label = ERBook::PHRASES[type.capitalize << 's']
575
573
  lof_sections << label
576
574
 
577
575
  %{#{ERBook::Document::Node.navigation label, "rev:#{label}", nil, nil}<h2 class="title">#{label}</h2> <ol>#{nested}</ol>}
@@ -643,10 +641,10 @@ output: |
643
641
  <%
644
642
  # menu of links to link sections
645
643
  nav = [
646
- ('Abstract' if abstract),
647
- 'Contents',
644
+ (ERBook::PHRASES['Abstract'] if abstract),
645
+ ERBook::PHRASES['Contents'],
648
646
  lof_sections,
649
- ('References' if references)
647
+ (ERBook::PHRASES['References'] if references)
650
648
  ].flatten.compact
651
649
 
652
650
  if nav.length > 1
@@ -708,13 +706,13 @@ output: |
708
706
 
709
707
  <% unless toc.empty? %>
710
708
  <div id="toc">
711
- <%= ERBook::Document::Node.navigation "Contents", "rev:Contents", nil, nil %>
712
- <h1 class="title">Contents</h1>
709
+ <%= ERBook::Document::Node.navigation 'Contents', 'rev:Contents', nil, nil %>
710
+ <h1 class="title"><%= ERBook::PHRASES['Contents'] %></h1>
713
711
  <ul>
714
712
  <%= toc %>
715
713
 
716
714
  <% if references %>
717
- <li><a id="rev:References" href="#References">References</a></li>
715
+ <li><a id="rev:References" href="#References"><%= ERBook::PHRASES['References'] %></a></li>
718
716
  <% end %>
719
717
  </ul>
720
718
  </div>
@@ -732,8 +730,8 @@ output: |
732
730
 
733
731
  <% if references %>
734
732
  <div id="bib">
735
- <%= ERBook::Document::Node.navigation "References", "rev:References", nil, nil %>
736
- <h1 class="title" >References</h1>
733
+ <%= ERBook::Document::Node.navigation 'References', 'rev:References', nil, nil %>
734
+ <h1 class="title"><%= ERBook::PHRASES['References'] %></h1>
737
735
  <ol>
738
736
  <% references.each do |n| %>
739
737
  <li id="<%= n.here_frag %>"><%= n.content_xhtml %></li>
@@ -751,11 +749,20 @@ output: |
751
749
  <%= node = @nodes_by_type['footer_inside_above'].first and node.output %>
752
750
  <% if footer = @nodes_by_type['footer'].first %>
753
751
  <%= footer.content.to_s.to_xhtml %>
754
- <% else %>
755
- Generated by <a href="<%= ERBook::WEBSITE %>"><%= ERBook::DISPLAY %></a> on <%= Time.now %>.
756
- <% end %>
752
+ <%
753
+ else
754
+ ERBook::PHRASES[
755
+ 'Generated by %s on %s.',
756
+ %{<a href="#{ERBook::WEBSITE}">#{ERBook::DISPLAY}</a>},
757
+ Time.now
758
+ ]
759
+ end
760
+ %>
757
761
 
758
762
  <div id="footer-credits">
763
+ <%
764
+ icon_credits = 'The icons shown above are part of %s, which is copyright %s and is distributed under %s.'
765
+ %>
759
766
  <p>
760
767
  <% ICONS.select {|i| i.origin == 'tango' }.each do |icon| %>
761
768
  <%= icon.to_xhtml %>
@@ -763,7 +770,17 @@ output: |
763
770
 
764
771
  <br/>
765
772
 
766
- The icons shown above are &copy; 2005 <a href="http://tango.freedesktop.org">Tango Desktop Project</a>. They are part of the <a href="http://tango.freedesktop.org/Tango_Icon_Library">Tango Icon Theme</a> set, which is distributed under the <a href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License Agreement</a>.
773
+ <%=
774
+ ERBook::PHRASES[
775
+ icon_credits,
776
+
777
+ '<a href="http://tango.freedesktop.org/Tango_Icon_Library">Tango Icon Theme</a>',
778
+
779
+ '&copy; 2005 <a href="http://tango.freedesktop.org">Tango Desktop Project</a>',
780
+
781
+ '<a href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License Agreement</a>'
782
+ ]
783
+ %>
767
784
  </p>
768
785
 
769
786
  <p>
@@ -773,7 +790,17 @@ output: |
773
790
 
774
791
  <br/>
775
792
 
776
- The icons shown above are &copy; 2007 <a href="https://www.ohloh.net/projects/mediawiki/contributors">MediaWiki contributors</a>. They are part of the <a href="http://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a> software, which is distributed under the <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, version 2</a>.
793
+ <%=
794
+ ERBook::PHRASES[
795
+ icon_credits,
796
+
797
+ '<a href="http://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a>',
798
+
799
+ '&copy; 2007 <a href="https://www.ohloh.net/projects/mediawiki/contributors">MediaWiki contributors</a>',
800
+
801
+ '<a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, version 2</a>'
802
+ ]
803
+ %>
777
804
  </p>
778
805
  </div>
779
806
  <%= node = @nodes_by_type['footer_inside_below'].first and node.output %>
@@ -817,7 +844,7 @@ styles:
817
844
  {
818
845
  height : 0;
819
846
  border : 0;
820
- border-top : 2px solid #FF0000;
847
+ border-top : thin dashed #000000;
821
848
  }
822
849
 
823
850
  /* source code */
@@ -1252,7 +1279,7 @@ styles:
1252
1279
  .nav a:link,
1253
1280
  .nav a:visited
1254
1281
  {
1255
- color : #D3D3D3;
1282
+ color : #C0C0C0;
1256
1283
  }
1257
1284
 
1258
1285
  .nav a:hover,
data/lang/de.yaml ADDED
@@ -0,0 +1,33 @@
1
+ # de (German)
2
+ Caution: Vorsicht
3
+ Cautions: Vorsichtsmaßnahmen
4
+ Chapter: Kapitel
5
+ Contents: Inhalt
6
+ Equation: Gleichung
7
+ Equations: Gleichungen
8
+ Example: Beispiel
9
+ Examples: Beispiele
10
+ Figure: Abbildung
11
+ Figures: Abbildungen
12
+ Generated by %s on %s.: Erzeugt durch %s auf %s.
13
+ Important: Wichtig
14
+ Importants: Importants
15
+ Jump to next segment: Springen Sie, um zunächst zu segmentieren
16
+ Jump to previous segment: Springen Sie zum vorhergehenden Segment
17
+ Jump to this segment: Springen Sie zu diesem Segment
18
+ Note: Merken Sie
19
+ Notes: Anmerkungen
20
+ Part: Teil
21
+ Procedure: Verfahren
22
+ Procedures: Verfahren
23
+ Reference: Hinweis
24
+ References: Hinweise
25
+ Reverse jump to listing: Rücksprung zur Auflistung
26
+ Section: Abschnitt
27
+ Table: Tabelle
28
+ Tables: Tabellen
29
+ The icons shown above are part of %s, which is copyright %s and is distributed under %s.: Die Ikonen, die oben gezeigt werden, sind ein Teil %s, das copyright %s ist und unter %s. verteilt wird.
30
+ Tip: Spitze
31
+ Tips: Spitzen
32
+ Warning: Warnung
33
+ Warnings: Warnungen
data/lang/el.yaml ADDED
@@ -0,0 +1,33 @@
1
+ # el (Greek)
2
+ Caution: Προσοχή
3
+ Cautions: Προσοχές
4
+ Chapter: Κεφάλαιο
5
+ Contents: Περιεχόμενο
6
+ Equation: Εξίσωση
7
+ Equations: Εξισώσεις
8
+ Example: Παράδειγμα
9
+ Examples: Παραδείγματα
10
+ Figure: Αριθμός
11
+ Figures: Αριθμοί
12
+ Generated by %s on %s.: Παραγμένος από %s %s.
13
+ Important: Σημαντικός
14
+ Importants: Importants
15
+ Jump to next segment: Άλμα στο επόμενο τμήμα
16
+ Jump to previous segment: Άλμα στο προηγούμενο τμήμα
17
+ Jump to this segment: Άλμα σε αυτό το τμήμα
18
+ Note: Σημείωση
19
+ Notes: Σημειώσεις
20
+ Part: Μέρος
21
+ Procedure: Διαδικασία
22
+ Procedures: Διαδικασίες
23
+ Reference: Αναφορά
24
+ References: Αναφορές
25
+ Reverse jump to listing: Αντίστροφο άλμα στη λίστα
26
+ Section: Τμήμα
27
+ Table: Πίνακας
28
+ Tables: Πίνακες
29
+ The icons shown above are part of %s, which is copyright %s and is distributed under %s.: Τα εικονίδια που παρουσιάζονται ανωτέρω είναι μέρος %s, το οποίο είναι πνευματικά δικαιώματα %s και διανέμεται κάτω από %s.
30
+ Tip: Άκρη
31
+ Tips: Άκρες
32
+ Warning: Προειδοποίηση
33
+ Warnings: Προειδοποιήσεις
data/lang/es.yaml ADDED
@@ -0,0 +1,33 @@
1
+ # es (Spanish)
2
+ Caution: Precaución
3
+ Cautions: Precauciones
4
+ Chapter: Capítulo
5
+ Contents: Contenido
6
+ Equation: Ecuación
7
+ Equations: Ecuaciones
8
+ Example: Ejemplo
9
+ Examples: Ejemplos
10
+ Figure: Figura
11
+ Figures: Figuras
12
+ Generated by %s on %s.: Generado por %s en %s.
13
+ Important: Importante
14
+ Importants: Importants
15
+ Jump to next segment: Salte para dividir en segmentos después
16
+ Jump to previous segment: Salte al segmento anterior
17
+ Jump to this segment: Salte a este segmento
18
+ Note: Observe
19
+ Notes: Notas
20
+ Part: Parte
21
+ Procedure: Procedimiento
22
+ Procedures: Procedimientos
23
+ Reference: Referencia
24
+ References: Referencias
25
+ Reverse jump to listing: Salto reverso al listado
26
+ Section: Sección
27
+ Table: Tabla
28
+ Tables: Tablas
29
+ The icons shown above are part of %s, which is copyright %s and is distributed under %s.: Los iconos demostrados arriba son parte de %s, que es los derechos reservados %s y se distribuye debajo de %s.
30
+ Tip: Extremidad
31
+ Tips: Extremidades
32
+ Warning: Advertencia
33
+ Warnings: Advertencias
data/lang/fr.yaml ADDED
@@ -0,0 +1,33 @@
1
+ # fr (French)
2
+ Caution: Attention
3
+ Cautions: Attentions
4
+ Chapter: Chapitre
5
+ Contents: Contenu
6
+ Equation: Équation
7
+ Equations: Équations
8
+ Example: Exemple
9
+ Examples: Exemples
10
+ Figure: Figure
11
+ Figures: Figures
12
+ Generated by %s on %s.: Produit par %s sur %s.
13
+ Important: Important
14
+ Importants: Importants
15
+ Jump to next segment: Sautez pour segmenter après
16
+ Jump to previous segment: Sautez au segment précédent
17
+ Jump to this segment: Sautez à ce segment
18
+ Note: Notez
19
+ Notes: Notes
20
+ Part: Partie
21
+ Procedure: Procédé
22
+ Procedures: Procédures
23
+ Reference: Référence
24
+ References: Références
25
+ Reverse jump to listing: Saut renversé à la liste
26
+ Section: Section
27
+ Table: Tableau
28
+ Tables: Tableaux
29
+ The icons shown above are part of %s, which is copyright %s and is distributed under %s.: Les icônes montrées ci-dessus font partie de %s, qui est copyright %s et est distribué sous %s.
30
+ Tip: Bout
31
+ Tips: Bouts
32
+ Warning: Avertissement
33
+ Warnings: Avertissements
data/lang/it.yaml ADDED
@@ -0,0 +1,33 @@
1
+ # it (Italian)
2
+ Caution: Attenzione
3
+ Cautions: Avvertenze
4
+ Chapter: Capitolo
5
+ Contents: Soddisfare
6
+ Equation: Equazione
7
+ Equations: Equazioni
8
+ Example: Esempio
9
+ Examples: Esempi
10
+ Figure: Figura
11
+ Figures: Figure
12
+ Generated by %s on %s.: Generato da %s su %s.
13
+ Important: Importante
14
+ Importants: Importants
15
+ Jump to next segment: Salti dopo per suddividersi
16
+ Jump to previous segment: Salti al segmento precedente
17
+ Jump to this segment: Salti a questo segmento
18
+ Note: Noti
19
+ Notes: Note
20
+ Part: Parte
21
+ Procedure: Procedura
22
+ Procedures: Procedure
23
+ Reference: Riferimento
24
+ References: Riferimenti
25
+ Reverse jump to listing: Salto d'inversione all'elenco
26
+ Section: Sezione
27
+ Table: Tabella
28
+ Tables: Tabelle
29
+ The icons shown above are part of %s, which is copyright %s and is distributed under %s.: Le icone indicate sopra fa parte di %s, che è copyright %s e si distribuisce sotto %s.
30
+ Tip: Punta
31
+ Tips: Punte
32
+ Warning: Avvertimento
33
+ Warnings: Avvertimenti