Skip to content

Commit

Permalink
elm
Browse files Browse the repository at this point in the history
  • Loading branch information
nwolff committed Jan 2, 2024
1 parent 4944e9d commit 9fab647
Show file tree
Hide file tree
Showing 18 changed files with 437 additions and 151 deletions.
1 change: 0 additions & 1 deletion .envrc

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/elm-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Made by Isaac Van Doren. Source at https://github.com/isaacvando/elm-to-gh-pages.
name: Deploy an Elm app to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# Cancel current deployment when a new push occurs
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@v3

- name: Build Elm artifact
uses: jorelali/setup-elm@v5
with:
elm-version: 0.19.1
- run: elm make src/Main.elm --output=target/elm.js --optimize

- name: Install uglify.js
run: npm install uglify-js -g

- name: Uglify main.js
run: uglifyjs target/main.js --compress "pure_funcs=[F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9],pure_getters,keep_fargs=false,unsafe_comps,unsafe" | uglifyjs --mangle --output target/main.js

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

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "."

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
27 changes: 15 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# All types of virtualenvs
.direnv/
.venv/
.env/
venv/

# Always
__pycache__/

# IDEs
.vscode/
*.iml
.idea/
.vscode/

# npm
package.json
package-lock.json
node_modules/

# Elm
elm-stuff/
elm.js
repl-temp-*

# Our build setup
target/

# Mac
.DS_Store
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
## What this does
Deployed to:

When reopening a word mailmerge file and the backing excel file is not in the
expected location, then you will lose the filters and sort that were set.
https://nwolff.github.io/word-mailmerge-datasource/

This tool shows the filter and sort information of a mailmerge docx file, it looks like this :
---

SELECT * FROM /Users/wolff_n/Desktop/clients 10 ans.xlsx
WHERE ((Carte_Club_4Vallées = 'oui')) ORDER BY Nom
Requires elm0.19.1

## Running the online webapp
To install elm without being a sudoer:

https://word-mailmerge-datasource-yjvahykdxa-oa.a.run.app/
npm install elm

## Running from the command-line
To develop:

`./retrieve_datasource_query.py` takes the path to a docx or dotx file and displays the datasource query
elm reactor

Or if you've installed elm-live:

elm-live.js src/Main.elm --open -- --output target/elm.js --debug

To build:

elm make src/Main.elm --output target/elm.js

Deployed automatically upon push to main:

Using https://github.com/isaacvando/elm-to-gh-pages
File renamed without changes.
Binary file added assets/favicon.ico
Binary file not shown.
11 changes: 11 additions & 0 deletions assets/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.dropzone {
border-radius: 20px;
width: 480px;
height: 100px;
margin: 100px auto;
padding: 20px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
35 changes: 35 additions & 0 deletions elm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"type": "application",
"source-directories": [
"src"
],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"agu-z/elm-zip": "3.0.1",
"elm/browser": "1.0.2",
"elm/core": "1.0.5",
"elm/file": "1.0.5",
"elm/html": "1.0.0",
"elm/json": "1.1.3",
"ymtszw/elm-xml-decode": "3.2.1"
},
"indirect": {
"elm/bytes": "1.0.8",
"elm/parser": "1.1.0",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.3",
"elm-community/list-extra": "8.7.0",
"folkertdev/elm-flate": "2.0.5",
"jinjor/elm-xml-parser": "2.0.0",
"justinmimbs/date": "4.0.1",
"justinmimbs/time-extra": "1.1.1",
"rtfeldman/elm-hex": "1.0.0"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
21 changes: 21 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>Word Mailmerge Query</title>

<link rel="icon" href="assets/favicon.ico" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<link href="assets/bootstrap.min.css" rel="stylesheet" media="screen" />

<link href="assets/style.css" rel="stylesheet" media="screen" />

<script type="text/javascript" src="target/elm.js"></script>
</head>
<body>
<script type="text/javascript">
Elm.Main.init();
</script>
</body>
</html>
38 changes: 0 additions & 38 deletions main.py

This file was deleted.

2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

39 changes: 0 additions & 39 deletions retrieve_datasource_query.py

This file was deleted.

Loading

0 comments on commit 9fab647

Please sign in to comment.