diff --git a/.github/workflows/repo-traffic.yml b/.github/workflows/repo-traffic.yml index c8a3115f0..7f4cb5d05 100644 --- a/.github/workflows/repo-traffic.yml +++ b/.github/workflows/repo-traffic.yml @@ -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 @@ -29,4 +29,4 @@ jobs: author_name: AccTextBot message: "GitHub traffic" add: "./.stats/traffic/*" - ref: "traffic" # commits to branch "traffic" \ No newline at end of file + ref: "master" diff --git a/api/Makefile b/api/Makefile index 5d63553dd..9eaf75349 100644 --- a/api/Makefile +++ b/api/Makefile @@ -13,6 +13,7 @@ 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}}\"}" | \ @@ -20,6 +21,7 @@ export-document-plan: 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}}}\"}" | \ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0a6acf32f..b8bb3b147 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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 diff --git a/docs/export.md b/docs/export.md index e5c30a8ee..b04bcd8ba 100644 --- a/docs/export.md +++ b/docs/export.md @@ -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: @@ -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. diff --git a/mkdocs.yml b/mkdocs.yml index 7a44d863c..a6e9e61b3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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 diff --git a/utils/Makefile b/utils/Makefile new file mode 100644 index 000000000..85aad28cd --- /dev/null +++ b/utils/Makefile @@ -0,0 +1,5 @@ +print-document-plan: + clojure -M:dp print-plan $(dp) + +export-all-document-plans: + clojure -M:dp export-plans $(dir)