Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CAT-815] Edit Docs #123

Merged
merged 9 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions docfx_project/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@
{
"src": "../",
"files": [
"IndicoV2*/**.csproj"
],
"exclude": [
"docfx_project/**",
"*Tests/**",
"IndicoV2.V1Adapters/**",
"IndicoV2.StrawberryShake/**"
"IndicoV2.Abstractions/**.csproj"
]
}
],
"dest": "apiV2",
"disableGitFeatures": false,
"outputFormat": "markdown"
"outputFormat": "markdown",
"filter": "filterConfig.yml"
}
]
}
11 changes: 11 additions & 0 deletions docfx_project/filterConfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiRules:
- exclude:
uidRegex: IndicoV2\.Workflows\.Models\.Workflow
- exclude:
uidRegex: IndicoV2\.Submissions\.Models\.SubmissionSs
- exclude:
uidRegex: IndicoV2\.Submissions\.Models\.FilterConverter
- exclude:
uidRegex: IndicoV2\.Ocr\.Models\.ExtractionJobResult
- exclude:
uidRegex: IndicoV2\.CommonModels\.Pagination\.HasCursor
16 changes: 0 additions & 16 deletions docs.Dockerfile

This file was deleted.

34 changes: 29 additions & 5 deletions harness-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pipeline:
repo: harbor.devops.indico.io/indico/indico-client-csharp
tags:
- <+codebase.commitSha>
dockerfile: docs.Dockerfile
dockerfile: readme_docs/docs.Dockerfile
platform:
os: Linux
arch: Amd64
Expand All @@ -45,7 +45,31 @@ pipeline:
image: harbor.devops.indico.io/indico/indico-client-csharp:<+codebase.commitSha>
command: |
cd /indico-client-csharp
./scripts/build_docs.sh
chmod +x ./readme_docs/build_docs.sh
./readme_docs/build_docs.sh
cp -r docfx_project/apiV2 $DOCS_PATH
git clone https://user:[email protected]/IndicoDataSolutions/indico-readme.git
cd indico-readme
git config --global user.email "[email protected]"
git config --global user.name "cat-automation"
git checkout -b docs-version-$TAG
mkdir -p markdown
cp -r $DOCS_PATH ./markdown/$LANGUAGE
bash add_frontmatter_yaml.sh
git add ./markdown/$LANGUAGE
git commit -m "a set of doc changes"
git push --set-upstream origin docs-version-$TAG
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/IndicoDataSolutions/indico-readme/pulls \
-d '{"title":"Amazing new feature","body":"Please pull these awesome changes in!","head":"docs-version-'"$TAG"'","base":"main"}'
shell: Bash
infrastructure:
type: KubernetesDirect
Expand All @@ -71,9 +95,9 @@ pipeline:
envVariables:
GITHUB_TOKEN: <+secrets.getValue("readmeghpat")>
TAG: <+codebase.commitSha>
LANGUAGE: chsarp
LANGUAGE: c-sharp
README_API_KEY: <+secrets.getValue("meghanhickeyreadmepat")>
DOCS_PATH: /harness/csharp
DOCS_PATH: /harness/c-sharp
timeout: 1m 30s
tags: {}
properties:
Expand All @@ -83,4 +107,4 @@ pipeline:
repoName: indico-client-csharp
build: <+input>
identifier: Generate_CSharp_Docs
name: Generate CSharp Docs
name: Generate CSharp Docs
13 changes: 13 additions & 0 deletions readme_docs/CommonModels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# <a id="IndicoV2_CommonModels"></a> Namespace IndicoV2.CommonModels

### Classes

[PageInfo](IndicoV2.CommonModels.Pagination.PageInfo.md)

Represents graphql pagination cursor.

### Interfaces

[IHasCursor<T\>](IndicoV2.CommonModels.Pagination.IHasCursor\-1.md)

[IPrediction](IndicoV2.CommonModels.Predictions.IPrediction.md)
13 changes: 13 additions & 0 deletions readme_docs/Extensions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# <a id="IndicoV2_Extensions"></a> Namespace IndicoV2.Extensions

### Namespaces

[IndicoV2.Extensions.SubmissionResult.Exceptions](IndicoV2.Extensions.SubmissionResult.Exceptions.md)

### Interfaces

[IDataSetAwaiter](IndicoV2.Extensions.DataSets.IDataSetAwaiter.md)

[IJobAwaiter](IndicoV2.Extensions.Jobs.IJobAwaiter.md)

[ISubmissionResultAwaiter](IndicoV2.Extensions.SubmissionResult.ISubmissionResultAwaiter.md)
24 changes: 24 additions & 0 deletions readme_docs/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

dotnet tool install docfx
dotnet tool run docfx docfx_project/docfx.json
cd docfx_project

for filename in apiV2/*.md; do
if [ "$(basename $filename)" != "IndicoV2.md" ]; then
newdir="$(dirname "$(echo $filename | sed -r 's|\.|\/|g; s|/([^/]*)$|.md|g')")"
# create the parent directory
mkdir -p $newdir
# move file into correct directory
newfilename="$(basename $filename | sed -r 's|(.+)\.md|\1|; s|\.|-|g')"
newlocation="${newdir}/${newfilename}.md"
mv $filename $newlocation
fi
done

mv ../readme_docs/CommonModels.md ./apiV2/IndicoV2/IndicoV2-CommonModels.md
mv ../readme_docs/Extensions.md ./apiV2/IndicoV2/IndicoV2-Extensions.md

# fix links
find ./apiV2 -type f -name '*.md' -print0 | xargs -0 sed -i -r 's|IHasCursor\\-1|IHasCursor-1|; s|(.+)\.md|\1|; s|\.|-|g'
cd ..
5 changes: 5 additions & 0 deletions readme_docs/docs.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine
COPY . /indico-client-csharp
WORKDIR /indico-client-csharp
RUN apk update && apk add jq vim bash
CMD ["sleep", "infinity"]
4 changes: 0 additions & 4 deletions scripts/build_docs.sh

This file was deleted.

File renamed without changes.
Loading