diff --git a/docs/README.md b/docs/README.md index 4cd8238..f561b15 100644 --- a/docs/README.md +++ b/docs/README.md @@ -219,40 +219,39 @@ __barkeep__ also has [python bindings](https://pypi.python.org/pypi/barkeep). -
-
- - Detail: IterableBar starts the display not at the time of construction, ... - - - ... but at the time of the first call to `begin()`. - Thus, it is possible to set it up prior to loop execution. - - Similarly, it ends the display not at the time of destruction, but at the - first increment of the iterator past the end. Thus, even if the object stays - alive after the loop, the display will be stopped. - - Therefore, you could initialize it earlier than the loop execution, and destroy - it late afterwards: - - ```cpp - std::vector v(300, 0); - std::iota(v.begin(), v.end(), 1); // 1, 2, 3, ..., 300 - float sum = 0; - bk::IterableBar bar(v, {.message = "Summing", .interval = .02}); - // <-- At this point, display is not yet shown. - // Thus, more work can be done here. - for (auto x : bar) { // <-- Display starts showing. - std::this_thread::sleep_for(1.s/x); - sum += x; - } - // <-- Display stops here even if `bar` object is still alive. - // Thus, more work can be done here. - std::cout << "Sum: " << sum << std::endl; - ``` - -
-
+ > [!NOTE] + >
+ > + > Detail: IterableBar starts the display not at the time of construction, ... + > + > + > ... but at the time of the first call to `begin()`. + > Thus, it is possible to set it up prior to loop execution. + > + > Similarly, it ends the display not at the time of destruction, but at the + > first increment of the iterator past the end. Thus, even if the object stays + > alive after the loop, the display will be stopped. + > + > Therefore, you could initialize it earlier than the loop execution, and destroy + > it late afterwards: + > + > ```cpp + > std::vector v(300, 0); + > std::iota(v.begin(), v.end(), 1); // 1, 2, 3, ..., 300 + > float sum = 0; + > bk::IterableBar bar(v, {.message = "Summing", .interval = .02}); + > // <-- At this point, display is not yet shown. + > // Thus, more work can be done here. + > for (auto x : bar) { // <-- Display starts showing. + > std::this_thread::sleep_for(1.s/x); + > sum += x; + > } + > // <-- Display stops here even if `bar` object is still alive. + > // Thus, more work can be done here. + > std::cout << "Sum: " << sum << std::endl; + > ``` + > + >
@@ -698,19 +697,16 @@ To build the test suites or the Python bindings, use Meson (below). PYTHONPATH=build/python/ python3.11 python/tests/demo.py ``` -
- - By default, python bindings assume `std::atomic` support. - This requires availability of supporting compilers, e.g. g++-13 instead of Clang 15.0.0. Such compilers can be specified during `configure` step: - ```bash - CXX=g++-13 meson setup build - ``` - Alternatively, you can disable atomic float support by providing the appropriate compile flag if you don't have a supporting compiler: - ```bash - CXXFLAGS="-DBARKEEP_ENABLE_ATOMIC_FLOAT=0" meson setup build - ``` - -
+ > [!TIP] + > By default, python bindings assume `std::atomic` support. + > This requires availability of supporting compilers, e.g. g++-13 instead of Clang 15.0.0. Such compilers can be specified during `configure` step: + > ```bash + > CXX=g++-13 meson setup build + > ``` + > Alternatively, you can disable atomic float support by providing the appropriate compile flag if you don't have a supporting compiler: + > ```bash + > CXXFLAGS="-DBARKEEP_ENABLE_ATOMIC_FLOAT=0" meson setup build + > ``` ## Similar projects diff --git a/docs/_sidebar.md b/docs/_sidebar.md index ab11695..e8dd0c2 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -1,25 +1,25 @@ -* [Home](/) +* [Home](/ "barkeep") __API__ -* [Namespace](api/Namespaces/namespacebarkeep) -* [Classes](api/Classes/) +* [Namespace](api/Namespaces/namespacebarkeep "barkeep • Namespace") +* [Classes](api/Classes/ "barkeep • Classes") - * [AnimationDisplay](api/Classes/classbarkeep_1_1_animation_display.md) - * [AsyncDisplayer](api/Classes/classbarkeep_1_1_async_displayer.md) - * [BaseDisplay](api/Classes/classbarkeep_1_1_base_display.md) - * [CompositeDisplay](api/Classes/classbarkeep_1_1_composite_display.md) - * [CounterDisplay](api/Classes/classbarkeep_1_1_counter_display.md) - * [IterableBar](api/Classes/classbarkeep_1_1_iterable_bar.md) - * [IterableBar::Iterator](api/Classes/classbarkeep_1_1_iterable_bar_1_1_iterator.md) - * [ProgressBarDisplay](api/Classes/classbarkeep_1_1_progress_bar_display.md) - * [Speedometer](api/Classes/classbarkeep_1_1_speedometer.md) - * [StatusDisplay](api/Classes/classbarkeep_1_1_status_display.md) - * [AnimationConfig](api/Classes/structbarkeep_1_1_animation_config.md) - * [AtomicTraits](api/Classes/structbarkeep_1_1_atomic_traits.md) - * [AtomicTraits< std::atomic< T > >](api/Classes/structbarkeep_1_1_atomic_traits_3_01std_1_1atomic_3_01_t_01_4_01_4.md) - * [BarParts](api/Classes/structbarkeep_1_1_bar_parts.md) - * [CounterConfig](api/Classes/structbarkeep_1_1_counter_config.md) - * [IterableBarConfig](api/Classes/structbarkeep_1_1_iterable_bar_config.md) - * [ProgressBarConfig](api/Classes/structbarkeep_1_1_progress_bar_config.md) + * [AnimationDisplay](api/Classes/classbarkeep_1_1_animation_display.md "barkeep • AnimationDisplay") + * [AsyncDisplayer](api/Classes/classbarkeep_1_1_async_displayer.md "barkeep • AsyncDisplayer") + * [BaseDisplay](api/Classes/classbarkeep_1_1_base_display.md "barkeep • BaseDisplay") + * [CompositeDisplay](api/Classes/classbarkeep_1_1_composite_display.md "barkeep • CompositeDisplay") + * [CounterDisplay](api/Classes/classbarkeep_1_1_counter_display.md "barkeep • CounterDisplay") + * [IterableBar](api/Classes/classbarkeep_1_1_iterable_bar.md "barkeep • IterableBar") + * [IterableBar::Iterator](api/Classes/classbarkeep_1_1_iterable_bar_1_1_iterator.md "barkeep • IterableBar::Iterator") + * [ProgressBarDisplay](api/Classes/classbarkeep_1_1_progress_bar_display.md "barkeep • ProgressBarDisplay") + * [Speedometer](api/Classes/classbarkeep_1_1_speedometer.md "barkeep • Speedometer") + * [StatusDisplay](api/Classes/classbarkeep_1_1_status_display.md "barkeep • StatusDisplay") + * [AnimationConfig](api/Classes/structbarkeep_1_1_animation_config.md "barkeep • AnimationConfig") + * [AtomicTraits](api/Classes/structbarkeep_1_1_atomic_traits.md "barkeep • AtomicTraits") + * [AtomicTraits< std::atomic< T > >](api/Classes/structbarkeep_1_1_atomic_traits_3_01std_1_1atomic_3_01_t_01_4_01_4.md "barkeep • AtomicTraits< std::atomic< T > >") + * [BarParts](api/Classes/structbarkeep_1_1_bar_parts.md "barkeep • BarParts") + * [CounterConfig](api/Classes/structbarkeep_1_1_counter_config.md "barkeep • CounterConfig") + * [IterableBarConfig](api/Classes/structbarkeep_1_1_iterable_bar_config.md "barkeep • IterableBarConfig") + * [ProgressBarConfig](api/Classes/structbarkeep_1_1_progress_bar_config.md "barkeep • ProgressBarConfig") diff --git a/docs/img/favicon.svg b/docs/img/favicon.svg new file mode 100644 index 0000000..18690b7 --- /dev/null +++ b/docs/img/favicon.svg @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/docs/index.html b/docs/index.html index 3361db4..d30f80f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -20,6 +20,7 @@ href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css" /> +
@@ -50,6 +51,9 @@ tabComments: true, // default tabHeadings: true, // default }, + 'flexible-alerts': { + style: 'callout', + }, vueComponents: { icon: { props: ["prefix"], @@ -78,6 +82,7 @@ + @@ -153,8 +158,36 @@ .dual-code .language-cpp { font-size: 12px !important; } - div.tip p { - margin: 0 0 0 0; + /* docsify-plugin-flexible-alerts default border color + is not accounting for dark mode */ + .alert.callout { + border-color: var(--mono-tint2); + } + /* unify NOTE and TIP under the theme color */ + .alert.callout.note, + .alert.callout.tip { + border-left-color: var(--theme-color) !important; + } + .alert.callout.note .title, + .alert.callout.tip .title { + color: var(--theme-color); + } + .alert.callout.note .icon-note, + .alert.callout.tip .icon-tip { + background-image: none; + background-color: var(--theme-color); + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-size: contain; + mask-size: contain; + } + .alert.callout.note .icon-note { + -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath d='M11 17h2v-6h-2zm1-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9 2 12t.788-3.9 2.137-3.175T8.1 2.788 12 2t3.9.788 3.175 2.137T21.213 8.1 22 12t-.788 3.9-2.137 3.175-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4 6.325 6.325 4 12t2.325 5.675T12 20m0-8'/%3E%3C/svg%3E"); + mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath d='M11 17h2v-6h-2zm1-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9 2 12t.788-3.9 2.137-3.175T8.1 2.788 12 2t3.9.788 3.175 2.137T21.213 8.1 22 12t-.788 3.9-2.137 3.175-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4 6.325 6.325 4 12t2.325 5.675T12 20m0-8'/%3E%3C/svg%3E"); + } + .alert.callout.tip .icon-tip { + -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M9 18h6m-5 3h4m-5-6c.001-2-.499-2.5-1.5-3.5S6.025 9.487 6 8c-.047-3.05 2-5 6-5 4.001 0 6.049 1.95 6 5-.023 1.487-.5 2.5-1.5 3.5-.999 1-1.499 1.5-1.5 3.5'/%3E%3C/svg%3E"); + mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M9 18h6m-5 3h4m-5-6c.001-2-.499-2.5-1.5-3.5S6.025 9.487 6 8c-.047-3.05 2-5 6-5 4.001 0 6.049 1.95 6 5-.023 1.487-.5 2.5-1.5 3.5-.999 1-1.499 1.5-1.5 3.5'/%3E%3C/svg%3E"); } div.badges img, div.badges picture { diff --git a/docs/make_docs.py b/docs/make_docs.py index 1226036..60e5380 100755 --- a/docs/make_docs.py +++ b/docs/make_docs.py @@ -74,7 +74,7 @@ def fix_match(m: re.Match[str]) -> str: m = re.match(r"# barkeep::(.+)", content) class_name = m.group(1) path = fname.removeprefix("docs/") - class_list_str += f" * [{class_name}]({path})\n" + class_list_str += f' * [{class_name}]({path} "barkeep • {class_name}")\n' sidebar = "docs/_sidebar.md" content = open(sidebar).read()