diff --git a/.gitignore b/.gitignore index 7e161c4..f81b1d6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,8 @@ /src/_ReSharper.*/ /src/*/obj/ /src/*/bin/ -/doc/*.tag +/doc/obj/ +/doc/api/ # Output /artifacts/ diff --git a/build.ps1 b/build.ps1 index 73ed6c2..1df6932 100644 --- a/build.ps1 +++ b/build.ps1 @@ -4,6 +4,6 @@ pushd $PSScriptRoot src\build.ps1 $Version src\test.ps1 -doc\build.ps1 $Version +doc\build.ps1 popd diff --git a/build.sh b/build.sh index 2fca20c..c65bf03 100755 --- a/build.sh +++ b/build.sh @@ -4,4 +4,3 @@ cd `dirname $0` src/build.sh ${1:-1.0-dev} src/test.sh -#doc/build.sh ${1:-1.0-dev} diff --git a/doc/build.ps1 b/doc/build.ps1 index ed5c59b..cc7dd46 100644 --- a/doc/build.ps1 +++ b/doc/build.ps1 @@ -1,12 +1,7 @@ -Param ($Version = "1.0-dev") -$ErrorActionPreference = "Stop" +$ErrorActionPreference = "Stop" pushd $PSScriptRoot -if (Test-Path ..\artifacts\Documentation) {rm -Recurse -Force ..\artifacts\Documentation} -mkdir ..\artifacts\Documentation | Out-Null - -$env:VERSION = $Version -..\0install.ps1 run --batch https://apps.0install.net/devel/doxygen.xml +..\0install.ps1 run --batch https://apps.0install.net/dotnet/docfx.xml --loglevel=warning --warningsAsErrors docfx.json if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"} popd diff --git a/doc/build.sh b/doc/build.sh deleted file mode 100755 index 23e08df..0000000 --- a/doc/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -e -cd `dirname $0` - -rm -rf ../artifacts/Documentation -mkdir -p ../artifacts/Documentation - -VERSION=${1:-1.0-dev} ../0install.sh run https://apps.0install.net/devel/doxygen.xml diff --git a/doc/docfx.json b/doc/docfx.json new file mode 100644 index 0000000..14019d1 --- /dev/null +++ b/doc/docfx.json @@ -0,0 +1,52 @@ +{ + "metadata": [ + { + "src": [ + { + "src": "../artifacts/Release/netstandard2.1", + "files": [ + "NanoByte.SatSolver*.dll" + ] + } + ], + "dest": "api" + } + ], + "build": { + "globalMetadata": { + "_baseUrl": "https://sat-solver.nano-byte.net/", + "_appTitle": "NanoByte SAT Solver", + "_appFooter": "Copyright Bastian Eicher", + "_disableBreadcrumb": true, + "_enableNewTab": true + }, + "content": [ + { + "files": [ + "*.md", + "toc.yml", + "api/*.yml" + ] + } + ], + "resource": [ + { + "files": [ + "*.png" + ] + } + ], + "overwrite": [ + { + "src": "../src/", + "files": [ + "**/*.md" + ] + } + ], + "xrefService": [ + "https://xref.docs.microsoft.com/query?uid={uid}" + ], + "dest": "../artifacts/Documentation" + } +} diff --git a/doc/main.md b/doc/index.md similarity index 58% rename from doc/main.md rename to doc/index.md index 1fd43d9..50e59d9 100644 --- a/doc/main.md +++ b/doc/index.md @@ -1,25 +1,29 @@ -NanoByte SAT Solver is a DPLL Boolean Satisfiability Solver for .NET. +--- +title: Home +--- + +# NanoByte SAT Solver -[**GitHub repository**](https://github.com/nano-byte/sat-solver) +NanoByte SAT Solver is a DPLL Boolean Satisfiability Solver for .NET. ## Usage Add a reference to the [NanoByte.SatSolver](https://www.nuget.org/packages/NanoByte.SatSolver/) NuGet package to your project. It is available for .NET Framework 2.0+ and .NET Standard 1.0+. -You need to choose the underlying type to use for \ref NanoByte.SatSolver.Literal "Literals" in Boolean Formulas. This will often be `int` or `string` but you can also use any other type that implements the `IEquatable` interface. You can then create an instance of \ref NanoByte.SatSolver.Solver "Solver": +You need to choose the underlying type to use for [Literals](xref:NanoByte.SatSolver.Literal) in Boolean Formulas. This will often be `int` or `string` but you can also use any other type that implements the `IEquatable` interface. You can then create an instance of : -```{.cs} +```csharp var solver = new Solver(); ``` -The library enables you to express Boolean \ref NanoByte.SatSolver.Formula "Formulas" using implicit casting and operators for human-friendly sample and test code: -```{.cs} +The library enables you to express Boolean [Formulas](xref:NanoByte.SatSolver.Formula`1) using implicit casting and operators for human-friendly sample and test code: +```csharp Literal a = "a", b = "b", c = "c", d = "d"; var formula = (a | b) & (!a | c) & (!c | d) & a; ``` For constructing Formulas at run-time you can use a collection-like interface instead: -```{.cs} +```csharp var formula = new Formula { new Clause {Literal.Of("a"), Literal.Of("b")}, @@ -30,8 +34,8 @@ var formula = new Formula ``` Finally, you can use the solver to determine whether a Formula is satisfiable: -```{.cs} +```csharp bool result = solver.IsSatisfiable(formula); ``` -When the Solver needs to choose a Literal to assign a truth value to during backtracking, it simply picks the first unset Literal from the list. You can replace this with your own domain-specific logic for better performance by deriving from \ref NanoByte.SatSolver.Solver "Solver" and overriding the \ref NanoByte.SatSolver.Solver.ChooseLiteral "ChooseLiteral()" method. +When the Solver needs to choose a Literal to assign a truth value to during backtracking, it simply picks the first unset Literal from the list. You can replace this with your own domain-specific logic for better performance by deriving from and overriding the [ChooseLiteral()](xref:NanoByte.SatSolver.Solver`1#NanoByte_SatSolver_Solver_1_ChooseLiteral_NanoByte_SatSolver_Formula__0__) method. diff --git a/doc/toc.yml b/doc/toc.yml new file mode 100644 index 0000000..62fdf91 --- /dev/null +++ b/doc/toc.yml @@ -0,0 +1,6 @@ +- name: Home + href: index.md +- name: API + href: api/ +- name: GitHub + href: https://github.com/nano-byte/sat-solver diff --git a/src/SatSolver/_Namespace.cs b/src/SatSolver/_Namespace.cs deleted file mode 100644 index 595d316..0000000 --- a/src/SatSolver/_Namespace.cs +++ /dev/null @@ -1,2 +0,0 @@ -//! \namespace NanoByte.SatSolver -//! \brief DPLL Boolean Satisfiability Solver. diff --git a/src/SatSolver/_Namespace.md b/src/SatSolver/_Namespace.md new file mode 100644 index 0000000..cadd8d9 --- /dev/null +++ b/src/SatSolver/_Namespace.md @@ -0,0 +1,5 @@ +--- +uid: NanoByte.SatSolver +summary: *content +--- +DPLL Boolean Satisfiability Solver.