Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy documentation to Github Pages

on:
push:
branches: ["main"]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

# Default to bash
defaults:
run:
shell: bash

jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.156.0
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history for .GitInfo and .Lastmod
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.26'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Setup Hugo
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo --gc --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
working-directory: docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
46 changes: 0 additions & 46 deletions .github/workflows/mkdocs-gh-pages.yaml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
!.github/**/*.yml
!.github/**/*.yaml
!benchmarks/**/*.json
!docs/**/*.yaml
!docs/**/*.mod

# clangd
compile_flags.txt
Expand Down Expand Up @@ -95,6 +97,8 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
docs/public/
*.lock

# Docs
site/
1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

Binary file removed docs/assets/images/reflectcpp.png
Binary file not shown.
Binary file removed docs/assets/images/rfl-favicon-square.png
Binary file not shown.
Binary file removed docs/assets/images/rfl-favicon.png
Binary file not shown.
Binary file removed docs/assets/images/rfl-robot.jpg
Binary file not shown.
Binary file removed docs/assets/images/rfl.png
Binary file not shown.
81 changes: 0 additions & 81 deletions docs/assets/stylesheets/tweaks.css

This file was deleted.

79 changes: 79 additions & 0 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Documentation

## The basics

{{< cards >}}
{{< card link="install" title="Installation" icon="book-open" subtitle="How to install reflect-cpp using vcpkg, conan, cmake or direct inclusion.">}}
{{< card link="supported_formats" title="Supported formats" icon="book-open" subtitle="What formats are supported by reflect-cpp, such as JSON, XML, msgpack, etc.">}}
{{< card link="structs" title="Structs" icon="book-open" subtitle="Recaps the motivating example in the README.">}}
{{< card link="optional_fields" title="Optional fields" icon="book-open" subtitle="For defining fields that might be absent in your serialized format.">}}
{{< card link="flatten_structs" title="Struct flattening" icon="book-open" subtitle="For making struct A inherit the fields of struct B.">}}
{{< card link="processors" title="Processors" icon="book-open" subtitle="For modifying structs before serialization and deserialization.">}}
{{< card link="field_syntax" title="The rfl::Field-syntax" icon="book-open" subtitle="An alternative syntax that allows for powerful functionalities.">}}
{{< card link="literals" title="String literals" icon="book-open" subtitle="For representing strings that can only assume a limited number of enumerated values.">}}
{{< card link="enums" title="Enums" icon="book-open" subtitle="How reflect-cpp handles C++ enums.">}}
{{< card link="variants_and_tagged_unions" title="std::variant and rfl::TaggedUnion" icon="book-open" subtitle="For structs that can be one of several formats.">}}
{{< card link="rfl_ref" title="rfl::Box and rfl::Ref" icon="book-open" subtitle="For defining recursive structures.">}}
{{< card link="timestamps" title="rfl::Timestamp and std::chrono::duration" icon="book-open" subtitle="For serializing and deserializing timestamps and durations.">}}
{{< card link="rfl_skip" title="rfl::Skip" icon="book-open" subtitle="For skipping fields during serialization and/or deserialization.">}}
{{< card link="commented" title="rfl::Commented" icon="book-open" subtitle="For adding comments to your serialized format.">}}
{{< card link="result" title="rfl::Result" icon="book-open" subtitle="For error handling without exceptions.">}}
{{< card link="standard_containers" title="Standard containers" icon="book-open" subtitle="How reflect-cpp treats containers in the standard library.">}}
{{< card link="expected" title="std::expected" icon="book-open" subtitle="For serializing and deserializing std::expected, the C++-23 result type.">}}
{{< card link="c_arrays_and_inheritance" title="C arrays and inheritance" icon="book-open" subtitle="How reflect-cpp handles C arrays and inheritance.">}}
{{< card link="bytestring" title="rfl::Bytestring" icon="book-open" subtitle="How reflect-cpp handles binary strings for formats that support them.">}}
{{< card link="number_systems" title="rfl::Binary, rfl::Hex and rfl::Oct" icon="book-open" subtitle="For expressing numbers in different formats.">}}
{{< card link="default_val" title="Default values" icon="book-open" subtitle="For defining default values for fields that might be absent.">}}
{{< card link="atomic" title="Atomic types" icon="book-open" subtitle="For serializing and deserializing atomic types.">}}
{{< /cards >}}

## Validation

{{< cards >}}
{{< card link="patterns" title="Regex patterns" icon="book-open" subtitle="For requiring that strings follow user-defined regex patterns.">}}
{{< card link="validating_numbers" title="Validating numbers" icon="book-open" subtitle="For imposing constraints on numbers.">}}
{{< card link="composing_validators" title="Composing validators" icon="book-open" subtitle="For defining more complex validators using operators.">}}
{{< card link="size_validation" title="Size validation" icon="book-open" subtitle="For imposing size constraints on containers.">}}
{{< card link="json_schema" title="JSON schema" icon="book-open" subtitle="For validating your schema before you send it to your C++ backend.">}}
{{< /cards >}}

## Generic elements

{{< cards >}}
{{< card link="object" title="rfl::Object" icon="book-open" subtitle="A map-like type representing an object with unknown field names.">}}
{{< card link="generic" title="rfl::Generic" icon="book-open" subtitle="A catch-all type that can represent almost anything.">}}
{{< card link="extra_fields" title="rfl::ExtraFields" icon="book-open" subtitle="For adding extra fields with unknown names.">}}
{{< /cards >}}

## Custom classes

{{< cards >}}
{{< card link="custom_classes" title="Custom classes" icon="book-open" subtitle="For custom classes with private fields.">}}
{{< card link="custom_parser" title="Custom parsers for your classes" icon="book-open" subtitle="For custom classes that you want to leave untouched.">}}
{{< /cards >}}

## Useful helper functions and classes

{{< cards >}}
{{< card link="replace" title="rfl::replace" icon="book-open" subtitle="For replacing one or several fields in a struct.">}}
{{< card link="as" title="rfl::as" icon="book-open" subtitle="For casting structs as other structs.">}}
{{< card link="named_tuple" title="rfl::NamedTuple" icon="book-open" subtitle="For structural typing.">}}
{{< card link="rfl_tuple" title="rfl::Tuple" icon="book-open" subtitle="An alternative to std::tuple that compiles more quickly.">}}
{{< card link="to_view" title="rfl::to_view" icon="book-open" subtitle="For accessing fields of a struct by index or name.">}}
{{< /cards >}}

## Advanced topics

{{< cards >}}
{{< card link="supported_formats/supporting_your_own_format" title="Supporting your own format" icon="book-open" subtitle="For supporting your own serialization and deserialization formats.">}}
{{< card link="backwards_compatability" title="Maintaining backwards compatibility" icon="book-open" subtitle="Instructions for ensuring backwards-compatible APIs.">}}
{{< card link="benchmarks" title="Benchmarks" icon="book-open" subtitle="Extensive benchmarks of popular serialization libraries.">}}
{{< /cards >}}

## Contributing

{{< cards >}}
{{< card link="contributing" title="How to contribute" icon="book-open" subtitle="How to contribute to reflect-cpp.">}}
{{< card link="build_docs" title="Build the documentation" icon="book-open" subtitle="How to build the documentation locally.">}}
{{< /cards >}}

File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading