diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d8bc365a..8b5cf298 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -11,7 +11,7 @@ you contribute: 4. Be sure your modifications include: * Don't break anything (`make`) * Proper unit/functional tests (`make test`) - * Documentation updates if required (`make doc`) + * Documentation updates if required (plain Markdown in `docs/`) * Regenerate preprocessed headers (`tools/pph.sh`) * Update/check style using (`make check`) * Verify performance (`make benchmarks`) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 7b9c7781..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: docs - -# Build the MkDocs site from doc/ and publish it to the gh-pages branch -# (https://boost-ext.github.io/sml/). Runs automatically when documentation -# sources change on master, and can be triggered manually for a release. - -on: - push: - branches: [master] - paths: - - 'doc/**' - - '.mkdocs.yml' - - 'include/boost/sml.hpp' - - '.github/workflows/docs.yml' - workflow_dispatch: - -permissions: - contents: write - -concurrency: - group: docs-deploy - cancel-in-progress: true - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - - name: Install MkDocs - run: pip install mkdocs - - - name: Build site - run: mkdocs build --config-file .mkdocs.yml --clean --site-dir site - - - name: Publish to gh-pages - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./site - publish_branch: gh-pages - # Preserve files that are not regenerated by this build - # (e.g. the /boost classic-theme mirror). - keep_files: true - user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' - commit_message: 'docs: deploy site from ${{ github.sha }}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab3992a7..ef50056f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,9 +3,9 @@ name: release # Cut a GitHub Release for the version currently on master. # # Manually triggered. It reads BOOST_SML_VERSION from include/boost/sml.hpp, -# creates the matching vX.Y.Z tag (if missing) and a GitHub Release whose notes -# are the matching section of doc/CHANGELOG.md. Safe to re-run: it is a no-op if -# the release already exists. +# creates the matching vX.Y.Z tag (if missing) and a GitHub Release with +# auto-generated notes. Release history lives on the GitHub Releases page. +# Safe to re-run: it is a no-op if the release already exists. on: workflow_dispatch: @@ -42,21 +42,6 @@ jobs: echo "tag=v$version" >> "$GITHUB_OUTPUT" echo "Releasing v$version" - - name: Extract changelog section - id: notes - run: | - version="${{ steps.ver.outputs.version }}" - # Print the block from "## [x.y.z]" up to (but not including) the next "## [". - awk -v v="$version" ' - $0 ~ "^## \\[" v "\\]" {grab=1; next} - grab && /^## \[/ {exit} - grab {print} - ' doc/CHANGELOG.md > RELEASE_NOTES.md - if [ ! -s RELEASE_NOTES.md ]; then - echo "See doc/CHANGELOG.md" > RELEASE_NOTES.md - fi - echo "----- release notes -----"; cat RELEASE_NOTES.md - - name: Create tag and release (idempotent) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -69,4 +54,4 @@ jobs: gh release create "$tag" \ --target "${{ github.sha }}" \ --title "$tag" \ - --notes-file RELEASE_NOTES.md + --generate-notes diff --git a/.mkdocs.yml b/.mkdocs.yml deleted file mode 100644 index 7afaa8f7..00000000 --- a/.mkdocs.yml +++ /dev/null @@ -1,24 +0,0 @@ -copyright: Copyright © 2016-2026 -site_name: "[Boost::ext].SML" -site_url: https://boost-ext.github.io/sml -site_author: Kris Jusiak -repo_url: https://github.com/boost-ext/sml -repo_name: sml -docs_dir: doc -use_directory_urls: false -theme: - name: null - custom_dir: doc/themes/boost-modern -extra_javascript: [] -extra_css: [] - -nav: -- Introduction: index.md -- Overview: overview.md -- Features/Benchmarks: benchmarks.md -- Tutorial/Workshop: tutorial.md -- UML vs SML: uml_vs_sml.md -- User Guide: user_guide.md -- Examples: examples.md -- FAQ: faq.md -- CHANGELOG: CHANGELOG.md diff --git a/Makefile b/Makefile index a07212dc..c0beef17 100644 --- a/Makefile +++ b/Makefile @@ -18,10 +18,9 @@ # Memcheck: make test MEMCHECK=VALGRIND # Coverage: make test COVERAGE=GCOV # -.PHONY: all test example style static_analysis doc serve clean +.PHONY: all test example style static_analysis clean CXX ?= g++ -MKDOCS ?= mkdocs CXXSTD ?= c++14 _STD = $(subst c++,,$(CXXSTD)) BDIR = build-$(CXXSTD) @@ -68,12 +67,5 @@ style: $(BDIR)/.configured static_analysis: $(BDIR)/.configured $(CMAKE) --build $(BDIR) --target clang-tidy -# Documentation (https://boost-ext.github.io/sml). Requires: pip install mkdocs -doc: - $(MKDOCS) build --config-file .mkdocs.yml --clean --site-dir site - -serve: - $(MKDOCS) serve --config-file .mkdocs.yml - clean: - rm -rf $(BDIR) site + rm -rf $(BDIR) diff --git a/README.md b/README.md index 773ade94..ea068f38 100644 --- a/README.md +++ b/README.md @@ -1,87 +1,76 @@ - - - - - +[](https://www.boost.org/LICENSE_1_0.txt) +[](https://github.com/boost-ext/sml/releases) +[](https://github.com/boost-ext/sml/actions/workflows/build_matrix.yml) +[](https://codecov.io/gh/boost-ext/sml) +[](https://godbolt.org/z/dq85hW4ab) ---------------------------------------- +# SML - State Machine Language -# SML (State Machine Language) +A scalable C++14 **single-header** state machine library with no dependencies. -> Your scalable C++14 **one header only** State Machine Library with no dependencies +## Features -
+* Single header (`include/boost/sml.hpp`), no dependencies (not even STL or Boost) +* eUML-like transition table DSL: `src_state + event [ guard ] / action = dst_state` +* UML compliant: entry/exit actions, orthogonal regions, composite states, history, defer +* Fast compilation times, small binaries, and minimal memory footprint +* Short, readable compile-time error messages +* Testable (`testing::sm`) and observable (logger policy, runtime dispatcher) -> https://www.youtube.com/watch?v=Zb6xcd2as6o +## Quick start ---- +Get the header: -
-
- Let's release a TCP connection!
-
-

-
| tcp_release.cpp | -Clang-3.8 | -GCC-6.3 | -MSVC-2015 | -
|---|---|---|---|
| Compilation Time | -0.102s | -0.118s | -0.296s | -
| Binary size (stripped) | -6.2kb | -6.2kb | -105kb | -
| ASM x86-64 - https://godbolt.org/z/y99L50 |
-
-
- |
- ||
| - - | -- - | -