Skip to content

Commit

Permalink
Merge pull request #213 from flotiq/feature/24104-check-excluded-snip…
Browse files Browse the repository at this point in the history
…pets

#24104 script for checking excluded snippets
  • Loading branch information
mniemcewicz authored Jan 3, 2024
2 parents c87057e + 2c3308f commit 5a5c75e
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/check-excluded-snippets.sh
Original file line number Diff line number Diff line change
@@ -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

15 changes: 15 additions & 0 deletions .github/workflows/snippet-check.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions docs/API/content-type/creating-co.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ to the supporting endpoint `https://api.flotiq.com/api/v1/content/{name}`
"postContent": "This will be the new <b>content</b>"
}
```
{ 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.

Expand Down
2 changes: 2 additions & 0 deletions docs/API/content-type/updating-co.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ to the supporting endpoint `https://api.flotiq.com/api/v1/content/{name}/{id}` t
"postContent": "This will be the new <b>content</b>"
}
```
{ data-search-exclude }


* `name` is the name of the content type definition
* `id` is the ID of the object to update
Expand Down
2 changes: 2 additions & 0 deletions docs/API/generate-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ Flotiq always provides your up-to-date API definition in an OpenAPI 3.0 compatib
``` shell
npm install @openapitools/[email protected] -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)

```
openapi-generator generate -g <name> -i <path_to_open_api_schema_json> --skip-validate-spec -o <output_path>
```
{ data-search-exclude }

Parameters description:

Expand Down
4 changes: 4 additions & 0 deletions docs/API/generate-package/sdk-nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<JAVASCRIPT_CLIENT_DIR>
```
{ data-search-exclude }

Finally, you need to build the module:

```
npm run build
```
{ data-search-exclude }
7 changes: 6 additions & 1 deletion docs/API/open-api-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
```
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
```
Expand Down Expand Up @@ -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
```
{
Expand Down
2 changes: 1 addition & 1 deletion docs/API/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Request:
```
GET https://api.flotiq.com/api/v1/search?q=Flotiq&content_type[]=post
```

{ data-search-exclude }

Response:
```json
Expand Down

0 comments on commit 5a5c75e

Please sign in to comment.