Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
awwaawwa committed Feb 19, 2025
1 parent bd73b53 commit e9605b8
Show file tree
Hide file tree
Showing 9 changed files with 830 additions and 333 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- # Yet Another Document Translator -->

<div align="center">
<img src="./docs/images/banner.png" width="320px" alt="YADT"/>
<img src="https://github.com/user-attachments/assets/39a9bc89-a3db-42d6-bc09-061671a20786" width="320px" alt="YADT"/>


<h2 id="title">BabelDOC</h2>
Expand Down Expand Up @@ -31,7 +31,7 @@ PDF scientific paper translation and bilingual comparison library.
## Preview

<div align="center">
<img src="./docs/images/preview.gif" width="80%"/>
<img src="https://github.com/user-attachments/assets/480d9889-9196-4e4d-a39b-ae3805485040" width="80%"/>
</div>

## Getting Started
Expand Down
15 changes: 9 additions & 6 deletions docs/CONTRIBUTOR_REWARD.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
- 附件要求:
- PR 页面完整截图(需包含合并状态、仓库名称及点击头像后弹出来的侧边栏,如下图所示)

![附件示例](images/contributor_reward_example.png)
![附件示例](https://github.com/user-attachments/assets/6b2378db-c459-4300-9082-d6c1c3f744d6)

3. **奖励说明**
1. **奖励说明**
- 奖励内容:[沉浸式翻译(Immersive Translate)](https://immersivetranslate.com/zh-Hans/pricing/)月度会员兑换码
- 兑换码使用:在[沉浸式翻译官网兑换页](https://immersivetranslate.com/zh-Hans/exchange)输入即可激活
- 会员权益:沉浸式翻译 Pro 会员一个月(详见[官网价格页](https://immersivetranslate.com/zh-Hans/pricing/)说明)
Expand Down Expand Up @@ -67,13 +67,16 @@

## 常见问题解答(FAQ)

Q:如何判断文档翻译贡献是否有效?
**Q:如何判断文档翻译贡献是否有效?**

A:系统性的人工翻译(如完整章节的翻译并经过人工校对)视为有效贡献。零散段落翻译或仅依赖机器翻译的内容不计入有效贡献。

Q:兑换码过期了可以补发吗?
A:为确保公平性,过期的兑换码将不予补发,请在有效期内及时使用。
**Q:兑换码过期了可以补发吗?**

A:为确保公平性,过期的兑换码将不予补发,请在有效期内及时使用。

**Q:为什么这个文档是中文的?**

Q:为什么这个文档是中文的?
A:因为目前应该是中文贡献者多吧,所以就先写中文的。后面再撰写英文版的。

---
Expand Down
4 changes: 2 additions & 2 deletions docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `yadt.high_level.async_translate` function provides an asynchronous interfac

## Usage

```python
```python linenums="1"
async def translate_with_progress():
config = TranslationConfig(
input_file="example.pdf",
Expand Down Expand Up @@ -131,7 +131,7 @@ The translation process can be cancelled in several ways:

Example of programmatic cancellation:

```python
```python linenums="1"
async def translate_with_cancellation():
config = TranslationConfig(
input_file="example.pdf",
Expand Down
81 changes: 0 additions & 81 deletions docs/ImplementationDetails/index.md

This file was deleted.

40 changes: 0 additions & 40 deletions docs/conf.py

This file was deleted.

27 changes: 1 addition & 26 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,2 @@
```{include} ../README.md
---
---
```

```{toctree}
---
caption: Implementation Details
maxdepth: 2
---
intro-to-pdf-object
ImplementationDetails/index
```

```{toctree}
---
caption: Development
maxdepth: 1
---
CONTRIBUTING
CONTRIBUTOR_REWARD
Code of Conduct <CODE_OF_CONDUCT>
License <../LICENSE>
Changelog <https://github.com/funstory-ai/BabelDOC/releases>
```
{!README.md!}
153 changes: 153 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Copyright (c) 2016-2025 Martin Donath <[email protected]>

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

# Project information
site_name: BabelDOC
site_url: https://squidfunk.github.io/mkdocs-material/
site_author: funstory.ai
site_description: >-
Write your documentation in Markdown and create a professional static site in
minutes – searchable, customizable, in 60+ languages, for all devices
# Repository
repo_name: funstory-ai/BabelDOC
repo_url: https://github.com/funstory-ai/BabelDOC
edit_uri: edit/main/docs/

# Copyright
copyright: Copyright &copy; 2025 funstory.ai

# Configuration
theme:
name: material
# custom_dir: material/overrides
features:
- announce.dismiss
- content.action.edit
- content.action.view
- content.code.annotate
- content.code.copy
- content.code.select
# - content.footnote.tooltips
# - content.tabs.link
- content.tooltips
# - header.autohide
# - navigation.expand
- navigation.footer
- navigation.indexes
# - navigation.instant
# - navigation.instant.prefetch
# - navigation.instant.progress
# - navigation.prune
- navigation.sections
- navigation.tabs
# - navigation.tabs.sticky
- navigation.top
- navigation.tracking
- search.highlight
- search.share
- search.suggest
- toc.follow
# - toc.integrate
palette:
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: white
accent: indigo
toggle:
icon: material/brightness-7
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: black
accent: indigo
toggle:
icon: material/brightness-4
name: Switch to system preference
font:
text: Roboto
code: Roboto Mono
favicon: assets/favicon.png
icon:
logo: logo

# Plugins
plugins:
- search:
separator: '[\s\u200b\-_,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
- minify:
minify_html: true
- git-authors
- git-revision-date-localized:
enable_creation_date: true
# Additional configuration
extra:
status:
new: Recently added
deprecated: Deprecated
social:
- icon: fontawesome/brands/github
link: https://github.com/funstory-ai/BabelDOC
- icon: fontawesome/brands/python
link: https://pypi.org/project/BabelDOC/

# Extensions
markdown_extensions:
- github-callouts
- markdown_include.include
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
guess_lang: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- def_list
- pymdownx.tasklist:
custom_checkbox: true
not_in_nav: |
/tutorials/**/*.md
# Page tree
nav:
- Home: index.md
- API:
- Async Translation API: ImplementationDetails/AsyncTranslate/AsyncTranslate.md
- Implementation Details:
- ImplementationDetails/README.md
- PDF Parsing: ImplementationDetails/PDFParsing/PDFParsing.md
- Layout Parser(.py): https://github.com/funstory-ai/BabelDOC/blob/main/babeldoc/document_il/midend/layout_parser.py
- Paragraph Finding: ImplementationDetails/ParagraphFinding/ParagraphFinding.md
- Styles and Formulas: ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md
- IL Translator: ImplementationDetails/ILTranslator/ILTranslator.md
- Typesetting: ImplementationDetails/Typesetting/Typesetting.md
- Font Mapper(.py): https://github.com/funstory-ai/BabelDOC/blob/main/babeldoc/document_il/utils/fontmap.py
- PDF Creation: ImplementationDetails/PDFCreation/PDFCreation.md
- Intro To PDF Object: intro-to-pdf-object.md
- Community:
- Code of Conduct: CODE_OF_CONDUCT.md
- Contributing:
- Contributing: CONTRIBUTING.md
- Contributor Reward: CONTRIBUTOR_REWARD.md
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,14 @@ max-complexity = 10 # 函数圈复杂度阈值
[dependency-groups]
dev = [
"bumpver>=2024.1130",
"markdown-callouts>=0.4.0",
"markdown-include>=0.8.1",
"mkdocs-git-authors-plugin>=0.9.2",
"mkdocs-git-committers-plugin-2>=2.5.0",
"mkdocs-git-revision-date-localized-plugin>=1.3.0",
"mkdocs-material[recommended]>=9.6.4",
"pre-commit>=4.1.0",
"pygments>=2.19.1",
"ruff>=0.9.2",
]

Expand Down
Loading

0 comments on commit e9605b8

Please sign in to comment.