From 5473563e9af0abbc81a3cfd7079c34fbc75dfdb4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Jun 2012 15:39:55 +0200 Subject: Fix documentation stylesheet --- doc/default.css | 9 +++++--- doc/guide/index.xhtml | 62 +++++++++++++++++++++++++-------------------------- 2 files changed, 37 insertions(+), 34 deletions(-) (limited to 'doc') diff --git a/doc/default.css b/doc/default.css index bb3805b..c73bb8d 100644 --- a/doc/default.css +++ b/doc/default.css @@ -177,7 +177,6 @@ ul.multiline li, ol.multiline li, dl.multiline dd { } - /* C++ code snippet */ pre.cxx { margin-top : 0em; @@ -186,7 +185,13 @@ pre.cxx { margin-left : 1em; } +/* CLI code snippet */ +pre.cli { + margin-top : 0em; + margin-bottom : 2em; + margin-left : 1em; +} /* make code snippet */ pre.make { @@ -196,8 +201,6 @@ pre.make { margin-left : 1em; } - - /* terminal output */ pre.term { margin-top : 0em; diff --git a/doc/guide/index.xhtml b/doc/guide/index.xhtml index 1e85997..823abda 100644 --- a/doc/guide/index.xhtml +++ b/doc/guide/index.xhtml @@ -259,7 +259,7 @@

We can now write a description of the above command line interface in the CLI language and save it into hello.cli:

-
+  
 include <string>;
 
 class options
@@ -284,7 +284,7 @@ class options
      a command prompt (Windows):
   

-
+  
 $ cli hello.cli
   
@@ -298,7 +298,7 @@ $ cli hello.cli

The following code fragment is taken from hello.hxx; it should give you an idea about what gets generated:

-
+  
 #include <string>
 
 class options
@@ -336,7 +336,7 @@ private:
   

At this point we have everything we need to implement our application:

-
+  
 #include <iostream>
 #include "hello.hxx"
 
@@ -407,7 +407,7 @@ main (int argc, char* argv[])
      driver.cxx, we are ready to build and run our program.
      On UNIX this can be done with the following commands:

-
+  
 $ c++ -o driver driver.cxx hello.cxx
 
 $ ./driver world
@@ -420,7 +420,7 @@ Hi, Jane!!!
 
   

We can also test the error handling:

-
+  
 $ ./driver -n 3 Jane
 unknown option '-n'
 usage: driver [options] <names>
@@ -446,7 +446,7 @@ options:
      information is very basic and does not include any description of
      the purpose of each option:

-
+  
 $ ./driver --help
 usage: driver [options] <names>
 options:
@@ -460,7 +460,7 @@ options:
      also be used to automatically generate program documentation in various
      formats, such as HTML and man page. For example:

-
+  
 include <string>;
 
 class options
@@ -485,7 +485,7 @@ class options
      hello.cli and recompile our application, the usage
      information printed by the program will look like this:

-
+  
 usage: driver [options] <names>
 options:
 --help               Print usage information and exit.
@@ -499,7 +499,7 @@ options:
      (--generate-html CLI option) and man page
      (--generate-man CLI option) formats. For example:

-
+  
 $ cli --generate-html hello.cli
   
@@ -546,7 +546,7 @@ $ cli --generate-html hello.cli option class contains one or more option definitions, for example:

-
+  
 class options
 {
   bool --help;
@@ -557,7 +557,7 @@ class options
   

If we translate the above CLI fragment to C++, we will get a C++ class with the following interface:

-
+  
 class options
 {
 public:
@@ -640,7 +640,7 @@ public:
      is part of the generated CLI runtime support code. It has the
      following interface:

-
+  
 namespace cli
 {
   class unknown_mode
@@ -673,7 +673,7 @@ namespace cli
      of the generated CLI runtime support code and has the following
      abstract interface:

-
+  
 namespace cli
 {
   class scanner
@@ -700,7 +700,7 @@ namespace cli
      array (it is used internally by all the other constructors) and has the
      following interface:

-
+  
 namespace cli
 {
   class argv_scanner
@@ -724,7 +724,7 @@ namespace cli
      --generate-file-scanner CLI compiler option and has
      the following interface:

-
+  
 namespace cli
 {
   class argv_file_scanner
@@ -821,7 +821,7 @@ namespace cli
   

The exceptions described above are part of the generated CLI runtime support code and have the following interfaces:

-
+  
 #include <exception>
 
 namespace cli
@@ -970,7 +970,7 @@ namespace cli
    characters in other places with underscores. For example, the following
    option definition:

-
+  
 class options
 {
   int --compression-level | --comp | -c;
@@ -979,7 +979,7 @@ class options
 
   

Will result in the following accessor function:

-
+  
 class options
 {
   int
@@ -993,7 +993,7 @@ class options
   

If the option name conflicts with one of the CLI language keywords, it can be specified as a string literal:

-
+  
 class options
 {
   bool "int";
@@ -1012,7 +1012,7 @@ class options
      that the constructor initialization can be used with multiple arguments,
      for example:

-
+  
 include <string>;
 
 class options
@@ -1030,7 +1030,7 @@ class options
      as identifiers. For more complex expressions use the constructor
      initialization or wrap the expressions in parenthesis, for example:

-
+  
 include "constants.hxx"; // Defines default_value.
 
 class options
@@ -1055,7 +1055,7 @@ class options
      duplicates while std::set will contain all the unique
      values. For example:

-
+  
 include <set>;
 include <vector>;
 
@@ -1078,7 +1078,7 @@ class options
      by =. All the option values are then parsed into key/value
      pairs and inserted into the map. For example:

-
+  
 include <map>;
 include <string>;
 
@@ -1101,7 +1101,7 @@ class options
      it is enclosed in {} and consists of one or more
      documentation strings separated by a comma, for example:

-
+  
 class options
 {
   int --compression = 5
@@ -1151,7 +1151,7 @@ class options
      level. Here is another example using the
      std::map type:

-
+  
 include <map>;
 include <string>;
 
@@ -1187,7 +1187,7 @@ class options
      \c{int a[] = {1, 2\}}. The following example shows how we
      can use these mechanisms:

-
+  
 class options
 {
   int --compression = 5
@@ -1223,7 +1223,7 @@ class options
      in the generated C++ header file. For example, the following CLI
      definition:

-
+  
 include <string>;
 include "types.hxx"; // Defines the name_type class.
 
@@ -1236,7 +1236,7 @@ class options
 
   

Will result in the following C++ header file:

-
+  
 #include <string>
 #include "types.hxx"
 
@@ -1263,7 +1263,7 @@ class options
   

Option classes can be placed into namespaces which are translated directly to C++ namespaces. For example:

-
+  
 namespace compiler
 {
   namespace lexer
@@ -1295,7 +1295,7 @@ namespace compiler
   

The above CLI namespace structure would result in the equivalent C++ namespaces structure:

-
+  
 namespace compiler
 {
   namespace lexer
-- 
cgit v1.1