Skip to content

Commit

Permalink
Display parser errors (#1)
Browse files Browse the repository at this point in the history
* Display parser errors

* Automatically update Changelog
  • Loading branch information
henryavila authored Oct 10, 2023
1 parent 4eef76a commit a085777
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Update Changelog"

on:
release:
types: [released]

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,26 @@ sempre a bri[A/E]lhar por [E]Ti
[E] Eu sou [B]filho do Rei do univer [B]- so,
{eoc}
```

will be rendered inside Laravel Nova Field as

![image](https://github.com/henryavila/laravel-nova-chordpro-field/assets/8429941/1e803e48-af04-4ee2-b9c9-8b67183eb070)

also, supports dark mode

![image](https://github.com/henryavila/laravel-nova-chordpro-field/assets/8429941/44878bb4-785f-40db-857f-928d0e19c8ee)


If the Chorpro has some invalid content, it will be displayed in Detail view

![image](https://github.com/henryavila/laravel-nova-chordpro-field/assets/8429941/ba7b8b60-8c6c-4a41-89e6-e84caae2233e)



This package is built with https://github.com/chordproject/chorpro-parser and https://github.com/eKoopmans/html2pdf.js and allows to
- Edit chordpro (simple TextArea editor)
- View a fully formatted song
- Display chordpro parser errors
- Generate a pdf with the formatted song
- Translate the displayed text like "Key", "Time", etc

Expand Down
2 changes: 1 addition & 1 deletion dist/css/field.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions resources/js/components/Chordpro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ const kebabCase = str => str
</div>
</div>

<div v-if="parser?.warnings?.length > 0" class="text-red-600 text-sm">
<div class="font-bold">{{__('Errors found')}}</div>
<div v-for="warn in parser?.warnings">&bullet; {{warn}}</div>
</div>

<div ref="report" class="font-mono" :class="{printing: 'text-gray-900'}">

Expand Down
3 changes: 2 additions & 1 deletion resources/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"Key in": "Key in",
"in": "em",
"save pdf": "save PDF",
"wait...": "wait..."
"wait...": "wait...",
"Errors found": "Errors found"
}
3 changes: 2 additions & 1 deletion resources/lang/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"Key in": "Tom em",
"in": "em",
"save pdf": "salvar PDF",
"wait...": "aguarde..."
"wait...": "aguarde...",
"Errors found": "Erros encontrados"
}

0 comments on commit a085777

Please sign in to comment.