Add documentation page for the compiler

This commit is contained in:
Adam Sapek 2015-03-24 22:43:56 -07:00
Родитель 15210207ea
Коммит df910f48d3
6 изменённых файлов: 41 добавлений и 8 удалений

Просмотреть файл

@ -0,0 +1,2 @@
<style type="text/css"> table.cmdargs td { max-width: 420px; } </style>

Просмотреть файл

@ -26,7 +26,7 @@ $endif$
} }
td.lineNumbers { width: 40px; } td.lineNumbers { width: 40px; }
div#all { div#all {
width: 1120px; max-width: 1120px;
background-color: #ffffff; background-color: #ffffff;
margin: 0 auto; margin: 0 auto;
padding: 25px; padding: 25px;
@ -50,17 +50,21 @@ $endif$
border-bottom: 1px solid black; border-bottom: 1px solid black;
} }
div.sourceCode {
overflow-x: auto;
}
#toc { #toc {
width: 300px; width: 300px;
position:fixed; position:fixed;
overflow: auto; overflow: auto;
height: 100%; height: 95%;
} }
#main { #main {
margin-left: auto; margin-left: 320px;
margin-right: auto; margin-rigth: auto;
width: 800px; max-width: 800px;
} }
a { a {
text-decoration: none; text-decoration: none;
@ -74,6 +78,15 @@ $endif$
a:link { a:link {
color: #36c; color: #36c;
} }
@media screen and (max-width: 979px){
#main {
margin-left: auto;
margin-right: auto;
}
#toc {
left: -300px;
}
}
</style> </style>
$for(css)$ $for(css)$
<link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/> <link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/>

Просмотреть файл

@ -54,13 +54,26 @@ endfunction()
find_haskell_program (pandoc) find_haskell_program (pandoc)
if (Haskell_PANDOC_EXECUTABLE) if (Haskell_PANDOC_EXECUTABLE)
add_custom_target (documentation) add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/manual/gbc.html"
COMMAND ${CMAKE_COMMAND} -E copy .pandoc/templates/cmdargs.html "${CMAKE_CURRENT_BINARY_DIR}/html/manual/gbc.html"
COMMAND ${GBC_EXECUTABLE} --help=html >> "${CMAKE_CURRENT_BINARY_DIR}/html/manual/gbc.html"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS .pandoc/templates/cmdargs.html ${GBC_EXECUTABLE})
add_custom_target (documentation
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/manual/gbc.html")
add_pandoc_markdown (src/bond_py.md src/bond_cpp.md add_pandoc_markdown (src/bond_py.md src/bond_cpp.md
CODE "cpp,numberLines" CODE "cpp,numberLines"
OPTIONS --self-contained --table-of-contents OPTIONS --self-contained --table-of-contents
OUTPUT_DIR manual) OUTPUT_DIR manual)
add_pandoc_markdown (src/compiler.md
CODE "javascript"
OPTIONS --self-contained --table-of-contents
OUTPUT_DIR manual)
add_pandoc_markdown (src/bond_cs.md add_pandoc_markdown (src/bond_cs.md
CODE "cs,numberLines" CODE "cs,numberLines"
OPTIONS --self-contained --table-of-contents OPTIONS --self-contained --table-of-contents

Просмотреть файл

@ -32,7 +32,7 @@ In Bond data schemas are defined using idl-like [syntax](#idl-syntax):
} }
In order to use the schema in a C++ program, it needs to be compiled using the In order to use the schema in a C++ program, it needs to be compiled using the
Bond compiler [`gbc`](gbc.html). This step is sometimes also referred to as Bond compiler [`gbc`](compiler.html). This step is sometimes also referred to as
code generation (or codegen) because the compilation generates C++ code code generation (or codegen) because the compilation generates C++ code
corresponding to the schema definition. corresponding to the schema definition.

Просмотреть файл

@ -79,7 +79,7 @@ Code generation
=============== ===============
In order to use a Bond schema in a C# program, it needs to be compiled using In order to use a Bond schema in a C# program, it needs to be compiled using
the Bond compiler [`gbc`](gbc.html). The compiler generates C# classes that the Bond compiler [`gbc`](compiler.html). The compiler generates C# classes that
represent the schema. By default schema fields are represented by public represent the schema. By default schema fields are represented by public
auto-properties initialized in the default constructor. Code generation can be auto-properties initialized in the default constructor. Code generation can be
customized by passing one or more of the following command line options to customized by passing one or more of the following command line options to

5
doc/src/compiler.md Normal file
Просмотреть файл

@ -0,0 +1,5 @@
Command line options
====================
<div class="sourceCode"><object width="702" height="1000" data="gbc.html"/></div>