#
# Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
# Copyright (c) 2021 Dmitry Arkhipov (grisumbras@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)
#

project beast/doc ;

import boostbook ;
import type ;
import ../../../tools/docca/docca.jam ;


if ! [ type.registered IPP ]
{
    type.register IPP : ipp : HPP ;
}


docca.reference reference.qbk
    :
        xsl/custom-overrides.xsl
        [ glob-tree-ex ../include/boost/beast : *.hpp *.ipp : detail impl unit_test ]
    :
        <doxygen:param>PROJECT_NAME=Beast
        <doxygen:param>PROJECT_BRIEF="C++ Networking Library"
        <doxygen:param>ALIASES="esafe=\"@par Exception Safety\""
        <doxygen:param>FILE_PATTERNS=
        <doxygen:param>EXAMPLE_PATTERNS=
        <doxygen:param>DISTRIBUTE_GROUP_DOC=YES
        <doxygen:param>MACRO_EXPANSION=YES
        <doxygen:param>EXPAND_ONLY_PREDEF=YES
        <doxygen:param>PREDEFINED="\\
            BOOST_BEAST_DOXYGEN \\
            BOOST_BEAST_USE_POSIX_FILE=1 \\
            BOOST_BEAST_USE_WIN32_FILE=1 \\
            BOOST_BEAST_SPLIT_COMPILATION=1 \\
            \"BOOST_BEAST_ASYNC_RESULT1(t)=__deduced__\" \\
            \"BOOST_BEAST_ASYNC_RESULT2(t)=__deduced__\" \\
            \"BOOST_BEAST_ASYNC_TPARAM1=class\" \\
            \"BOOST_BEAST_ASYNC_TPARAM2=class\" \\
            \"BOOST_ASIO_INITFN_RESULT_TYPE(t,a)=__deduced__\" \\
            \"BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(e)= =__deduced__\" \\
            \"BOOST_ASIO_COMPLETION_TOKEN_FOR(sig)=class\" \\
            GENERATING_DOCUMENTATION \\
            BOOST_BEAST_DECL"
        <doxygen:param>ABBREVIATE_BRIEF=
        <doxygen:param>INLINE_INHERITED_MEMB=YES
        <doxygen:param>JAVADOC_AUTOBRIEF=YES
        <doxygen:param>EXTRACT_ALL=YES
        <doxygen:param>EXTRACT_PRIVATE=YES
        <doxygen:param>EXTRACT_LOCAL_CLASSES=NO
        <doxygen:param>SHOW_INCLUDE_FILES=NO
        <doxygen:param>INLINE_INFO=NO
        <doxygen:param>SORT_MEMBER_DOCS=NO
        <doxygen:param>SORT_MEMBERS_CTORS_1ST=YES
        <doxygen:param>SHOW_USED_FILES=NO
        <doxygen:param>SHOW_FILES=NO
        <doxygen:param>SHOW_NAMESPACES=NO
        <doxygen:param>CLASS_DIAGRAMS=NO

        # <doxygen:param>ALLOW_UNICODE_NAMES=NO
        # <doxygen:param>GROUP_NESTED_COMPOUNDS=NO
        # <doxygen:param>HIDE_COMPOUND_REFERENCE=NO
        # <doxygen:param>WARN_AS_ERROR=NO
    ;


#-------------------------------------------------------------------------------
#
# Produce the Boost.Book XML from the QuickBook
#

install images
    :
        images/message.png
    :
        <location>html/beast/images
    ;

explicit images ;

xml beast_doc
    :
        qbk/main.qbk
    :
        <dependency>images
        <dependency>reference.qbk
    ;

explicit beast_doc ;

#-------------------------------------------------------------------------------
#
# HTML documentation for $(BOOST_ROOT)/doc/html
#
#-------------------------------------------------------------------------------

boostbook beast
    :
        beast_doc
    :
        <xsl:param>boost.root=../../../..
        <xsl:param>chapter.autolabel=1
        <xsl:param>chunk.section.depth=8                # Depth to which sections should be chunked
        <xsl:param>chunk.first.sections=1               # Chunk the first top-level section?
        <xsl:param>toc.section.depth=8                  # How deep should recursive sections appear in the TOC?
        <xsl:param>toc.max.depth=8                      # How many levels should be created for each TOC?
        <xsl:param>generate.section.toc.level=8         # Control depth of TOC generation in sections
        <xsl:param>generate.toc="chapter toc,title section nop reference nop"
        <include>../../../tools/boostbook/dtd
    :
        <dependency>images
    ;

#-------------------------------------------------------------------------------
#
# These are used to inform the build system of the
# means to build the integrated and stand-alone docs.
#

alias boostdoc ;
explicit boostdoc ;

alias boostrelease : beast ;
explicit boostrelease ;
