diff --git a/doc/qbk/0.main.qbk b/doc/qbk/0.main.qbk index 0934db44..42c92ad8 100644 --- a/doc/qbk/0.main.qbk +++ b/doc/qbk/0.main.qbk @@ -110,6 +110,8 @@ [/-----------------------------------------------------------------------------] +[import ../../example/magnet/magnet.cpp] +[import ../../example/route/route.cpp] [import ../../test/unit/snippets.cpp] [/-----------------------------------------------------------------------------] @@ -133,8 +135,8 @@ [endsect] [include 6.0.grammar.qbk] - [include 7.0.concepts.qbk] +[include 8.0.examples.qbk] [section:ref Reference] [xinclude quickref.xml] diff --git a/doc/qbk/8.0.examples.qbk b/doc/qbk/8.0.examples.qbk new file mode 100644 index 00000000..87edc5d7 --- /dev/null +++ b/doc/qbk/8.0.examples.qbk @@ -0,0 +1,24 @@ +[/ + Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + Official repository: https://github.com/cppalliance/json +] + +[/-----------------------------------------------------------------------------] + +[section Examples] +[block''''''] + +[section Magnet Link] +[example_magnet] +[endsect] + +[section Route] +[example_route] +[endsect] + +[endsect] + diff --git a/example/magnet/magnet.cpp b/example/magnet/magnet.cpp index 499d802b..089e72bd 100644 --- a/example/magnet/magnet.cpp +++ b/example/magnet/magnet.cpp @@ -5,6 +5,15 @@ // https://www.boost.org/LICENSE_1_0.txt // +//[example_magnet + +/* + This example parses a magnet link into a new + view type and prints its components to + standard output. +*/ + + #include #include #include @@ -719,3 +728,5 @@ int main(int argc, char** argv) return EXIT_SUCCESS; } + +//] diff --git a/example/route/route.cpp b/example/route/route.cpp index 5ceb408b..3e6016e2 100644 --- a/example/route/route.cpp +++ b/example/route/route.cpp @@ -7,6 +7,17 @@ // Official repository: https://github.com/CppAlliance/url // +//[example_route + +/* + This example defines a route for a URL path. + If the specified route matches and the file + exists, the example prints its contents to + standard output. +*/ + + + #include #include #include @@ -191,3 +202,5 @@ main(int argc, char **argv) return EXIT_FAILURE; } } + +//]