From c860ecedf4142e9aae989cbda9abad7aac65b034 Mon Sep 17 00:00:00 2001 From: fscelliott <42477011+fscelliott@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:41:05 -0600 Subject: [PATCH] links script --- .../scripts/api_files/generate_replace_links | 20 ++ .../api_files/internal_links_replacements.txt | 220 ------------------ 2 files changed, 20 insertions(+), 220 deletions(-) create mode 100644 assets/scripts/api_files/generate_replace_links delete mode 100644 assets/scripts/api_files/internal_links_replacements.txt diff --git a/assets/scripts/api_files/generate_replace_links b/assets/scripts/api_files/generate_replace_links new file mode 100644 index 0000000..1b1f3ac --- /dev/null +++ b/assets/scripts/api_files/generate_replace_links @@ -0,0 +1,20 @@ +import json + +# Load the JSON file +with open('../..mint.json', 'r') as file: + data = json.load(file) + +# Open the output text file in write mode +with open('config_internal_links_replacements.txt', 'w') as output_file: + # Iterate through each redirect in the array + for redirect in data.get('redirects', []): + source = redirect.get('source', '') + destination = redirect.get('destination', '') + + # Modify the source as specified + modified_source = source.replace('/', '(', 1).replace('/', ':') + ' ' + + # Write to the output file + output_file.write(f"{modified_source}\t{destination}\n") + +print("Redirects have been processed and written to redirects_output.txt") diff --git a/assets/scripts/api_files/internal_links_replacements.txt b/assets/scripts/api_files/internal_links_replacements.txt deleted file mode 100644 index 56d38f5..0000000 --- a/assets/scripts/api_files/internal_links_replacements.txt +++ /dev/null @@ -1,220 +0,0 @@ - - doc:accuracy-measures ->/senseml-reference/concepts/accuracy-measures" - doc:add-computed-fields ->/senseml-reference/advanced-computed-field-methods/add-computed-fields" - doc:advanced-computed-field-methods ->/senseml-reference/advanced-computed-field-methods/index-advanced-computed-field-methods" - doc:anchor ->/senseml-reference/field-query-object/anchor" - doc:anchor-nuances ->/senseml-reference/concepts/anchor-nuances" - doc:api-reference ->/api-guides/api-reference" - doc:api-tutorial ->/api-guides/api-tutorial/index-api-tutorial" - doc:api-tutorial-async-1 ->/api-guides/api-tutorial/api-tutorial-async-1" - doc:api-tutorial-async-2 ->/api-guides/api-tutorial/api-tutorial-async-2" - doc:api-tutorial-sync ->/api-guides/api-tutorial/api-tutorial-sync" - doc:api-tutorial-webhook ->/api-guides/api-tutorial/api-tutorial-webhook" - doc:app-guide ->/layout-based-extractions/app-guide/index-app-guide" - doc:author ->/welcome/author" - doc:batch-api ->/beta/batch-api" - doc:box ->/senseml-reference/methods/box" - doc:checkbox ->/senseml-reference/methods/checkbox" - doc:classify ->/document-type-classification/classify" - doc:color ->/layout-based-extractions/app-guide/color" - doc:column ->/senseml-reference/methods/column" - doc:computed-field-methods ->/senseml-reference/computed-field-methods/index-computed-field-methods" - doc:concatenate ->/senseml-reference/computed-field-methods/concatenate" - doc:concepts ->/senseml-reference/concepts/index-concepts" - doc:confidence ->/best-practices/confidence" - doc:config-settings ->/senseml-reference/config-settings/index-config-settings" - doc:constant ->/senseml-reference/computed-field-methods/constant" - doc:copy-from-sections ->/senseml-reference/advanced-computed-field-methods/copy-from-sections" - doc:copy-to-section ->/senseml-reference/advanced-computed-field-methods/copy-to-section" - doc:coverage ->/senseml-reference/concepts/coverage" - doc:custom-computation ->/senseml-reference/advanced-computed-field-methods/custom-computation" - doc:deskew ->/senseml-reference/preprocessors/deskew" - doc:document-generation-intro ->/beta/document-generation-intro" - doc:document-range ->/senseml-reference/methods/document-range" - doc:document-type-settings ->/senseml-reference/document-type-settings/index-document-type-settings" - doc:examples ->/api-guides/examples" - doc:excel-reference ->/integrations/quick-extraction/excel-reference" - doc:fallbacks ->/best-practices/tutorials/fallbacks" - doc:field-order ->/senseml-reference/concepts/field-order" - doc:field-query-object ->/senseml-reference/field-query-object/index-field-query-object" - doc:file-types ->/senseml-reference/concepts/file-types" - doc:fingerprint ->/senseml-reference/config-settings/fingerprint" - doc:fingerprint-mode ->/senseml-reference/document-type-settings/fingerprint-mode" - doc:fixed-table ->/senseml-reference/methods/fixed-table" - doc:get-file-metadata ->/senseml-reference/advanced-computed-field-methods/get-file-metadata" - doc:getting-started ->/layout-based-extractions/getting-started" - doc:getting-started-ai ->/welcome/getting-started-ai" - doc:go-live ->/best-practices/tutorials/go-live" - doc:handwriting ->/best-practices/tutorials/handwriting" - doc:instruct ->/llm-based-extractions/prompt-tips/index-instruct" - doc:integrate ->/welcome/integrate" - doc:intersection ->/senseml-reference/methods/intersection" - doc:label ->/senseml-reference/methods/label" - doc:library-quickstart ->/layout-based-extractions/library-quickstart" - doc:ligature ->/senseml-reference/preprocessors/ligature" - doc:ligatures ->/senseml-reference/concepts/ligatures" - doc:lines ->/senseml-reference/concepts/lines" - doc:list ->/senseml-reference/llm-based-methods/list" - doc:list-tips ->/llm-based-extractions/prompt-tips/list-tips" - doc:llm-based-methods ->/senseml-reference/llm-based-methods/index-llm-based-methods" - doc:mapper ->/senseml-reference/computed-field-methods/mapper" - doc:match ->/senseml-reference/field-query-object/match" - doc:match-arrays ->/senseml-reference/concepts/match-arrays" - doc:merge-lines ->/senseml-reference/preprocessors/merge-lines" - doc:method ->/senseml-reference/field-query-object/method" - doc:methods ->/senseml-reference/methods/index-methods" - doc:metrics ->/best-practices/metrics" - doc:nearest-checkbox ->/senseml-reference/methods/nearest-checkbox" - doc:nlp ->/senseml-reference/preprocessors/nlp" - doc:nlp-table ->/senseml-reference/llm-based-methods/nlp-table" - doc:ocr ->/senseml-reference/concepts/ocr" - doc:ocr-engine ->/senseml-reference/document-type-settings/ocr-engine" - doc:ocr-level ->/senseml-reference/document-type-settings/ocr-level" - doc:ocr-preprocessor ->/senseml-reference/preprocessors/ocr-preprocessor" - doc:page-range ->/senseml-reference/preprocessors/page-range" - doc:paragraph ->/senseml-reference/methods/paragraph" - doc:passthrough ->/senseml-reference/methods/passthrough" - doc:performance ->/best-practices/tutorials/performance" - doc:pick-values ->/senseml-reference/computed-field-methods/pick-values" - doc:portfolio ->/layout-based-extractions/portfolio" - doc:preprocessors ->/senseml-reference/preprocessors/index-preprocessors" - doc:prompt ->/llm-based-extractions/prompt" - doc:prompt-tips ->/llm-based-extractions/prompt-tips/index-prompt-tips" - doc:query-group ->/senseml-reference/llm-based-methods/query-group" - doc:query-group-tips ->/llm-based-extractions/prompt-tips/query-group-tips" - doc:quick-extraction ->/integrations/quick-extraction/index-quick-extraction" - doc:quickstart ->/integrations/quickstart" - doc:regex ->/senseml-reference/methods/regex" - doc:region ->/senseml-reference/methods/region" - doc:remove-footer ->/senseml-reference/preprocessors/remove-footer" - doc:remove-header ->/senseml-reference/preprocessors/remove-header" - doc:repeat-layouts ->/layout-based-extractions/repeat-layouts" - doc:rotate-page ->/senseml-reference/preprocessors/rotate-page" - doc:row ->/senseml-reference/methods/row" - doc:scale ->/senseml-reference/preprocessors/scale" - doc:sdk-guides ->/integrations/sdk-guides" - doc:section-nuances ->/senseml-reference/concepts/section-nuances" - doc:sections ->/senseml-reference/sections/index-sections" - doc:sections-example-copy-from-sections ->/senseml-reference/sections/sections-example-copy-from-sections" - doc:sections-example-copy-to-section ->/senseml-reference/sections/sections-example-copy-to-section" - doc:sections-example-external-range ->/senseml-reference/sections/sections-example-external-range" - doc:sections-example-labeled-rows ->/senseml-reference/sections/sections-example-labeled-rows" - doc:sections-example-loss-run ->/senseml-reference/sections/sections-example-loss-run" - doc:sections-example-nested-columns ->/senseml-reference/sections/sections-example-nested-columns" - doc:sections-example-nested-table ->/senseml-reference/sections/sections-example-nested-table" - doc:sections-example-table-grid ->/senseml-reference/sections/sections-example-table-grid" - doc:sections-example-zip ->/senseml-reference/sections/sections-example-zip" - doc:senseml ->/senseml-reference/concepts/senseml" - doc:senseml-reference-introduction ->/senseml-reference/senseml-reference-introduction" - doc:signature ->/senseml-reference/methods/signature" - doc:split ->/senseml-reference/computed-field-methods/split" - doc:split-lines ->/senseml-reference/preprocessors/split-lines" - doc:summarizer ->/senseml-reference/llm-based-methods/summarizer" - doc:suppress-output ->/senseml-reference/computed-field-methods/suppress-output" - doc:table-methods ->/senseml-reference/concepts/table-methods" - doc:table-tips ->/llm-based-extractions/prompt-tips/table-tips" - doc:test-before-integrating-configs ->/best-practices/tutorials/test-before-integrating-configs" - doc:text-table ->/senseml-reference/methods/text-table" - doc:troubleshoot ->/best-practices/tutorials/troubleshoot" - doc:troubleshoot-llms ->/best-practices/troubleshoot-llms" - doc:tutorials ->/best-practices/tutorials/index-tutorials" - doc:types ->/senseml-reference/field-query-object/types" - doc:ui ->/layout-based-extractions/app-guide/ui" - doc:validate-extractions ->/best-practices/validate-extractions" - doc:verbosity ->/senseml-reference/config-settings/verbosity" - doc:zapier ->/integrations/zapier/index-zapier" - doc:zapier-getting-started ->/integrations/zapier/zapier-getting-started" - doc:zapier-tutorial-2 ->/integrations/zapier/zapier-tutorial-2" - doc:zip ->/senseml-reference/computed-field-methods/zip" - reference:authentication ->/api-reference/authentication" - reference:choosing-an-endpoint ->/api-reference/choosing-an-endpoint" - reference:classify-document ->/api-reference/classification/document/classify-document" - reference:classify-document-sync ->/api-reference/classification/document/classify-document-sync" - reference:create-configuration ->/api-reference/configuration/configuration/create-configuration" - reference:create-document-type ->/api-reference/configuration/document-type/create-document-type" - reference:create-reference-document ->/api-reference/configuration/reference-document/create-reference-document" - reference:delete-configuration ->/api-reference/configuration/configuration/delete-configuration" - reference:delete-configuration-by-version ->/api-reference/configuration/configuration/delete-configuration-by-version" - reference:delete-document-type ->/api-reference/configuration/document-type/delete-document-type" - reference:delete-reference-document ->/api-reference/configuration/reference-document/delete-reference-document" - reference:delete-reference-document-association ->/api-reference/configuration/reference-document/delete-reference-document-association" - reference:extract-all-text-from-reference-document ->/api-reference/configuration/reference-document/extract-all-text-from-reference-document" - reference:extract-data-from-a-document ->/api-reference/extraction/document/extract-data-from-a-document" - reference:extract-data-from-a-document-with-config ->/api-reference/extraction/document/extract-data-from-a-document-with-config" - reference:extract-from-url ->/api-reference/extraction/document/extract-from-url" - reference:extract-from-url-portfolio ->/api-reference/extraction/portfolio/extract-from-url-portfolio" - reference:fill-doc ->/api-reference/docgen/fill-doc" - reference:generate-an-upload-url-with-config ->/api-reference/extraction/document/generate-an-upload-url-with-config" - reference:generate-upload-url ->/api-reference/extraction/document/generate-upload-url" - reference:generate-upload-url-portfolio ->/api-reference/extraction/portfolio/generate-upload-url-portfolio" - reference:get-configuration ->/api-reference/configuration/configuration/get-configuration" - reference:get-configuration-by-version ->/api-reference/configuration/configuration/get-configuration-by-version" - reference:get-configuration-versions ->/api-reference/configuration/configuration/get-configuration-versions" - reference:get-csv-extraction ->/api-reference/extraction/get-excel-from-documents/get-csv-extraction" - reference:get-document-type ->/api-reference/configuration/document-type/get-document-type" - reference:get-excel-extraction ->/api-reference/extraction/get-excel-from-documents/get-excel-extraction" - reference:get-reference-document ->/api-reference/configuration/reference-document/get-reference-document" - reference:list-configurations ->/api-reference/configuration/configuration/list-configurations" - reference:list-document-types ->/api-reference/configuration/document-type/list-document-types" - reference:list-extractions ->/api-reference/extraction/retrieve-extractions/list-extractions" - reference:list-reference-documents ->/api-reference/configuration/reference-document/list-reference-documents" - reference:provide-a-download-url-with-config ->/api-reference/extraction/document/provide-a-download-url-with-config" - reference:publish-configuration-by-version ->/api-reference/configuration/configuration/publish-configuration-by-version" - reference:retrieving-results ->/api-reference/extraction/retrieve-extractions/retrieving-results" - reference:statistics ->/api-reference/extraction/retrieve-extractions/statistics" - reference:update-configuration ->/api-reference/configuration/configuration/update-configuration" - reference:update-document-type ->/api-reference/configuration/document-type/update-document-type" - reference:update-reference-document ->/api-reference/configuration/reference-document/update-reference-document" - "destination": "/best-practices/tutorials/index-tutorials" - "destination": "/integrations/quick-extraction/index-quick-extraction" - "destination": "/integrations/sdk-guides" - "destination": "/layout-based-extractions/library-quickstart" - "destination": "/llm-based-extractions/prompt-tips/query-group-tips" - "destination": "/senseml-reference/deprecated-features/deprecated-bag-of-words" - "destination": "/senseml-reference/deprecated-features/deprecated-bag-of-words" - "destination": "/senseml-reference/deprecated-features/deprecated-invoice" - "destination": "/senseml-reference/deprecated-features/deprecated-invoice" - "destination": "/senseml-reference/deprecated-features/deprecated-key-value" - "destination": "/senseml-reference/deprecated-features/deprecated-key-value" - "destination": "/senseml-reference/deprecated-features/deprecated-page-filter" - "destination": "/senseml-reference/deprecated-features/deprecated-page-filter" - "destination": "/senseml-reference/deprecated-features/deprecated-query" - "destination": "/senseml-reference/deprecated-features/deprecated-table" - "destination": "/senseml-reference/deprecated-features/deprecated-tfidf" - "destination": "/senseml-reference/deprecated-features/deprecated-tfidf" - "destination": "/senseml-reference/deprecated-features/deprecated-topic" - "destination": "/senseml-reference/deprecated-features/deprecated-topic" - "destination": "/senseml-reference/llm-based-methods/index-llm-based-methods" - "destination": "/senseml-reference/llm-based-methods/nlp-table" - "destination": "/senseml-reference/llm-based-methods/query-group" - "destination": "/senseml-reference/methods/index-methods" - "destination": "/welcome/getting-started-ai" - "destination": "/welcome/getting-started-ai" - "destination": "/welcome/integrate" - doc:advanced-methods", - doc:bag-of-words", - doc:deprecated-bag-of-words", - doc:deprecated-invoice", - doc:deprecated-key-value", - doc:deprecated-page-filter", - doc:deprecated-query", - doc:deprecated-table", - doc:deprecated-tfidf", - doc:deprecated-topic", - doc:developer", - doc:excel", - doc:excel-quickstart", - doc:guides", - doc:invoice", - doc:key-value", - doc:natural-language-methods", - doc:no-code", - doc:overview", - doc:page-filter", - doc:query", - doc:query-tips", - doc:sdk-quickstarts", - doc:table", - doc:tfidf", - doc:topic", - } \ No newline at end of file