diff --git a/.github/check-excluded-snippets.sh b/.github/check-excluded-snippets.sh new file mode 100755 index 00000000..47b2a2b8 --- /dev/null +++ b/.github/check-excluded-snippets.sh @@ -0,0 +1,23 @@ +#!/bin/bash +filelist=$(find ./docs -type f -name "*.md") +pattern='```' + + +for file in $filelist +do + + for line in $(grep -Fn $pattern $file | sed -e's/:.*//' | sed -n 'n;p') + do + if ! [[ $(awk "NR==$line+1" $file) == *"{ data-search-exclude }"* || $(awk "NR==$line+2" $file) == *"{ data-search-exclude }"* ]]; then + echo "Snippet in line $line in file $file is not excluded from search" >> status.txt + fi + done +done + +if [ -s "status.txt" ] || [ -f "status.txt" ] ;then + cat status.txt + exit 7 +else + echo "Every snippet has been excluded from search results" +fi + diff --git a/.github/workflows/snippet-check.yml b/.github/workflows/snippet-check.yml new file mode 100644 index 00000000..c97fc41a --- /dev/null +++ b/.github/workflows/snippet-check.yml @@ -0,0 +1,15 @@ +name: Snippet check script +# Controls when the action will run. Triggers the workflow on push +# events but only for the master branch +on: + pull_request + + +jobs: + build: + runs-on: ubuntu-latest # The type of runner that the job will run on + steps: # Steps represent a sequence of tasks that will be executed as part of the job + - name: Check out the repository + uses: actions/checkout@v2 + - name: Run the script + run: .github/check-excluded-snippets.sh diff --git a/docs/API/content-type/creating-co.md b/docs/API/content-type/creating-co.md index 29100895..a8f6eeb2 100644 --- a/docs/API/content-type/creating-co.md +++ b/docs/API/content-type/creating-co.md @@ -27,6 +27,8 @@ to the supporting endpoint `https://api.flotiq.com/api/v1/content/{name}` "postContent": "This will be the new content" } ``` +{ data-search-exclude } + !!! note The maximum size of a single CO in the system is 1MB. If your project requires a larger CO size, please contact Flotiq support. diff --git a/docs/API/content-type/updating-co.md b/docs/API/content-type/updating-co.md index 8713550b..3bfd7893 100644 --- a/docs/API/content-type/updating-co.md +++ b/docs/API/content-type/updating-co.md @@ -32,6 +32,8 @@ to the supporting endpoint `https://api.flotiq.com/api/v1/content/{name}/{id}` t "postContent": "This will be the new content" } ``` +{ data-search-exclude } + * `name` is the name of the content type definition * `id` is the ID of the object to update diff --git a/docs/API/generate-package.md b/docs/API/generate-package.md index fe3f884b..099d8a91 100644 --- a/docs/API/generate-package.md +++ b/docs/API/generate-package.md @@ -31,6 +31,7 @@ Flotiq always provides your up-to-date API definition in an OpenAPI 3.0 compatib ``` shell npm install @openapitools/openapi-generator-cli@cli-4.2.3 -g ``` +{ data-search-exclude } This will instal the OpenAPI generator that will allow you to generate more packages. List of supported generators is mentioned [here](https://openapi-generator.tech/docs/generators) @@ -38,6 +39,7 @@ This will instal the OpenAPI generator that will allow you to generate more pack ``` openapi-generator generate -g -i --skip-validate-spec -o ``` +{ data-search-exclude } Parameters description: diff --git a/docs/API/generate-package/sdk-nodejs.md b/docs/API/generate-package/sdk-nodejs.md index 3fbbb352..bbfee816 100644 --- a/docs/API/generate-package/sdk-nodejs.md +++ b/docs/API/generate-package/sdk-nodejs.md @@ -84,21 +84,25 @@ by changing into the directory containing package.json (and this README). Let's ```shell npm install ``` +{ data-search-exclude } Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR: ```shell npm link ``` +{ data-search-exclude } To use the link you just defined in your project, switch to the directory you want to use your flotiq_user_api from, and run: ```shell npm link /path/to/ ``` +{ data-search-exclude } Finally, you need to build the module: ``` npm run build ``` +{ data-search-exclude } \ No newline at end of file diff --git a/docs/API/open-api-schema.md b/docs/API/open-api-schema.md index 14440cb8..2478d6de 100644 --- a/docs/API/open-api-schema.md +++ b/docs/API/open-api-schema.md @@ -24,6 +24,7 @@ curl -X GET "https://api.flotiq.com/api/v1/open-api-schema.json" \ -H 'X-AUTH-TOKEN: YOUR_API_KEY' \ -H 'Content-Type: application/json' ``` +{ data-search-exclude } Possible request parameters: @@ -51,6 +52,7 @@ as not all tools can handle the whole Open API Schema format. -H 'X-AUTH-TOKEN: YOUR_API_KEY' \ -H 'Content-Type: application/json' ``` + { data-search-exclude } Response ``` @@ -3346,6 +3348,7 @@ as not all tools can handle the whole Open API Schema format. -H 'X-AUTH-TOKEN: YOUR_API_KEY' \ -H 'Content-Type: application/json' ``` + { data-search-exclude } Response @@ -4424,6 +4427,7 @@ as not all tools can handle the whole Open API Schema format. -H 'X-AUTH-TOKEN: YOUR_API_KEY' \ -H 'Content-Type: application/json' ``` + { data-search-exclude } Response ``` @@ -7287,7 +7291,8 @@ as not all tools can handle the whole Open API Schema format. -H 'X-AUTH-TOKEN: YOUR_API_KEY' \ -H 'Content-Type: application/json' ``` - + { data-search-exclude } + Response ``` { diff --git a/docs/API/search.md b/docs/API/search.md index 77bb4631..7f6dcd08 100644 --- a/docs/API/search.md +++ b/docs/API/search.md @@ -29,7 +29,7 @@ Request: ``` GET https://api.flotiq.com/api/v1/search?q=Flotiq&content_type[]=post ``` - +{ data-search-exclude } Response: ```json