Skip to content

Commit 400e559

Browse files
committed
Merge branch 'feature/restructure-output-dirs'
2 parents cff537c + d188293 commit 400e559

8 files changed

Lines changed: 16 additions & 19 deletions

File tree

.github/workflows/fetch-sfs-workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Process JSON files to Markdown files with Selex tags
4646
run: |
47-
python sfs_processor.py --input sfs_json --output SFS --formats md-markers
47+
python sfs_processor.py --input sfs_json --output output/md --formats md-markers
4848
env:
4949
PYTHONPATH: ${{ github.workspace }}
5050

@@ -60,7 +60,7 @@ jobs:
6060
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
6161
6262
# Create a new branch for commits if we have changes
63-
git add SFS/ sfs_json/
63+
git add output/md/ sfs_json/
6464
if git diff --staged --quiet; then
6565
echo "Inga nya filer att committa"
6666
echo "has_changes=false" >> $GITHUB_OUTPUT

.github/workflows/html-export-workflow.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ jobs:
4848
- name: Generate HTML export
4949
run: |
5050
if [ -n "${{ inputs.filter }}" ]; then
51-
python sfs_processor.py --input sfs_json --output SFS --formats html --filter "${{ inputs.filter }}"
51+
python sfs_processor.py --input sfs_json --output output/html --formats html --filter "${{ inputs.filter }}"
5252
else
53-
python sfs_processor.py --input sfs_json --output SFS --formats html
53+
python sfs_processor.py --input sfs_json --output output/html --formats html
5454
fi
5555
env:
5656
PYTHONPATH: ${{ github.workspace }}
@@ -89,9 +89,9 @@ jobs:
8989
aws configure set region us-east-1
9090
aws configure set output json
9191
92-
- name: Upload SFS folder to Cloudflare R2
92+
- name: Upload HTML folder to Cloudflare R2
9393
run: |
94-
aws s3 sync SFS/ s3://${{ secrets.CLOUDFLARE_R2_BUCKET_NAME }}/sfs/ \
94+
aws s3 sync output/html/ s3://${{ secrets.CLOUDFLARE_R2_BUCKET_NAME }}/sfs/ \
9595
--endpoint-url https://${{ secrets.CLOUDFLARE_R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \
9696
--delete \
9797
--cache-control "public, max-age=3600" \

.github/workflows/testdocs-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ jobs:
3939
4040
- name: Process test JSON files to Markdown files
4141
run: |
42-
python sfs_processor.py --input data/testdocs/rkrattsbaser --output SFS --formats md,md-markers,git
42+
python sfs_processor.py --input data/testdocs/rkrattsbaser --output output/md --formats md,md-markers,git
4343
env:
4444
PYTHONPATH: ${{ github.workspace }}

.github/workflows/upcoming-changes-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Run upcoming changes script
3333
run: |
3434
# Kör scriptet på markdown-katalogen för att uppdatera kommande.yaml
35-
python temporal/upcoming_changes.py SFS/
35+
python temporal/upcoming_changes.py output/md/
3636
env:
3737
PYTHONPATH: ${{ github.workspace }}
3838

@@ -42,7 +42,7 @@ jobs:
4242
# Detta gör att vi kan hämta ikapp missade dagar om jobbet misslyckats
4343
eval $(python temporal/get_temporal_date_range.py)
4444
echo "Bearbetar temporal commits från $FROM_DATE till $TO_DATE"
45-
python scripts/temporal_commits_batch.py SFS/ --from-date "$FROM_DATE" --to-date "$TO_DATE" --verbose
45+
python scripts/temporal_commits_batch.py output/md/ --from-date "$FROM_DATE" --to-date "$TO_DATE" --verbose
4646
env:
4747
PYTHONPATH: ${{ github.workspace }}
4848
GIT_GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
@@ -55,7 +55,7 @@ jobs:
5555
- name: Commit and push kommande.yaml updates
5656
run: |
5757
# Lägg till den uppdaterade kommande.yaml filen
58-
git add data/kommande.yaml
58+
git add output/kommande.yaml
5959
6060
if git diff --staged --quiet; then
6161
echo "Inga ändringar i kommande.yaml"

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ htmlcov/
1414

1515
# Ignore output files
1616
logs/
17-
output/
18-
sfs-output/
19-
data/kommande.yaml
17+
output/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pip install -r requirements.txt
2121
Konvertera JSON-filer med författningar till Markdown:
2222

2323
```bash
24-
python sfs_processor.py --input sfs_json --output SFS --formats md-markers
24+
python sfs_processor.py --input sfs_json --output output/md --formats md-markers
2525
```
2626

2727
## Output-format
@@ -73,7 +73,7 @@ Nedladdade filer sparas som standard i katalogen `sfs_docs`. Du kan ange annan k
7373
Konvertera alla JSON-filer i en katalog till Markdown:
7474

7575
```bash
76-
python sfs_processor.py --input sfs_json --output SFS --formats md-markers
76+
python sfs_processor.py --input sfs_json --output output/md --formats md-markers
7777
```
7878

7979
### Struktur av genererade Markdown-filer
@@ -175,7 +175,7 @@ För att se hur en lag såg ut vid ett specifikt datum:
175175

176176
```bash
177177
# Se hur lagen såg ut 2023-01-01
178-
python sfs_processor.py --input sfs_json --output SFS --formats md --target-date 2023-01-01
178+
python sfs_processor.py --input sfs_json --output output/md --formats md --target-date 2023-01-01
179179
```
180180

181181
Detta är användbart för att skapa historiska versioner eller för att förstå hur lagen såg ut vid en viss tidpunkt.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ omit = [
111111
".venv/*",
112112
"venv/*",
113113
"sfs_docs/*",
114-
"SFS/*",
115114
"output/*",
116115
]
117116

temporal/upcoming_changes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
2121
## Output Format
2222
23-
The module generates a YAML file at `data/kommande.yaml` with the following structure:
23+
The module generates a YAML file at `output/kommande.yaml` with the following structure:
2424
2525
```yaml
2626
'2025-01-15':
@@ -60,7 +60,7 @@
6060
from typing import List, Dict, Optional
6161
from pathlib import Path
6262

63-
UPCOMING_CHANGES_FILE_PATH = "data/kommande.yaml"
63+
UPCOMING_CHANGES_FILE_PATH = "output/kommande.yaml"
6464

6565

6666

0 commit comments

Comments
 (0)