transbot

command module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2023 License: MIT Imports: 5 Imported by: 0

README ¶

transbot

Automatic translation and typesetting of noiton articles using OpenAI.

Config

  • rename 'config_temp.toml' to 'config.toml' and field your api_key
  • <openai.api_key> must be your OpenAI api key
  • <notion.api_auth> must be your notion secret key

Building and run

Using go cmd
  • go mod tidy
  • go run main.go
Using makefile
  • go mod tidy
  • make build
  • ./transbot
Using docker
  • make docker
  • make run

Frontend

Frontend is a sample frontend for transbot.

Port

  • Default transbot port is 8080. You can modify in 'config.toml' and 'Makefile': <TRANSBOT_PORT>
  • Drfault frontend port is 8081. You can modify in 'Makefile': <FRONTEND_PORT>

Using

Restful api
GET: /v1/translate/:notion_page_url/:target_language
  • notion_page_url is the notion page to be translated.
  • target_language is the language to be translated. (english or chenese)
# Example
curl --location 'http://127.0.0.1:8080/v1/translate/d77601f7a3e649b7967f61a4462fad53/english'

Supported notion block types

  • Paragraph
  • Heading1
  • Heading2
  • Heading3
  • NumberedListItem
  • BulletedListItem
  • ToDo
  • Toggle
  • Callout
  • Quote
  • Video
  • Image
👉 Key references

Documentation ¶

The Go Gopher

There is no documentation for this package.

Directories ¶

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL