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
150 changes: 106 additions & 44 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vitepress";
import path from "node:path";
import { defineConfig } from "vitepress";

// https://vitepress.dev/reference/site-config
export default defineConfig({
Expand All @@ -8,57 +8,119 @@ export default defineConfig({
description:
"A deductive system for logical inference, implemented in C++ with bindings for Python and TypeScript/JavaScript",
srcDir: "docs",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "Home", link: "/" },
{ text: "Getting Started", link: "/getting-started/installation" },
{ text: "Core Concepts", link: "/concepts/terms" },
{ text: "API Reference", link: "/api/typescript" },
{ text: "Support Packages", link: "/support-packages/bnf" },
{ text: "Examples", link: "/examples/basic" },
],

sidebar: [
{
text: "Getting Started",
items: [
{ text: "Installation", link: "/getting-started/installation" },
{ text: "Quick Start", link: "/getting-started/quickstart" },
locales: {
en: {
label: "English",
lang: "en",
link: "/en/",
themeConfig: {
nav: [
{ text: "Home", link: "/en/" },
{ text: "Getting Started", link: "/en/getting-started/installation" },
{ text: "Core Concepts", link: "/en/concepts/terms" },
{ text: "API Reference", link: "/en/api/typescript" },
{ text: "Support Packages", link: "/en/support-packages/bnf" },
{ text: "Examples", link: "/en/examples/basic" },
],
},
{
text: "Core Concepts",
items: [
{ text: "Terms", link: "/concepts/terms" },
{ text: "Rules", link: "/concepts/rules" },
{ text: "Search Engine", link: "/concepts/search" },
],
},
{
text: "API Reference",
items: [
{ text: "TypeScript API", link: "/api/typescript" },
{ text: "Python API", link: "/api/python" },
{ text: "C++ API", link: "/api/cpp" },
sidebar: [
{
text: "Getting Started",
items: [
{ text: "Installation", link: "/en/getting-started/installation" },
{ text: "Quick Start", link: "/en/getting-started/quickstart" },
],
},
{
text: "Core Concepts",
items: [
{ text: "Terms", link: "/en/concepts/terms" },
{ text: "Rules", link: "/en/concepts/rules" },
{ text: "Search Engine", link: "/en/concepts/search" },
],
},
{
text: "API Reference",
items: [
{ text: "TypeScript API", link: "/en/api/typescript" },
{ text: "Python API", link: "/en/api/python" },
{ text: "C++ API", link: "/en/api/cpp" },
],
},
{
text: "Support Packages",
items: [
{ text: "BNF", link: "/en/support-packages/bnf" },
{ text: "E-Graph", link: "/en/support-packages/egg" },
],
},
{
text: "Examples",
items: [
{ text: "Basic Examples", link: "/en/examples/basic" },
{ text: "Sudoku", link: "/en/examples/sudoku" },
],
},
],
},
{
text: "Support Packages",
items: [
{ text: "BNF", link: "/support-packages/bnf" },
{ text: "E-Graph", link: "/support-packages/egg" },
},
zh: {
label: "简体中文",
lang: "zh",
link: "/zh/",
themeConfig: {
nav: [
{ text: "首页", link: "/zh/" },
{ text: "快速开始", link: "/zh/getting-started/installation" },
{ text: "核心概念", link: "/zh/concepts/terms" },
{ text: "API 参考", link: "/zh/api/typescript" },
{ text: "支持包", link: "/zh/support-packages/bnf" },
{ text: "示例", link: "/zh/examples/basic" },
],
},
{
text: "Examples",
items: [
{ text: "Basis Examples", link: "/examples/basic" },
{ text: "Sudoku", link: "/examples/sudoku" },
sidebar: [
{
text: "快速开始",
items: [
{ text: "安装", link: "/zh/getting-started/installation" },
{ text: "快速上手", link: "/zh/getting-started/quickstart" },
],
},
{
text: "核心概念",
items: [
{ text: "Term", link: "/zh/concepts/terms" },
{ text: "Rule", link: "/zh/concepts/rules" },
{ text: "搜索引擎", link: "/zh/concepts/search" },
],
},
{
text: "API 参考",
items: [
{ text: "TypeScript API", link: "/zh/api/typescript" },
{ text: "Python API", link: "/zh/api/python" },
{ text: "C++ API", link: "/zh/api/cpp" },
],
},
{
text: "支持包",
items: [
{ text: "BNF", link: "/zh/support-packages/bnf" },
{ text: "E-Graph", link: "/zh/support-packages/egg" },
],
},
{
text: "示例",
items: [
{ text: "基础示例", link: "/zh/examples/basic" },
{ text: "数独", link: "/zh/examples/sudoku" },
],
},
],
},
],
},
},

themeConfig: {
search: { provider: "local" },
socialLinks: [{ icon: "github", link: "https://github.com/USTC-KnowledgeComputingLab/ds" }],
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/examples/sudoku.md → docs/en/examples/sudoku.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The Sudoku solver encodes Sudoku rules as logical inference rules in the DS syst
## Interactive Demo

<script setup>
import Sudoku from './Sudoku.vue'
import Sudoku from '../../examples/Sudoku.vue'
</script>

<ClientOnly>
Expand Down
70 changes: 70 additions & 0 deletions docs/en/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
layout: home

hero:
name: "DS"
text: "A Deductive System"
tagline: A deductive system for logical inference, implemented in C++ with bindings for Python and TypeScript/JavaScript
actions:
- theme: brand
text: Quick Start
link: /en/getting-started/quickstart
- theme: alt
text: View on GitHub
link: https://github.com/USTC-KnowledgeComputingLab/ds

features:
- title: Multi-Language Support
details: Seamlessly use the same deductive system in C++, Python, or TypeScript/JavaScript.
- title: WebAssembly Performance
details: Run high-performance deductive system in the browser or Node.js via Emscripten.
- title: Rich Logical Terms
details: Comprehensive support for variables, items, and nested lists.
- title: Rule-Based Inference
details: Flexible framework for defining rules and facts to perform complex logical deduction.
- title: Unification Engine
details: Powerful built-in mechanisms for term unification and rule matching.
- title: Automated Search
details: Built-in search engine for iterative inference.
---

## Supported Languages

::: code-group
```typescript [TypeScript]
import { Term } from "atsds";

const term = new Term("(hello world)");
console.log(term.toString());
// Output: (hello world)
```
```python [Python]
import apyds

term = apyds.Term("(hello world)")
print(term) # (hello world)
```
```cpp [C++]
#include <ds/ds.hh>
#include <ds/utility.hh>
#include <iostream>

int main() {
auto term = ds::text_to_term("(hello world)", 1000);
std::cout << ds::term_to_text(term.get(), 1000).get() << std::endl;
return 0;
}
```
:::

## Quick Links

- **[Installation](getting-started/installation.md)** - Install DS for your preferred language
- **[Quick Start](getting-started/quickstart.md)** - Get up and running in minutes
- **[Core Concepts](concepts/terms.md)** - Learn about terms, rules, and inference
- **[API Reference](api/typescript.md)** - Complete API documentation
- **[Examples](examples/basic.md)** - Working code examples

## License

This project is licensed under the GNU General Public License v3.0 or later.
File renamed without changes.
File renamed without changes.
81 changes: 15 additions & 66 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,19 @@
---
layout: home

hero:
name: "DS"
text: "A Deductive System"
tagline: A deductive system for logical inference, implemented in C++ with bindings for Python and TypeScript/JavaScript
actions:
- theme: brand
text: Quick Start
link: /getting-started/quickstart
- theme: alt
text: View on GitHub
link: https://github.com/USTC-KnowledgeComputingLab/ds

features:
- title: Multi-Language Support
details: Seamlessly use the same deductive system in C++, Python, or TypeScript/JavaScript.
- title: WebAssembly Performance
details: Run high-performance deductive system in the browser or Node.js via Emscripten.
- title: Rich Logical Terms
details: Comprehensive support for variables, items, and nested lists.
- title: Rule-Based Inference
details: Flexible framework for defining rules and facts to perform complex logical deduction.
- title: Unification Engine
details: Powerful built-in mechanisms for term unification and rule matching.
- title: Automated Search
details: Built-in search engine for iterative inference.
---

## Supported Languages

::: code-group
```typescript [TypeScript]
import { Term } from "atsds";

const term = new Term("(hello world)");
console.log(term.toString());
// Output: (hello world)
```
```python [Python]
import apyds

term = apyds.Term("(hello world)")
print(term) # (hello world)
```
```cpp [C++]
#include <ds/ds.hh>
#include <ds/utility.hh>
#include <iostream>

int main() {
auto term = ds::text_to_term("(hello world)", 1000);
std::cout << ds::term_to_text(term.get(), 1000).get() << std::endl;
return 0;
}
```
:::

## Quick Links

- **[Installation](getting-started/installation.md)** - Install DS for your preferred language
- **[Quick Start](getting-started/quickstart.md)** - Get up and running in minutes
- **[Core Concepts](concepts/terms.md)** - Learn about terms, rules, and inference
- **[API Reference](api/typescript.md)** - Complete API documentation
- **[Examples](examples/basic.md)** - Working code examples

## License

This project is licensed under the GNU General Public License v3.0 or later.
<script setup>
import { onMounted } from 'vue'
import { useRouter, withBase } from 'vitepress'

const router = useRouter()

onMounted(() => {
const userLang = navigator.language || navigator.userLanguage
if (userLang.startsWith('zh')) {
router.go(withBase('/zh/'))
} else {
router.go(withBase('/en/'))
}
})
</script>
Loading