Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy to GitHub Pages

on:
push:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Prepare deployment directory
run: |
cp src/callsign.js docs/
cp src/callsign.css docs/

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules/
package-lock.json
test-page.html
test.html
docs/callsign.js
docs/callsign.css
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# callsign.js
This JavaScript library gives website users more ways to interact with written [ITU](https://www.itu.int/en/) call signs, including for amateur radio.

## Demo
See a live example at [https://phieri.github.io/callsign.js/](https://phieri.github.io/callsign.js/)

# Usage
Upload callsign.js and callsign.css to the webserver and add callsign.js to the `<head>` section.
```html
Expand Down
34 changes: 34 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>callsign.js example page</title>
<meta name="color-scheme" content="light dark">
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@1.*/css/pico.classless.min.css">
<link rel="stylesheet" href="callsign.css">
<script id="callsign-js" src="callsign.js" data-flag="true" data-monospace="true" data-phonetic="true" data-search="true" defer></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
<header>
<h1>callsign.js example page</h1>
</header>
<main>
<ul>
<li>Marked up: <call-sign>ZR9OOO</call-sign> and so on.</li>
<li>Marked up and contains zero: <call-sign>LN0ABC</call-sign> and so on.</li>
<li>Not marked up: SA9BC and so on.</li>
<li>Not marked up OY9ZZZ and so on.</li>
<li>Marked up and contains a zero:
<call-sign>OM0ZAS</call-sign>. More text. More <strong>random text</strong> and so on.</li>
<li>Not marked up and with a prefix that is not in use: YN9ZZZ and so on.</li>
</ul>
</main>
<footer>
<a href="https://github.com/phieri/callsign.js" hreflang="en">[ GitHub ]</a>
</footer>
</body>

</html>
Loading