BabelDOC 0.1.6rc0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. babeldoc-0.1.6rc0/.github/ISSUE_TEMPLATE/bug_report.md +34 -0
  2. babeldoc-0.1.6rc0/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  3. babeldoc-0.1.6rc0/.github/dependabot.yml +21 -0
  4. babeldoc-0.1.6rc0/.github/labels.yml +66 -0
  5. babeldoc-0.1.6rc0/.github/release-drafter.yml +42 -0
  6. babeldoc-0.1.6rc0/.github/workflows/codeql.yml +92 -0
  7. babeldoc-0.1.6rc0/.github/workflows/labeler.yml +36 -0
  8. babeldoc-0.1.6rc0/.github/workflows/publish-to-pypi.yml +153 -0
  9. babeldoc-0.1.6rc0/.github/workflows/test.yml +40 -0
  10. babeldoc-0.1.6rc0/.gitignore +30 -0
  11. babeldoc-0.1.6rc0/.pre-commit-config.yaml +12 -0
  12. babeldoc-0.1.6rc0/LICENSE +661 -0
  13. babeldoc-0.1.6rc0/PKG-INFO +283 -0
  14. babeldoc-0.1.6rc0/README.md +251 -0
  15. babeldoc-0.1.6rc0/babeldoc/__init__.py +1 -0
  16. babeldoc-0.1.6rc0/babeldoc/asynchronize/__init__.py +51 -0
  17. babeldoc-0.1.6rc0/babeldoc/const.py +7 -0
  18. babeldoc-0.1.6rc0/babeldoc/converter.py +510 -0
  19. babeldoc-0.1.6rc0/babeldoc/document_il/__init__.py +43 -0
  20. babeldoc-0.1.6rc0/babeldoc/document_il/backend/__init__.py +0 -0
  21. babeldoc-0.1.6rc0/babeldoc/document_il/backend/pdf_creater.py +402 -0
  22. babeldoc-0.1.6rc0/babeldoc/document_il/frontend/__init__.py +0 -0
  23. babeldoc-0.1.6rc0/babeldoc/document_il/frontend/il_creater.py +348 -0
  24. babeldoc-0.1.6rc0/babeldoc/document_il/il_version_1.py +799 -0
  25. babeldoc-0.1.6rc0/babeldoc/document_il/il_version_1.rnc +141 -0
  26. babeldoc-0.1.6rc0/babeldoc/document_il/il_version_1.rng +390 -0
  27. babeldoc-0.1.6rc0/babeldoc/document_il/il_version_1.xsd +235 -0
  28. babeldoc-0.1.6rc0/babeldoc/document_il/midend/__init__.py +0 -0
  29. babeldoc-0.1.6rc0/babeldoc/document_il/midend/add_debug_information.py +138 -0
  30. babeldoc-0.1.6rc0/babeldoc/document_il/midend/il_translator.py +553 -0
  31. babeldoc-0.1.6rc0/babeldoc/document_il/midend/layout_parser.py +180 -0
  32. babeldoc-0.1.6rc0/babeldoc/document_il/midend/paragraph_finder.py +452 -0
  33. babeldoc-0.1.6rc0/babeldoc/document_il/midend/remove_descent.py +168 -0
  34. babeldoc-0.1.6rc0/babeldoc/document_il/midend/styles_and_formulas.py +701 -0
  35. babeldoc-0.1.6rc0/babeldoc/document_il/midend/typesetting.py +761 -0
  36. babeldoc-0.1.6rc0/babeldoc/document_il/translator/__init__.py +0 -0
  37. babeldoc-0.1.6rc0/babeldoc/document_il/translator/cache.py +145 -0
  38. babeldoc-0.1.6rc0/babeldoc/document_il/translator/translator.py +267 -0
  39. babeldoc-0.1.6rc0/babeldoc/document_il/utils/fontmap.py +227 -0
  40. babeldoc-0.1.6rc0/babeldoc/document_il/utils/layout_helper.py +467 -0
  41. babeldoc-0.1.6rc0/babeldoc/document_il/utils/style_helper.py +86 -0
  42. babeldoc-0.1.6rc0/babeldoc/document_il/xml_converter.py +51 -0
  43. babeldoc-0.1.6rc0/babeldoc/docvision/README.md +0 -0
  44. babeldoc-0.1.6rc0/babeldoc/docvision/__init__.py +0 -0
  45. babeldoc-0.1.6rc0/babeldoc/docvision/doclayout.py +278 -0
  46. babeldoc-0.1.6rc0/babeldoc/docvision/rpc_doclayout.py +162 -0
  47. babeldoc-0.1.6rc0/babeldoc/high_level.py +468 -0
  48. babeldoc-0.1.6rc0/babeldoc/main.py +466 -0
  49. babeldoc-0.1.6rc0/babeldoc/pdfinterp.py +464 -0
  50. babeldoc-0.1.6rc0/babeldoc/progress_monitor.py +146 -0
  51. babeldoc-0.1.6rc0/babeldoc/translation_config.py +156 -0
  52. babeldoc-0.1.6rc0/docs/CODE_OF_CONDUCT.md +128 -0
  53. babeldoc-0.1.6rc0/docs/CONTRIBUTING.md +177 -0
  54. babeldoc-0.1.6rc0/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md +180 -0
  55. babeldoc-0.1.6rc0/docs/ImplementationDetails/ILTranslator/ILTranslator.md +105 -0
  56. babeldoc-0.1.6rc0/docs/ImplementationDetails/PDFCreation/PDFCreation.md +144 -0
  57. babeldoc-0.1.6rc0/docs/ImplementationDetails/PDFParsing/PDFParsing.md +143 -0
  58. babeldoc-0.1.6rc0/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md +75 -0
  59. babeldoc-0.1.6rc0/docs/ImplementationDetails/README.md +35 -0
  60. babeldoc-0.1.6rc0/docs/ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md +93 -0
  61. babeldoc-0.1.6rc0/docs/ImplementationDetails/Typesetting/Typesetting.md +109 -0
  62. babeldoc-0.1.6rc0/docs/README.md +8 -0
  63. babeldoc-0.1.6rc0/docs/deploy.sh +47 -0
  64. babeldoc-0.1.6rc0/docs/images/banner.png +0 -0
  65. babeldoc-0.1.6rc0/docs/images/preview.gif +0 -0
  66. babeldoc-0.1.6rc0/docs/intro-to-pdf-object.md +148 -0
  67. babeldoc-0.1.6rc0/pyproject.toml +133 -0
  68. babeldoc-0.1.6rc0/uv.lock +1354 -0
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: 'bug'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. macOS Sequoia 15.3, Windows 11]
28
+ - Version [e.g. 0.1.0]
29
+
30
+ **Input PDF file:**
31
+ if applicable, attach the input PDF file here.
32
+
33
+ **Additional context**
34
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: 'enhancement'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,21 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ # - package-ecosystem: pip
8
+ # directory: "/.github/workflows"
9
+ # schedule:
10
+ # interval: weekly
11
+ # - package-ecosystem: pip
12
+ # directory: "/docs"
13
+ # schedule:
14
+ # interval: weekly
15
+ - package-ecosystem: pip
16
+ directory: "/"
17
+ schedule:
18
+ interval: weekly
19
+ versioning-strategy: lockfile-only
20
+ allow:
21
+ - dependency-type: "all"
@@ -0,0 +1,66 @@
1
+ ---
2
+ # Labels names are important as they are used by Release Drafter to decide
3
+ # regarding where to record them in changelog or if to skip them.
4
+ #
5
+ # The repository labels will be automatically configured using this file and
6
+ # the GitHub Action https://github.com/marketplace/actions/github-labeler.
7
+ - name: breaking
8
+ description: Breaking Changes
9
+ color: "bfd4f2"
10
+ - name: bug
11
+ description: Something isn't working
12
+ color: "d73a4a"
13
+ - name: build
14
+ description: Build System and Dependencies
15
+ color: "bfdadc"
16
+ - name: ci
17
+ description: Continuous Integration
18
+ color: "4a97d6"
19
+ - name: dependencies
20
+ description: Pull requests that update a dependency file
21
+ color: "0366d6"
22
+ - name: documentation
23
+ description: Improvements or additions to documentation
24
+ color: "0075ca"
25
+ - name: duplicate
26
+ description: This issue or pull request already exists
27
+ color: "cfd3d7"
28
+ - name: enhancement
29
+ description: New feature or request
30
+ color: "a2eeef"
31
+ - name: github_actions
32
+ description: Pull requests that update Github_actions code
33
+ color: "000000"
34
+ - name: good first issue
35
+ description: Good for newcomers
36
+ color: "7057ff"
37
+ - name: help wanted
38
+ description: Extra attention is needed
39
+ color: "008672"
40
+ - name: invalid
41
+ description: This doesn't seem right
42
+ color: "e4e669"
43
+ - name: performance
44
+ description: Performance
45
+ color: "016175"
46
+ - name: python
47
+ description: Pull requests that update Python code
48
+ color: "2b67c6"
49
+ - name: question
50
+ description: Further information is requested
51
+ color: "d876e3"
52
+ - name: refactoring
53
+ description: Refactoring
54
+ color: "ef67c4"
55
+ - name: removal
56
+ description: Removals and Deprecations
57
+ color: "9ae7ea"
58
+ - name: style
59
+ description: Style
60
+ color: "c120e5"
61
+ - name: testing
62
+ description: Testing
63
+ color: "b1fc6f"
64
+ - name: wontfix
65
+ description: This will not be worked on
66
+ color: "ffffff"
@@ -0,0 +1,42 @@
1
+ name-template: 'v$RESOLVED_VERSION'
2
+ tag-template: 'v$RESOLVED_VERSION'
3
+ categories:
4
+ - title: '๐Ÿš€ Features'
5
+ labels:
6
+ - 'feature'
7
+ - 'enhancement'
8
+ - title: '๐Ÿ› Bug Fixes'
9
+ labels:
10
+ - 'fix'
11
+ - 'bugfix'
12
+ - 'bug'
13
+ - title: '๐Ÿงฐ Maintenance'
14
+ labels:
15
+ - 'chore'
16
+ - 'maintenance'
17
+ - 'refactor'
18
+ - title: '๐Ÿ“ Documentation'
19
+ labels:
20
+ - 'docs'
21
+ - 'documentation'
22
+ change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
23
+ change-title-escapes: '\<*_&' # You can add # and @ to disable mentions
24
+ version-resolver:
25
+ major:
26
+ labels:
27
+ - 'major'
28
+ minor:
29
+ labels:
30
+ - 'minor'
31
+ patch:
32
+ labels:
33
+ - 'patch'
34
+ default: patch
35
+ template: |
36
+ ## Changes
37
+
38
+ $CHANGES
39
+
40
+ ## Contributors
41
+
42
+ $CONTRIBUTORS
@@ -0,0 +1,92 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL Advanced"
13
+
14
+ on:
15
+ push:
16
+ pull_request:
17
+ branches: [ "main" ]
18
+ schedule:
19
+ - cron: '36 14 * * 1'
20
+
21
+ jobs:
22
+ analyze:
23
+ name: Analyze (${{ matrix.language }})
24
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
25
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
26
+ # - https://gh.io/supported-runners-and-hardware-resources
27
+ # - https://gh.io/using-larger-runners (GitHub.com only)
28
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
29
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
30
+ permissions:
31
+ # required for all workflows
32
+ security-events: write
33
+
34
+ # required to fetch internal or private CodeQL packs
35
+ packages: read
36
+
37
+ # only required for workflows in private repositories
38
+ actions: read
39
+ contents: read
40
+
41
+ strategy:
42
+ fail-fast: false
43
+ matrix:
44
+ include:
45
+ - language: python
46
+ build-mode: none
47
+ - language: actions
48
+ # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
49
+ # Use `c-cpp` to analyze code written in C, C++ or both
50
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
51
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
52
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
53
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
54
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
55
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
56
+ steps:
57
+ - name: Checkout repository
58
+ uses: actions/checkout@v4
59
+
60
+ # Initializes the CodeQL tools for scanning.
61
+ - name: Initialize CodeQL
62
+ uses: github/codeql-action/init@v3
63
+ with:
64
+ languages: ${{ matrix.language }}
65
+ build-mode: ${{ matrix.build-mode }}
66
+ # If you wish to specify custom queries, you can do so here or in a config file.
67
+ # By default, queries listed here will override any specified in a config file.
68
+ # Prefix the list here with "+" to use these queries and those in the config file.
69
+
70
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
71
+ # queries: security-extended,security-and-quality
72
+
73
+ # If the analyze step fails for one of the languages you are analyzing with
74
+ # "We were unable to automatically build your code", modify the matrix above
75
+ # to set the build mode to "manual" for that language. Then modify this step
76
+ # to build your code.
77
+ # โ„น๏ธ Command-line programs to run using the OS shell.
78
+ # ๐Ÿ“š See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79
+ - if: matrix.build-mode == 'manual'
80
+ shell: bash
81
+ run: |
82
+ echo 'If you are using a "manual" build mode for one or more of the' \
83
+ 'languages you are analyzing, replace this with the commands to build' \
84
+ 'your code, for example:'
85
+ echo ' make bootstrap'
86
+ echo ' make release'
87
+ exit 1
88
+
89
+ - name: Perform CodeQL Analysis
90
+ uses: github/codeql-action/analyze@v3
91
+ with:
92
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,36 @@
1
+ name: Labeler
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - 'main'
7
+ paths:
8
+ - '.github/labels.yml'
9
+ - '.github/workflows/labels.yml'
10
+ pull_request:
11
+ paths:
12
+ - '.github/labels.yml'
13
+ - '.github/workflows/labels.yml'
14
+
15
+ permissions:
16
+ contents: read
17
+ issues: write
18
+ pull-requests: write
19
+
20
+ jobs:
21
+ labeler:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - name: Check out the repository
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Run Labeler
28
+ uses: crazy-max/ghaction-github-labeler@31674a3852a9074f2086abcf1c53839d466a47e7 # v5.2.0
29
+ with:
30
+ skip-delete: true
31
+ dry-run: ${{ github.event_name == 'pull_request' }}
32
+ github-token: ${{ secrets.GITHUB_TOKEN }}
33
+ yaml-file: .github/labels.yml
34
+ exclude: |
35
+ help*
36
+ *issue
@@ -0,0 +1,153 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+
9
+ permissions:
10
+ id-token: write
11
+ contents: write
12
+ pull-requests: write
13
+
14
+ jobs:
15
+ check-repository:
16
+ name: Check if running in main repository
17
+ runs-on: ubuntu-latest
18
+ outputs:
19
+ is_main_repo: ${{ github.repository == 'funstory-ai/BabelDOC' }}
20
+ steps:
21
+ - run: echo "Running repository check"
22
+
23
+ build:
24
+ name: Build distribution ๐Ÿ“ฆ
25
+ needs: check-repository
26
+ if: needs.check-repository.outputs.is_main_repo == 'true'
27
+ runs-on: ubuntu-latest
28
+ outputs:
29
+ is_release: ${{ steps.check-version.outputs.tag }}
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ with:
33
+ persist-credentials: true
34
+ fetch-depth: 2
35
+ token: ${{ secrets.GITHUB_TOKEN }}
36
+
37
+ - name: Setup uv with Python 3.12
38
+ uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2
39
+ with:
40
+ python-version: "3.12"
41
+ enable-cache: true
42
+ cache-dependency-glob: "uv.lock"
43
+
44
+ - name: Check if there is a parent commit
45
+ id: check-parent-commit
46
+ run: |
47
+ echo "sha=$(git rev-parse --verify --quiet HEAD^)" >> $GITHUB_OUTPUT
48
+
49
+ - name: Detect and tag new version
50
+ id: check-version
51
+ if: steps.check-parent-commit.outputs.sha
52
+ uses: salsify/action-detect-and-tag-new-version@b1778166f13188a9d478e2d1198f993011ba9864 # v2.0.3
53
+ with:
54
+ version-command: |
55
+ cat pyproject.toml | grep "version = " | head -n 1 | awk -F'"' '{print $2}'
56
+
57
+ - name: Install Dependencies
58
+ run: |
59
+ uv sync
60
+
61
+ - name: Bump version for developmental release
62
+ if: "! steps.check-version.outputs.tag"
63
+ run: |
64
+ version=$(bumpver update --patch --tag=final --dry 2>&1 | grep "New Version" | awk '{print $NF}') &&
65
+ bumpver update --set-version $version.dev$(date +%s)
66
+
67
+ - name: Build package
68
+ run: "uv build"
69
+
70
+ - name: Store the distribution packages
71
+ uses: actions/upload-artifact@v4.6.0
72
+ with:
73
+ name: python-package-distributions
74
+ path: dist/
75
+
76
+ publish-to-pypi:
77
+ name: Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to PyPI
78
+ if: needs.build.outputs.is_release != ''
79
+ needs:
80
+ - check-repository
81
+ - build
82
+ runs-on: ubuntu-latest
83
+ environment:
84
+ name: pypi
85
+ url: https://pypi.org/p/yadt
86
+
87
+ permissions:
88
+ id-token: write
89
+
90
+ steps:
91
+ - name: Download all the dists
92
+ uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
93
+ with:
94
+ name: python-package-distributions
95
+ path: dist/
96
+
97
+ - name: Publish distribution ๐Ÿ“ฆ to PyPI
98
+ uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
99
+
100
+ publish-to-testpypi:
101
+ name: Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to TestPyPI
102
+ if: needs.build.outputs.is_release == ''
103
+ needs:
104
+ - check-repository
105
+ - build
106
+ runs-on: ubuntu-latest
107
+ environment:
108
+ name: testpypi
109
+ url: https://test.pypi.org/p/yadt
110
+
111
+ permissions:
112
+ id-token: write
113
+
114
+ steps:
115
+ - name: Download all the dists
116
+ uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
117
+ with:
118
+ name: python-package-distributions
119
+ path: dist/
120
+
121
+ - name: Publish distribution ๐Ÿ“ฆ to TestPyPI
122
+ uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
123
+ with:
124
+ repository-url: https://test.pypi.org/legacy/
125
+
126
+ post-release:
127
+ name: Post Release Tasks
128
+ needs:
129
+ - check-repository
130
+ - build
131
+ - publish-to-pypi
132
+ - publish-to-testpypi
133
+ if: |
134
+ always() && needs.check-repository.outputs.is_main_repo == 'true' &&
135
+ (needs.publish-to-pypi.result == 'success' || needs.publish-to-testpypi.result == 'success')
136
+ runs-on: ubuntu-latest
137
+ permissions:
138
+ contents: write
139
+ pull-requests: write
140
+ steps:
141
+ - uses: actions/checkout@v4
142
+ with:
143
+ persist-credentials: true
144
+ fetch-depth: 2
145
+ token: ${{ secrets.GITHUB_TOKEN }}
146
+
147
+ - name: Publish the release notes
148
+ uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
149
+ with:
150
+ publish: ${{ needs.build.outputs.is_release != '' }}
151
+ tag: ${{ needs.build.outputs.is_release }}
152
+ env:
153
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,40 @@
1
+ name: Run Tests ๐Ÿงช
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ branches: ["main"]
7
+
8
+ permissions:
9
+ contents: read
10
+ pull-requests: read
11
+
12
+ jobs:
13
+ test:
14
+ name: Run Python Tests
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ matrix:
18
+ python-version: ["3.10", "3.11", "3.12"]
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ with:
23
+ persist-credentials: false
24
+ - name: Cached models
25
+ id: cache-mods
26
+ uses: actions/cache@v4.2.0
27
+ with:
28
+ path: ~/.cache/huggingface/hub/models--wybxc--DocLayout-YOLO-DocStructBench-onnx
29
+ key: ${{runner.os}}-huggingmodel-wybxc--DocLayout-YOLO-DocStructBench-onnx
30
+ - name: Setup uv with Python ${{ matrix.python-version }}
31
+ uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2
32
+ with:
33
+ python-version: ${{ matrix.python-version }}
34
+ enable-cache: true
35
+ cache-dependency-glob: "uv.lock"
36
+
37
+ - name: Run tests
38
+ run: |
39
+ uv run babeldoc --help
40
+ uv run babeldoc --bing --files examples/ci/test.pdf
@@ -0,0 +1,30 @@
1
+ # Logs
2
+ web/logs
3
+ web/*.log
4
+ web/npm-debug.log*
5
+ web/yarn-debug.log*
6
+ web/yarn-error.log*
7
+ web/pnpm-debug.log*
8
+ web/lerna-debug.log*
9
+
10
+ web/node_modules
11
+ web/dist
12
+ web/dist-ssr
13
+ web/*.local
14
+
15
+ **/*.so
16
+ *.pdf
17
+ *.docx
18
+ *.json
19
+ **/*.pyc
20
+ .venv
21
+ .idea
22
+ *.egg-info
23
+ .DS_Store
24
+ .vscode
25
+ __pycache__
26
+ .ruff_cache
27
+ yadt.toml
28
+ examples/
29
+ /make_gif.py
30
+ /dist
@@ -0,0 +1,12 @@
1
+ files: '^.*\.py$'
2
+ repos:
3
+ - repo: https://github.com/astral-sh/ruff-pre-commit
4
+ # Ruff version.
5
+ rev: v0.9.5
6
+ hooks:
7
+ # Run the linter.
8
+ - id: ruff
9
+ args: [ "--fix",
10
+ "--ignore=E203,E261,E501,E741,F841" ]
11
+ # Run the formatter.
12
+ - id: ruff-format