mirror of
https://github.com/fmtlib/fmt.git
synced 2025-02-20 18:40:44 +00:00
Use newer versions of Sphinx and Breathe
This commit is contained in:
parent
038057eb3e
commit
ffa0a0834a
39
doc/api.rst
39
doc/api.rst
@ -45,21 +45,24 @@ participate in an overload resolution if the latter is not a string.
|
|||||||
|
|
||||||
.. _format:
|
.. _format:
|
||||||
|
|
||||||
.. doxygenfunction:: format(const S&, Args&&...)
|
.. doxygenfunction:: format(const S &format_str, Args&&... args)
|
||||||
.. doxygenfunction:: vformat(const S&, basic_format_args<buffer_context<type_identity_t<Char>>>)
|
.. doxygenfunction:: vformat(const S &format_str, basic_format_args<buffer_context<type_identity_t<Char>>> args)
|
||||||
|
|
||||||
.. doxygenfunction:: fmt::format_to(OutputIt, const S&, Args&&...)
|
.. doxygenfunction:: format_to(OutputIt out, const S &, Args&&... args)
|
||||||
.. doxygenfunction:: fmt::format_to_n(OutputIt, size_t, const S&, const Args&...)
|
.. doxygenfunction:: format_to_n(OutputIt out, size_t n, const S&, const Args&... args)
|
||||||
.. doxygenfunction:: fmt::formatted_size(string_view, Args&&...)
|
.. doxygenfunction:: formatted_size(string_view format_str, Args&&... args)
|
||||||
|
|
||||||
.. _print:
|
.. _print:
|
||||||
|
|
||||||
.. doxygenfunction:: print(const S&, Args&&...)
|
.. doxygenfunction:: print(string_view format_str, const Args&... args)
|
||||||
.. doxygenfunction:: vprint(string_view, format_args)
|
.. doxygenfunction:: vprint(string_view, format_args)
|
||||||
|
|
||||||
.. doxygenfunction:: print(std::FILE *, const S&, Args&&...)
|
.. doxygenfunction:: print(std::FILE*, string_view, format_args)
|
||||||
.. doxygenfunction:: vprint(std::FILE *, string_view, format_args)
|
.. doxygenfunction:: vprint(std::FILE *, string_view, format_args)
|
||||||
|
|
||||||
|
.. doxygenstruct:: fmt::format_to_n_result
|
||||||
|
:members:
|
||||||
|
|
||||||
Named Arguments
|
Named Arguments
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
@ -286,14 +289,6 @@ conversion.
|
|||||||
.. doxygenclass:: fmt::basic_format_parse_context
|
.. doxygenclass:: fmt::basic_format_parse_context
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
Output Iterator Support
|
|
||||||
-----------------------
|
|
||||||
|
|
||||||
.. doxygenfunction:: fmt::format_to(OutputIt, const S&, Args&&...)
|
|
||||||
.. doxygenfunction:: fmt::format_to_n(OutputIt, size_t, const S&, const Args&...)
|
|
||||||
.. doxygenstruct:: fmt::format_to_n_result
|
|
||||||
:members:
|
|
||||||
|
|
||||||
Literal-based API
|
Literal-based API
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
@ -310,19 +305,19 @@ Utilities
|
|||||||
|
|
||||||
.. doxygentypedef:: fmt::char_t
|
.. doxygentypedef:: fmt::char_t
|
||||||
|
|
||||||
.. doxygenfunction:: fmt::ptr(const T *)
|
.. doxygenfunction:: fmt::ptr(const T *p)
|
||||||
.. doxygenfunction:: fmt::ptr(const std::unique_ptr<T>&)
|
.. doxygenfunction:: fmt::ptr(const std::unique_ptr<T> &p)
|
||||||
.. doxygenfunction:: fmt::ptr(const std::shared_ptr<T>&)
|
.. doxygenfunction:: fmt::ptr(const std::shared_ptr<T> &p)
|
||||||
|
|
||||||
.. doxygenfunction:: fmt::to_string(const T&)
|
.. doxygenfunction:: fmt::to_string(const T &value)
|
||||||
|
|
||||||
.. doxygenfunction:: fmt::to_wstring(const T&)
|
.. doxygenfunction:: fmt::to_wstring(const T &value)
|
||||||
|
|
||||||
.. doxygenfunction:: fmt::to_string_view(const Char *)
|
.. doxygenfunction:: fmt::to_string_view(const Char *)
|
||||||
|
|
||||||
.. doxygenfunction:: fmt::join(Range&&, string_view)
|
.. doxygenfunction:: fmt::join(Range &&range, string_view sep)
|
||||||
|
|
||||||
.. doxygenfunction:: fmt::join(It, Sentinel, string_view)
|
.. doxygenfunction:: fmt::join(It begin, Sentinel end, string_view sep)
|
||||||
|
|
||||||
.. doxygenclass:: fmt::detail::buffer
|
.. doxygenclass:: fmt::detail::buffer
|
||||||
:members:
|
:members:
|
||||||
|
64
doc/build.py
64
doc/build.py
@ -1,53 +1,31 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
# Build the documentation.
|
# Build the documentation.
|
||||||
|
|
||||||
from __future__ import print_function
|
import errno, os, re, sys
|
||||||
import errno, os, re, shutil, sys, tempfile
|
from subprocess import check_call, CalledProcessError, Popen, PIPE, STDOUT
|
||||||
from subprocess import check_call, check_output, CalledProcessError, Popen
|
|
||||||
from subprocess import PIPE, STDOUT
|
|
||||||
from distutils.version import LooseVersion
|
|
||||||
|
|
||||||
versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0', '6.2.1', '7.0.0', '7.0.1', '7.0.2', '7.0.3', '7.1.0', '7.1.1', '7.1.2']
|
versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0', '6.2.1', '7.0.0', '7.0.1', '7.0.2', '7.0.3', '7.1.0', '7.1.1', '7.1.2']
|
||||||
|
|
||||||
def pip_install(package, commit=None, **kwargs):
|
class Pip:
|
||||||
"Install package using pip."
|
def __init__(self, venv_dir):
|
||||||
if commit:
|
self.path = os.path.join(venv_dir, 'bin', 'pip')
|
||||||
package = 'git+https://github.com/{0}.git@{1}'.format(package, commit)
|
|
||||||
print('Installing {0}'.format(package))
|
|
||||||
check_call(['pip', 'install', package])
|
|
||||||
|
|
||||||
def create_build_env(dirname='virtualenv'):
|
def install(self, package, commit=None):
|
||||||
|
"Install package using pip."
|
||||||
|
if commit:
|
||||||
|
package = 'git+https://github.com/{0}.git@{1}'.format(package, commit)
|
||||||
|
print('Installing {0}'.format(package))
|
||||||
|
check_call([self.path, 'install', package])
|
||||||
|
|
||||||
|
def create_build_env(venv_dir='virtualenv'):
|
||||||
# Create virtualenv.
|
# Create virtualenv.
|
||||||
if not os.path.exists(dirname):
|
if not os.path.exists(venv_dir):
|
||||||
check_call(['virtualenv', dirname])
|
check_call(['python3', '-m', 'venv', venv_dir])
|
||||||
import sysconfig
|
|
||||||
scripts_dir = os.path.basename(sysconfig.get_path('scripts'))
|
|
||||||
activate_this_file = os.path.join(dirname, scripts_dir, 'activate_this.py')
|
|
||||||
with open(activate_this_file) as f:
|
|
||||||
exec(f.read(), dict(__file__=activate_this_file))
|
|
||||||
# Import get_distribution after activating virtualenv to get info about
|
|
||||||
# the correct packages.
|
|
||||||
from pkg_resources import get_distribution, DistributionNotFound
|
|
||||||
# Upgrade pip because installation of sphinx with pip 1.1 available on Travis
|
|
||||||
# is broken (see #207) and it doesn't support the show command.
|
|
||||||
pip_version = get_distribution('pip').version
|
|
||||||
if LooseVersion(pip_version) < LooseVersion('1.5.4'):
|
|
||||||
print("Updating pip")
|
|
||||||
check_call(['pip', 'install', '--upgrade', 'pip'])
|
|
||||||
# Upgrade distribute because installation of sphinx with distribute 0.6.24
|
|
||||||
# available on Travis is broken (see #207).
|
|
||||||
try:
|
|
||||||
distribute_version = get_distribution('distribute').version
|
|
||||||
if LooseVersion(distribute_version) <= LooseVersion('0.6.24'):
|
|
||||||
print("Updating distribute")
|
|
||||||
check_call(['pip', 'install', '--upgrade', 'distribute'])
|
|
||||||
except DistributionNotFound:
|
|
||||||
pass
|
|
||||||
# Install Sphinx and Breathe. Require the exact version of Sphinx which is
|
# Install Sphinx and Breathe. Require the exact version of Sphinx which is
|
||||||
# compatible with Breathe.
|
# compatible with Breathe.
|
||||||
pip_install('sphinx-doc/sphinx', '12b83372ac9316e8cbe86e7fed889296a4cc29ee')
|
pip = Pip(venv_dir)
|
||||||
pip_install('michaeljones/breathe',
|
pip.install('sphinx-doc/sphinx', 'v3.3.0')
|
||||||
'129222318f7c8f865d2631e7da7b033567e7f56a')
|
pip.install('michaeljones/breathe', 'v4.23.0')
|
||||||
|
|
||||||
def build_docs(version='dev', **kwargs):
|
def build_docs(version='dev', **kwargs):
|
||||||
doc_dir = kwargs.get('doc_dir', os.path.dirname(os.path.realpath(__file__)))
|
doc_dir = kwargs.get('doc_dir', os.path.dirname(os.path.realpath(__file__)))
|
||||||
@ -84,7 +62,7 @@ def build_docs(version='dev', **kwargs):
|
|||||||
"FMT_BEGIN_NAMESPACE=namespace fmt {{" \
|
"FMT_BEGIN_NAMESPACE=namespace fmt {{" \
|
||||||
"FMT_END_NAMESPACE=}}" \
|
"FMT_END_NAMESPACE=}}" \
|
||||||
"FMT_STRING_ALIAS=1" \
|
"FMT_STRING_ALIAS=1" \
|
||||||
"FMT_ENABLE_IF(B)="
|
"FMT_DOC=1"
|
||||||
EXCLUDE_SYMBOLS = fmt::formatter fmt::printf_formatter fmt::arg_join \
|
EXCLUDE_SYMBOLS = fmt::formatter fmt::printf_formatter fmt::arg_join \
|
||||||
fmt::basic_format_arg::handle
|
fmt::basic_format_arg::handle
|
||||||
'''.format(include_dir, doxyxml_dir).encode('UTF-8'))
|
'''.format(include_dir, doxyxml_dir).encode('UTF-8'))
|
||||||
@ -107,7 +85,7 @@ def build_docs(version='dev', **kwargs):
|
|||||||
|
|
||||||
html_dir = os.path.join(work_dir, 'html')
|
html_dir = os.path.join(work_dir, 'html')
|
||||||
main_versions = reversed(versions[-3:])
|
main_versions = reversed(versions[-3:])
|
||||||
check_call(['sphinx-build',
|
check_call([os.path.join('virtualenv', 'bin', 'sphinx-build'),
|
||||||
'-Dbreathe_projects.format=' + os.path.abspath(doxyxml_dir),
|
'-Dbreathe_projects.format=' + os.path.abspath(doxyxml_dir),
|
||||||
'-Dversion=' + version, '-Drelease=' + version,
|
'-Dversion=' + version, '-Drelease=' + version,
|
||||||
'-Aversion=' + version, '-Aversions=' + ','.join(main_versions),
|
'-Aversion=' + version, '-Aversions=' + ','.join(main_versions),
|
||||||
|
@ -274,7 +274,11 @@ struct monostate {};
|
|||||||
// An enable_if helper to be used in template parameters which results in much
|
// An enable_if helper to be used in template parameters which results in much
|
||||||
// shorter symbols: https://godbolt.org/z/sWw4vP. Extra parentheses are needed
|
// shorter symbols: https://godbolt.org/z/sWw4vP. Extra parentheses are needed
|
||||||
// to workaround a bug in MSVC 2019 (see #1140 and #1186).
|
// to workaround a bug in MSVC 2019 (see #1140 and #1186).
|
||||||
#define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0
|
#ifdef FMT_DOC
|
||||||
|
# define FMT_ENABLE_IF(...)
|
||||||
|
#else
|
||||||
|
# define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user