Skip to content

Commit

Permalink
Summary
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryRyumin committed Jan 10, 2024
1 parent daf21e2 commit 9f21247
Show file tree
Hide file tree
Showing 4 changed files with 443 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; https://www.flake8rules.com/

[flake8]
max-line-length = 120
ignore = E203, E402, E741, W503
53 changes: 53 additions & 0 deletions .github/workflows/parse_markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Parse Markdown and Generate JSON

on:
schedule:
- cron: '0 0 * * *' # 00:00 UTC
workflow_dispatch:

jobs:
parse_markdown:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10.11

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bs4 markdown2 prettytable PyGithub flake8 black
continue-on-error: true

- name: Run Flake8 (Linting)
run: flake8 code/

- name: Check code formatting
run: black --check code/

- name: Run Markdown Parser
id: parse
run: python code/markdown_to_json_parser.py
working-directory: ${{ github.workspace }}
continue-on-error: true
env:
PAPER_TOKEN: ${{ secrets.PAPER_TOKEN }}

- name: Upload JSON files
uses: actions/upload-artifact@v4
with:
name: json_data
path: ${{ github.workspace }}/json_data

- name: Set output status
run: echo "status=${{ steps.parse.outcome }}" >> $GITHUB_ENV
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,5 @@ dmypy.json
.pyre/

# Custom
*.pdf
*.pdf
local_json_data/
Loading

0 comments on commit 9f21247

Please sign in to comment.