diff --git a/doc/.pandoc/templates/cmdargs.html b/doc/.pandoc/templates/cmdargs.html new file mode 100644 index 00000000..87a0e69b --- /dev/null +++ b/doc/.pandoc/templates/cmdargs.html @@ -0,0 +1,2 @@ + + diff --git a/doc/.pandoc/templates/index.html b/doc/.pandoc/templates/index.html index 45ac4681..ce05901c 100644 --- a/doc/.pandoc/templates/index.html +++ b/doc/.pandoc/templates/index.html @@ -26,7 +26,7 @@ $endif$ } td.lineNumbers { width: 40px; } div#all { - width: 1120px; + max-width: 1120px; background-color: #ffffff; margin: 0 auto; padding: 25px; @@ -50,17 +50,21 @@ $endif$ border-bottom: 1px solid black; } + div.sourceCode { + overflow-x: auto; + } + #toc { width: 300px; position:fixed; overflow: auto; - height: 100%; + height: 95%; } #main { - margin-left: auto; - margin-right: auto; - width: 800px; + margin-left: 320px; + margin-rigth: auto; + max-width: 800px; } a { text-decoration: none; @@ -74,6 +78,15 @@ $endif$ a:link { color: #36c; } + @media screen and (max-width: 979px){ + #main { + margin-left: auto; + margin-right: auto; + } + #toc { + left: -300px; + } + } $for(css)$ diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 5c0bcac7..271d15ec 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -54,13 +54,26 @@ endfunction() find_haskell_program (pandoc) 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 CODE "cpp,numberLines" OPTIONS --self-contained --table-of-contents 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 CODE "cs,numberLines" OPTIONS --self-contained --table-of-contents diff --git a/doc/src/bond_cpp.md b/doc/src/bond_cpp.md index 3b656496..c730849d 100644 --- a/doc/src/bond_cpp.md +++ b/doc/src/bond_cpp.md @@ -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 -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 corresponding to the schema definition. diff --git a/doc/src/bond_cs.md b/doc/src/bond_cs.md index a783fcfb..08c7e7b0 100644 --- a/doc/src/bond_cs.md +++ b/doc/src/bond_cs.md @@ -79,7 +79,7 @@ Code generation =============== 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 auto-properties initialized in the default constructor. Code generation can be customized by passing one or more of the following command line options to diff --git a/doc/src/compiler.md b/doc/src/compiler.md new file mode 100644 index 00000000..0562eae4 --- /dev/null +++ b/doc/src/compiler.md @@ -0,0 +1,5 @@ +Command line options +==================== + +
+