new(all): Site for the Reference and API.

This commit is contained in:
Rodrigo Rodriguez 2024-08-26 13:41:26 -03:00
parent 24df60559b
commit 707d2d9104
46 changed files with 155 additions and 877 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
swa-cli.config.json
deploy.sh
site/build
site/.docusaurus

View file

@ -1,25 +1 @@
# General Bots - The Bot Server
Welcome to the General Bots Book. This is a reference material that can be used
to understand how the bot server is organized in a form of packages itself and
this arrangement can be used to all custom deployed packages like .gbkb, .gbtheme
or .gbapp.
This book is organized in ten chapters that can be accessed throuhg this table bellow:
* [Acknowledgments](book/acknowledgments.md)
* [Chapter 01 - Run and Talk](book/chapter-01-run-and-talk.md)
* [Chapter 02 - About Packages](book/chapter-02-the-package-based.md)
* [Chapter 03 - gbkb Reference](book/chapter-03-gbkb-reference.md)
* [Chapter 04 - gbtheme Reference](book/chapter-04-gbtheme-reference.md)
* [Chapter 05 - gbdialog Reference](book/chapter-05-gbdialog-reference.md)
* [Chapter 06 - gbapp Reference](book/chapter-06-gbapp-reference.md)
* [Chapter 07 - gbot Reference](book/chapter-07-gbot-reference.md)
* [Chapter 08 - Tooling](book/chapter-08-tooling.md)
* [Chapter 09 - Services](book/chapter-09-services.md)
* [Chapter 10 - Contributing](book/chapter-10-contributing.md)
* [Apendix I - Database Model](book/apendix-i-database-model.md)
* [Copyright](book/copyright.md)
* [Foreward](book/foreward.md)
* [Glossary](book/glossary.md)
* [Preface](book/preface.md)

View file

@ -1,8 +0,0 @@
theme: jekyll-theme-slate
presets:
- - redocusaurus
- specs:
- spec: https://gb.pragmatismo.cloud/swagger.yaml
route: /api/
theme:
primaryColor: '#1890ff'

View file

@ -1,12 +0,0 @@
---
slug: first-blog-post
title: First Blog Post
authors: [slorber, yangshun]
tags: [hola, docusaurus]
---
Lorem ipsum dolor sit amet...
<!-- truncate -->
...consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

View file

@ -1,44 +0,0 @@
---
slug: long-blog-post
title: Long Blog Post
authors: yangshun
tags: [hello, docusaurus]
---
This is the summary of a very long blog post,
Use a `<!--` `truncate` `-->` comment to limit blog post size in the list view.
<!-- truncate -->
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet

View file

