Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tokenmill/accelerated-text
Browse files Browse the repository at this point in the history
  • Loading branch information
rokasramas committed Mar 2, 2021
2 parents 5dcd7a1 + b47451c commit 6c0446a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/repo-traffic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
ref: "traffic"
ref: "master"

# Calculates traffic and clones and stores in CSV file
- name: GitHub traffic
Expand All @@ -29,4 +29,4 @@ jobs:
author_name: AccTextBot
message: "GitHub traffic"
add: "./.stats/traffic/*"
ref: "traffic" # commits to branch "traffic"
ref: "master"
2 changes: 2 additions & 0 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ run-local:
clojure -m api.server

export-document-plan:
@echo "WARNING: This rule will be removed soon, check https://accelerated-text.readthedocs.io/en/latest/export/ for export instructions."
@curl -s -X POST http://localhost:3001/_graphql \
-H "Content-Type: application/json" \
-d "{\"query\": \"{documentPlan(id:\\\"$(id)\\\",name:\\\"$(name)\\\",kind:\\\"Document\\\"){id uid name kind blocklyXml documentPlan}}\"}" | \
jq -r '.data.documentPlan' | \
jq '.documentPlan = (.documentPlan | fromjson)'

export-all-document-plans:
@echo "WARNING: This rule will be removed soon, check https://accelerated-text.readthedocs.io/en/latest/export/ for export instructions."
@curl -s -X POST http://localhost:3001/_graphql \
-H "Content-Type: application/json" \
-d "{\"query\": \"{documentPlans{items{id uid name kind blocklyXml documentPlan}}}\"}" | \
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ jobs:
inputs:
command: build
repository: acctext/frontend
dockerfile: front-end/Dockerfile.builder
dockerfile: front-end/Dockerfile
containerRegistry: dockerhub
buildContext: .
tags: |
latest
$(Build.SourceVersion)
arguments: --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg ACC_TEXT_API_URL="http://localhost:3001" --build-arg ACC_TEXT_GRAPHQL_URL="http://localhost:3001/_graphql" --build-arg ACC_TEXT_DATA_FILES_BUCKET="http://localhost:3001/accelerated-text-data-files"
arguments: --build-arg BUILDKIT_INLINE_CACHE=1

- task: Docker@2
displayName: Push front-end image
Expand Down
31 changes: 31 additions & 0 deletions docs/export.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Generated text export

When document plan is ready, we can export generated text using one of utility functions that are included in Accelerated Text project.

Go to `utils` folder located in project root, and run this command in the terminal:
Expand All @@ -24,3 +26,32 @@ INFO u.generate - Data Text Processing with GATE has 4 variations
```

Output file will contain original data as well as an additional `Variants` column at the end with text variants that were generated.

# Document plan export

To be able to share document plans or save them as a backup, go to `utils` folder located in project root and run this command in the terminal:
```
make export-all-document-plans
```

This should produce output similar to this:
```
INFO u.document-plan - Writing: ../api/resources/document-plans/dlg/uTbZELWTIRnxCfmWLGfq.json
INFO u.document-plan - Writing: ../api/resources/document-plans/dlg/AHOPQhdyQdcRpEngZjLk.json
INFO u.document-plan - Writing: ../api/resources/document-plans/dlg/FtrMQwvHjYCGwNJqtuWT.json
INFO u.document-plan - Writing: ../api/resources/document-plans/dlg/aRBRdMShfBCpwJRERXUZ.json
INFO u.document-plan - Writing: ../api/resources/document-plans/dlg/yQqvEjwWbHlZVXxJtqYE.json
INFO u.document-plan - Writing: ../api/resources/document-plans/amr/vNfPkkdMRhOpItYo.json
INFO u.document-plan - Writing: ../api/resources/document-plans/dlg/oITyUhfqXtrYcwtWBcrz.json
INFO u.document-plan - Writing: ../api/resources/document-plans/dp/fFOhndCHismNBnal.json
INFO u.document-plan - Writing: ../api/resources/document-plans/dlg/hfTnGajQTQkAQMHMzjPk.json
INFO u.document-plan - Writing: ../api/resources/document-plans/dlg/UYvoFHjkRcqynZROytYV.json
INFO u.document-plan - Writing: ../api/resources/document-plans/dp/dotafNstSKQPbfNt.json
```

The document plans will be saved in `api/resources/document-plans` by default. This can be changed by providing `dir` argument like this:
```
make export-all-document-plans dir=my-output-dir
```

Whenever document plans are exported and kept in the default directory (`api/resources/document-plans`), they will be initialized every time Accelerated Text is run.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nav:
- Creating a dictionary: dictionary.md
- Adding operations: operations.md
- Selecting languages: languages.md
- Exporting data: export.md
- Exporting: export.md
- Advanced Topics:
- Blocks: blocks.md
- Reader Model: reader-models.md
Expand Down
5 changes: 5 additions & 0 deletions utils/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
print-document-plan:
clojure -M:dp print-plan $(dp)

export-all-document-plans:
clojure -M:dp export-plans $(dir)

0 comments on commit 6c0446a

Please sign in to comment.