@ -1,24 +0,0 @@
---
slug: mdx-blog-post
title: MDX Blog Post
authors: [slorber]
tags: [docusaurus]
---
Blog posts support [Docusaurus Markdown features](https://docusaurus.io/docs/markdown-features), such as [MDX](https://mdxjs.com/).
:::tip
Use the power of React to create interactive blog posts.
:::
{/* truncate */}
For example, use JSX to create an interactive button:
```js
<button onClick={() => alert('button clicked!')}>Click me!</button>
```
<button onClick={() => alert('button clicked!')}>Click me!</button>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

View file

@ -1,29 +0,0 @@
---
slug: welcome
title: Welcome
authors: [slorber, yangshun]
tags: [facebook, hello, docusaurus]
---
[Docusaurus blogging features](https://docusaurus.io/docs/blog) are powered by the [blog plugin](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog).
Here are a few tips you might find useful.
<!-- truncate -->
Simply add Markdown files (or folders) to the `blog` directory.
Regular blog authors can be added to `authors.yml`.
The blog post date can be extracted from filenames, such as:
- `2019-05-30-welcome.md`
- `2019-05-30-welcome/index.md`
A blog post folder can be convenient to co-locate blog post images:
![Docusaurus Plushie](./docusaurus-plushie-banner.jpeg)
The blog supports tags as well!
**And if you don't want a blog**: just delete this directory, and use `blog: false` in your Docusaurus config.

View file

@ -1,23 +0,0 @@
yangshun:
name: Yangshun Tay
title: Front End Engineer @ Facebook
url: https://github.com/yangshun
image_url: https://github.com/yangshun.png
page: true
socials:
x: yangshunz
github: yangshun
slorber:
name: Sébastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
page:
# customize the url of the author page at /blog/authors/<permalink>
permalink: '/all-sebastien-lorber-articles'
socials:
x: sebastienlorber
linkedin: sebastienlorber
github: slorber
newsletter: https://thisweekinreact.com

View file

@ -1,19 +0,0 @@
facebook:
label: Facebook
permalink: /facebook
description: Facebook tag description
hello:
label: Hello
permalink: /hello
description: Hello tag description
docusaurus:
label: Docusaurus
permalink: /docusaurus
description: Docusaurus tag description
hola:
label: Hola
permalink: /hola
description: Hola tag description

View file

@ -1,7 +1,11 @@
# Apendix I - General Bots Database Model
---
sidebar_position: 1000
---
# Apendix I - Database Model
The database model can be seen on the picture bellow. In each .gbapp or .gblib
the folder **Model** will contain the Sequelize definition for each one of these
tables and their relationship.
![General Bots Database Model](../images/GeneralBotsDatabaseModel.png)
![General Bots Database Model](./images/GeneralBotsDatabaseModel.png)

View file

@ -1,7 +1,11 @@
# Apendix II - General Bots Network Diagrams
---
sidebar_position: 1000
---
# Apendix II - Network Diagrams
## Reverse Proxy for Development
When establishing a local development machine, an user can use the ngrok based proxy. The diagram shows how the localhost becomes accesible when the Bot Service need to connect, routing messages from the cloud to the local development server machine.
![General Bots Reverse Proxy](../images/GeneralBotsReverseProxy.png)
![General Bots Reverse Proxy](./images/GeneralBotsReverseProxy.png)

View file

@ -1,16 +0,0 @@
# Acknowledgments
### Credits & Inspiration
* Rodrigo Rodriguez (me@rodrigorodriguez.com) - Coding, Docs & Architecture
* David Lerner (david.lerner@hotmail.com) - UI, UX & Theming
* Eduardo Romeiro (eromeirosp@outlook.com) - Content & UX.
* Jorge Ramos (jramos@pobox.com) - Coding, Docs & Architecture
* PH Nascimento (ph.an@outlook.com) - Product Manager
* Alan Perdomo (alanperdomo@hotmail.com) - Coding, Docs & Architecture
Powered by Microsoft [BOT Framework](https://dev.botframework.com/) and [Azure](http://www.azure.com).
General Bot Code Name is [Guaribas](https://en.wikipedia.org/wiki/Guaribas), the name of a city in Brasil, state of Piaui.
[Roberto Mangabeira Unger](http://www.robertounger.com/en/): "No one should have to do work that can be done by a machine".

View file

@ -1,33 +0,0 @@
# General Bots Tooling
## Notable Packages
### [@push](https://github.com/vasyas/push-rpc)
#### Updating BotServer/swagger.yaml
```
node ./node_modules/@push-rpc/openapi/dist/cli.js --tsConfig ./tsconfig.api.json --apiTemplate ./api-template.json --output swaager.yaml --baseDir=. --entryFile ./src/api.ts --entryType GBAPI
```
## NLP
### luis.ai
## Spell Checker
### Bing Spell Checker
## Speech to Text
### Azure Speech Services
## Quality Assurance
### Nightmare
https://codecept.io/nightmare
# System Limits

View file

@ -1,22 +0,0 @@
#
Published by Pragmatismo
Copyright © 2018-2024
License & Warranty
General Bots Copyright (c) Pragmatismo. All rights reserved. Licensed under the AGPL-3.0.
According to our dual licensing model, this program can be used either under the terms of
the GNU Affero General Public License, version 3, or under a proprietary license.
The texts of the GNU Affero General Public License with an additional permission and of our proprietary license can be found at and in the LICENSE file you have received along with this program.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
"General Bots" is a registered trademark of Pragmatismo.io. The licensing of the program under the AGPLv3 does not imply a trademark license. Therefore any rights, title and interest in our trademarks remain entirely with us.
pragmatismo.cloud

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View file

@ -1,3 +0,0 @@
# Foreward

View file

@ -1,43 +0,0 @@
copyright:
owner: Pragmatismo.io
year: 2019
title: "General Bots Book"
subtitle: "Building virtual assistants"
publisher: Pragmatismo.io
# Whether or not to enable PlantUML. You must install PlantUML, and the
# "plantuml" command must be in your path, if you enable this feature.
#
# Default, if not specified: false
use_plantuml: false
# Whether PDF generation uses Weasy Print (true) or LaTeX (false). Defaults to
# false (LaTeX).
use_weasyprint: true
# Set to the language in which the book is written. This is especially
# useful when generating PDF with weasyprint, because it affects how
# hyphenation is handled. (When using weasyprint, automatic hyphenation is
# supported for any language that Pyphen supports.)
# Multiple authors are permitted.
author:
- Rodrigo Rodriguez
# Book identifier is optional.
#identifier:
# scheme: ISBN # or DOI
# text: 123456789X
# The language and variant in which the book is written.
language: en-US
# See https://wiki.mobileread.com/wiki/Genre
genre: reference
# Set this option if you need to change the paper size. Default is "letter".
# "A4" is also valid.
papersize: A4

View file

@ -1,3 +0,0 @@
# Preface
Probably not necessary.

View file

@ -1,22 +0,0 @@
# Bibiographic references
references:
- type: book
id: GeneralBots
author:
- family: Rodriguez
given: Rodrigo
- family:
given:
issued:
date-parts:
- - 2019
- 3
- 1
title: 'General Bots Reference'
title-short: General Bots Reference
container-title: Nature
volume: 0
issue: 0
page: 300
URL: https://github.com/GeneralBots
language: en-US

View file

@ -1,4 +1,8 @@
# General Bots - Run and Talk to the Bot
---
sidebar_position: 10
---
# Run and Talk
### Bot Development Stack
@ -33,10 +37,6 @@ GeneralBots aims to deliver bots on Azure in an easy and efficient manner. Utili
3. Type `npm install -g botserver` and press **ENTER**.
4. Type `gbot` to start the server core.
## Installation via PowerShell or Command Prompt
![Installation via npm](https://user-images.githubusercontent.com/65977273/94572520-81e2f380-0247-11eb-9d69-ff70ad26b027.png)
### Notes:
- [*nodejs.install* Chocolatey Package](https://chocolatey.org/packages/nodejs.install) is also available (Chocolatey is a Windows package manager).

View file

@ -1,6 +1,10 @@
# About Packages
---
sidebar_position: 20
---
Packages can be stored as folders in the file system, synced with cloud storages and
# Package Based principles
Packages are folders in the file system, synced with cloud storages and
content management systems like SharePoint and even sent like .zip files on a e-mail.
Just to increse bot knowledge, intelligence and how they look to us. So working on a
General Bots project is like to split the work on several packages if needed and work
@ -10,6 +14,9 @@ companies to more advanced package building. Composite packages on GeneralBots:
![print packages](https://user-images.githubusercontent.com/65977273/94712159-7662fb80-031f-11eb-8217-1c0507bfe5d5.png)
# Your own data
You will see your data in .gbdata.
## How To

View file

@ -1,3 +1,7 @@
---
sidebar_position: 30
---
# .gbkb Reference
![generalbots-2018](https://user-images.githubusercontent.com/65977273/94922431-949c3900-0490-11eb-800a-6b478d689f2a.png)

View file

@ -1,4 +1,9 @@
---
sidebar_position: 40
---
# .gbtheme Reference
![generalbots-2018](https://user-images.githubusercontent.com/65977273/94922431-949c3900-0490-11eb-800a-6b478d689f2a.png)
## How To

View file

@ -1,4 +1,9 @@
---
sidebar_position: 50
---
# .gbdialog Reference
![generalbots-2018](https://user-images.githubusercontent.com/65977273/94922431-949c3900-0490-11eb-800a-6b478d689f2a.png)
General Bots BASIC using HEAR and TALK keywords provides a easy to write bot language accessible to everyone and used as incomer for people willing to make their own bot.

View file

@ -1,4 +1,9 @@
# .gbapp Guide
---
sidebar_position: 60
---
# .gbapp Reference
![generalbots-2018](https://user-images.githubusercontent.com/65977273/94922431-949c3900-0490-11eb-800a-6b478d689f2a.png)
## Introduction
@ -34,7 +39,7 @@ General procedures:
- User.Read
- Application.Read.All
- Application.ReadWrite.All
6. In Authentication | Add Platform | Web | Redirect URL: https://{server}/{botId}/token;
6. In Authentication | Add Platform | Web | Redirect URL: https://server/botId/token;
6. /setupSecurity to get access to Bot Drive (Clean: https://www.domstamand.com/removing-user-consent-from-an-azure-ad-application/);
7. /publish to publish packages on root bot.
@ -92,10 +97,10 @@ sudo apt install code
```
Node JS 19
Node JS 20
```
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash -
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
node -v
sudo apt install npm
@ -137,7 +142,7 @@ Add export GTK_IM_MODULE="xim" to .profile to fix Key Bindings in VSCode on Ubun
3. Install [Node.js](https://npmjs.com/get-npm), a [Runtime system](https://en.wikipedia.org/wiki/Runtime_system);
4. Install Visual Studio Code Insiders, Brackets or Atom as an editor of your choice;
5. Fork the repository by visiting https://github.com/pragmatismo-io/BotServer/fork;
6. Clone the just forked repository by running `git clone <your-forked-repository-url>/BotServer.git` ;
6. Clone the just forked repository by running `git clone your-forked-repository-url/BotServer.git` ;
7. Run the bot server by `gbot.cmd` .
@ -295,9 +300,9 @@ See https://semver.org/.
The numbering rules are defined as the following syntax:
1.0.0<br/>
MAJOR.MINOR.PATCH<br/>
(BREAK.FEATURE.BUG)<br/>
1.0.0
MAJOR.MINOR.PATCH
(BREAK.FEATURE.BUG)
### Details

View file

@ -1,4 +1,8 @@
# General Bots Administration
---
sidebar_position: 70
---
# .gbot Reference
## Instance custom params
@ -114,4 +118,3 @@ https://graph.facebook.com/v18.0/99999792462862/whatsapp_business_profile
## Cloud Internals

View file

@ -0,0 +1,30 @@
---
sidebar_position: 80
---
# Tooling
## Notable Packages
### [@push](https://github.com/vasyas/push-rpc)
#### Updating BotServer/swagger.yaml
```
node ./node_modules/@push-rpc/openapi/dist/cli.js --tsConfig ./tsconfig.api.json --apiTemplate ./api-template.json --output swaager.yaml --baseDir=. --entryFile ./src/api.ts --entryType GBAPI
```
# External Refereces
| Name | URL |
| ------------------------ | ----------------------------- |
| Prompt Engineering Guide | https://www.promptingguide.ai |
## LLM Propmts
- https://github.com/jamesponddotco/llm-prompts/tree/trunk
## LLM Tools
- https://lmstudio.ai/

View file

@ -0,0 +1,17 @@
---
sidebar_position: 90
---
# Services
# Useful callable public APIs
| Name | URL |
| ------------------------ | -------------------------------------------------- |
| Collection of Public API | https://github.com/public-apis/public-apis |
| Wheather | https://github.com/Yeqzids/7timer-issues/wiki/Wiki |
# Service News

View file

@ -1,4 +1,8 @@
# Contributing to the General Bots open-core
---
sidebar_position: 100
---
# Contributing
## How To

View file

@ -1,3 +1,7 @@
---
sidebar_position: 1000
---
# Glossary
| Term | Description |

View file

@ -1,47 +1,52 @@
---
sidebar_position: 1
sidebar_position: 0
---
# Tutorial Intro
# General Bots Documentation
Welcome to the General Bots documentation. This is a reference material that can be used
to understand how the bot server is organized in a form of packages itself and
this arrangement can be used to all custom deployed packages like .gbkb, .gbtheme
or .gbapp.
This book is organized in ten chapters that can be accessed throuhg this table bellow:
* [Chapter 01 - Run and Talk](chapter-01-run-and-talk.md)
* [Chapter 02 - About Packages](chapter-02-the-package-based.md)
* [Chapter 03 - gbkb Reference](chapter-03-gbkb-reference.md)
* [Chapter 04 - gbtheme Reference](chapter-04-gbtheme-reference.md)
* [Chapter 05 - gbdialog Reference](chapter-05-gbdialog-reference.md)
* [Chapter 06 - gbapp Reference](chapter-06-gbapp-reference.md)
* [Chapter 07 - gbot Reference](chapter-07-gbot-reference.md)
* [Chapter 08 - Tooling](chapter-08-tooling.md)
* [Chapter 09 - Services](chapter-09-services.md)
* [Chapter 10 - Contributing](chapter-10-contributing.md)
* [Apendix I - Database Model](apendix-i-database-model.md)
* [Glossary](glossary.md)
Let's discover **Docusaurus in less than 5 minutes**.
## Getting Started
Get started by **creating a new site**.
Get started by **creating a new bot**.
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
Or **[Create Bot](https://gb.pragmatismo.cloud/PROD-GeneralBots006)** with General Bots Online.
### What you'll need
- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
## Generate a new site
Generate a new Docusaurus site using the **classic template**.
The classic template will automatically be added to your project after you run the command:
```bash
npm init docusaurus@latest my-website classic
- [Node.js](https://nodejs.org/en/download/) version 20:
- [Git](https://nodejs.org/en/download/) version 20:
```
git clone https://github.com/GeneralBots/BotServer
npm run start
```
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
The command also installs all necessary dependencies you need to run Docusaurus.
## Start your site
## Navigate to your bot
Run the development server:
```bash
cd my-website
npm run start
```
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:4242/.
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
Type `/publish` to publish bot packages and start talking to the bot.

View file

@ -1,8 +0,0 @@
{
"label": "Tutorial - Basics",
"position": 2,
"link": {
"type": "generated-index",
"description": "5 minutes to learn the most important Docusaurus concepts."
}
}

View file

@ -1,23 +0,0 @@
---
sidebar_position: 6
---
# Congratulations!
You have just learned the **basics of Docusaurus** and made some changes to the **initial template**.
Docusaurus has **much more to offer**!
Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**.
Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610)
## What's next?
- Read the [official documentation](https://docusaurus.io/)
- Modify your site configuration with [`docusaurus.config.js`](https://docusaurus.io/docs/api/docusaurus-config)
- Add navbar and footer items with [`themeConfig`](https://docusaurus.io/docs/api/themes/configuration)
- Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout)
- Add a [search bar](https://docusaurus.io/docs/search)
- Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase)
- Get involved in the [Docusaurus Community](https://docusaurus.io/community/support)

View file

@ -1,34 +0,0 @@
---
sidebar_position: 3
---
# Create a Blog Post
Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed...
## Create your first Post
Create a file at `blog/2021-02-28-greetings.md`:
```md title="blog/2021-02-28-greetings.md"
---
slug: greetings
title: Greetings!
authors:
- name: Joel Marcey
title: Co-creator of Docusaurus 1
url: https://github.com/JoelMarcey
image_url: https://github.com/JoelMarcey.png
- name: Sébastien Lorber
title: Docusaurus maintainer
url: https://sebastienlorber.com
image_url: https://github.com/slorber.png
tags: [greetings]
---
Congratulations, you have made your first post!
Feel free to play around and edit this post as much as you like.
```
A new blog post is now available at [http://localhost:3000/blog/greetings](http://localhost:3000/blog/greetings).

View file

@ -1,57 +0,0 @@
---
sidebar_position: 2
---
# Create a Document
Documents are **groups of pages** connected through:
- a **sidebar**
- **previous/next navigation**
- **versioning**
## Create your first Doc
Create a Markdown file at `docs/hello.md`:
```md title="docs/hello.md"
# Hello
This is my **first Docusaurus document**!
```
A new document is now available at [http://localhost:3000/docs/hello](http://localhost:3000/docs/hello).
## Configure the Sidebar
Docusaurus automatically **creates a sidebar** from the `docs` folder.
Add metadata to customize the sidebar label and position:
```md title="docs/hello.md" {1-4}
---
sidebar_label: 'Hi!'
sidebar_position: 3
---
# Hello
This is my **first Docusaurus document**!
```
It is also possible to create your sidebar explicitly in `sidebars.js`:
```js title="sidebars.js"
export default {
tutorialSidebar: [
'intro',
// highlight-next-line
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
};
```

View file

@ -1,43 +0,0 @@
---
sidebar_position: 1
---
# Create a Page
Add **Markdown or React** files to `src/pages` to create a **standalone page**:
- `src/pages/index.js``localhost:3000/`
- `src/pages/foo.md``localhost:3000/foo`
- `src/pages/foo/bar.js``localhost:3000/foo/bar`
## Create your first React Page
Create a file at `src/pages/my-react-page.js`:
```jsx title="src/pages/my-react-page.js"
import React from 'react';
import Layout from '@theme/Layout';
export default function MyReactPage() {
return (
<Layout>
<h1>My React page</h1>
<p>This is a React page</p>
</Layout>
);
}
```
A new page is now available at [http://localhost:3000/my-react-page](http://localhost:3000/my-react-page).
## Create your first Markdown Page
Create a file at `src/pages/my-markdown-page.md`:
```mdx title="src/pages/my-markdown-page.md"
# My Markdown page
This is a Markdown page
```
A new page is now available at [http://localhost:3000/my-markdown-page](http://localhost:3000/my-markdown-page).

View file

@ -1,31 +0,0 @@
---
sidebar_position: 5
---
# Deploy your site
Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**).
It builds your site as simple **static HTML, JavaScript and CSS files**.
## Build your site
Build your site **for production**:
```bash
npm run build
```
The static files are generated in the `build` folder.
## Deploy your site
Test your production build locally:
```bash
npm run serve
```
The `build` folder is now served at [http://localhost:3000/](http://localhost:3000/).
You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**).

View file

@ -1,152 +0,0 @@
---
sidebar_position: 4
---
# Markdown Features
Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**.
## Front Matter
Markdown documents have metadata at the top called [Front Matter](https://jekyllrb.com/docs/front-matter/):
```text title="my-doc.md"
// highlight-start
---
id: my-doc-id
title: My document title
description: My document description
slug: /my-custom-url
---
// highlight-end
## Markdown heading
Markdown text with [links](./hello.md)
```
## Links
Regular Markdown links are supported, using url paths or relative file paths.
```md
Let's see how to [Create a page](/create-a-page).
```
```md
Let's see how to [Create a page](./create-a-page.md).
```
**Result:** Let's see how to [Create a page](./create-a-page.md).
## Images
Regular Markdown images are supported.
You can use absolute paths to reference images in the static directory (`static/img/docusaurus.png`):
```md
![Docusaurus logo](/img/docusaurus.png)
```
![Docusaurus logo](/img/docusaurus.png)
You can reference images relative to the current file as well. This is particularly useful to colocate images close to the Markdown files using them:
```md
![Docusaurus logo](./img/docusaurus.png)
```
## Code Blocks
Markdown code blocks are supported with Syntax highlighting.
````md
```jsx title="src/components/HelloDocusaurus.js"
function HelloDocusaurus() {
return <h1>Hello, Docusaurus!</h1>;
}
```
````
```jsx title="src/components/HelloDocusaurus.js"
function HelloDocusaurus() {
return <h1>Hello, Docusaurus!</h1>;
}
```
## Admonitions
Docusaurus has a special syntax to create admonitions and callouts:
```md
:::tip My tip
Use this awesome feature option
:::
:::danger Take care
This action is dangerous
:::
```
:::tip My tip
Use this awesome feature option
:::
:::danger Take care
This action is dangerous
:::
## MDX and React Components
[MDX](https://mdxjs.com/) can make your documentation more **interactive** and allows using any **React components inside Markdown**:
```jsx
export const Highlight = ({children, color}) => (
<span
style={{
backgroundColor: color,
borderRadius: '20px',
color: '#fff',
padding: '10px',
cursor: 'pointer',
}}
onClick={() => {
alert(`You clicked the color ${color} with label ${children}`)
}}>
{children}
</span>
);
This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !
This is <Highlight color="#1877F2">Facebook blue</Highlight> !
```
export const Highlight = ({children, color}) => (
<span
style={{
backgroundColor: color,
borderRadius: '20px',
color: '#fff',
padding: '10px',
cursor: 'pointer',
}}
onClick={() => {
alert(`You clicked the color ${color} with label ${children}`);
}}>
{children}
</span>
);
This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !
This is <Highlight color="#1877F2">Facebook blue</Highlight> !

View file

@ -1,7 +0,0 @@
{
"label": "Tutorial - Extras",
"position": 3,
"link": {
"type": "generated-index"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

View file

@ -1,55 +0,0 @@
---
sidebar_position: 1
---
# Manage Docs Versions
Docusaurus can manage multiple versions of your docs.
## Create a docs version
Release a version 1.0 of your project:
```bash
npm run docusaurus docs:version 1.0
```
The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json` is created.
Your docs now have 2 versions:
- `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs
- `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs**
## Add a Version Dropdown
To navigate seamlessly across versions, add a version dropdown.
Modify the `docusaurus.config.js` file:
```js title="docusaurus.config.js"
export default {
themeConfig: {
navbar: {
items: [
// highlight-start
{
type: 'docsVersionDropdown',
},
// highlight-end
],
},
},
};
```
The docs version dropdown appears in your navbar:
![Docs Version Dropdown](./img/docsVersionDropdown.png)
## Update an existing version
It is possible to edit versioned docs in their respective folder:
- `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello`
- `docs/hello.md` updates `http://localhost:3000/docs/next/hello`

View file

@ -1,88 +0,0 @@
---
sidebar_position: 2
---
# Translate your site
Let's translate `docs/intro.md` to French.
## Configure i18n
Modify `docusaurus.config.js` to add support for the `fr` locale:
```js title="docusaurus.config.js"
export default {
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
},
};
```
## Translate a doc
Copy the `docs/intro.md` file to the `i18n/fr` folder:
```bash
mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/
cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md
```
Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French.
## Start your localized site
Start your site on the French locale:
```bash
npm run start -- --locale fr
```
Your localized site is accessible at [http://localhost:3000/fr/](http://localhost:3000/fr/) and the `Getting Started` page is translated.
:::caution
In development, you can only use one locale at a time.
:::
## Add a Locale Dropdown
To navigate seamlessly across languages, add a locale dropdown.
Modify the `docusaurus.config.js` file:
```js title="docusaurus.config.js"
export default {
themeConfig: {
navbar: {
items: [
// highlight-start
{
type: 'localeDropdown',
},
// highlight-end
],
},
},
};
```
The locale dropdown now appears in your navbar:
![Locale Dropdown](./img/localeDropdown.png)
## Build your localized site
Build your site for a specific locale:
```bash
npm run build -- --locale fr
```
Or build your site to include all the locales at once:
```bash
npm run build
```

View file

@ -8,7 +8,7 @@ const config: Config = {
favicon: "img/favicon.ico",
// Set the production url of your site here
url: "https://gb.pragmatismo.cloud",
url: "https://docs.pragmatismo.cloud",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: "/",
@ -18,7 +18,7 @@ const config: Config = {
organizationName: "General Bots", // Usually your GitHub org/user name.
projectName: "General Bots", // Usually your repo name.
onBrokenLinks: "throw",
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
// // Even if you don't use internationalization, you can use this field to set
@ -89,10 +89,10 @@ const config: Config = {
type: "docSidebar",
sidebarId: "tutorialSidebar",
position: "left",
label: "Tutorial",
label: "Docs",
},
{ to: "/api", label: "API", position: "left" },
{ to: "/blog", label: "Blog", position: "left" },
{ to: "https://github.com/GeneralBots/BotServer/tree/main/templates", label: "Templates", position: "left" },
{
href: "https://github.com/GeneralBots",
label: "GitHub",
@ -107,7 +107,7 @@ const config: Config = {
title: "Docs",
items: [
{
label: "Tutorial",
label: "Documentation",
to: "/docs/intro",
},
],