Skip to content

Commit 6fe9a52

Browse files
jimschubertwing328
authored andcommitted
[feat][docs][website] Initial docusaurus based site (OpenAPITools#1770)
* Iniital docusaurus based site * Remove error about default local being used by String.format * Change pinned users to represent global presence rather than alphabetical order pinning * Include generator indexes in ensure-up-to-date (docusaurus site and /generators/README) * Add Font Awesome attribution footer * Remove feature callout until it is completed * Include NPM try it out section * Improve "Getting Started" type docs * Include new custom template documentation * Updating templating and customization docs * Add vendor extension docs * Cleanup templating page(s). * Move users to yaml file for easy edit. * travis configuration, and baseUrl mods to image URLs * [docs] Migrate FAQ, release summary from wiki FAQ has been split into multiple smaller documents to better categorize and allow users to find what they're looking for (in docs folder or in new website). Release summary information (versioning strategy and cadence) has been migrated from the Wiki and clarified a bit. Also adds copy button for all code snippets in website. * Copy current contributing/code of conduct to website * [docs] Creating a new generator
1 parent 9cba9b6 commit 6fe9a52

File tree

197 files changed

+13543
-5334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+13543
-5334
lines changed

.travis.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ language: java
33
jdk:
44
- openjdk8
55

6-
76
cache:
87
directories:
98
- $HOME/.m2
@@ -34,6 +33,7 @@ cache:
3433
- $HOME/samples/server/petstore/cpp-pistache/pistache
3534
- $HOME/.npm
3635
- $HOME/.rvm/gems/ruby-2.4.1
36+
- $HOME/website/node_modules/
3737

3838
services:
3939
- docker
@@ -102,6 +102,7 @@ before_install:
102102
gpg --keyserver keyserver.ubuntu.com --recv-key $SIGNING_KEY ;
103103
gpg --check-trustdb ;
104104
fi;
105+
- pushd .; cd website; npm install; popd
105106

106107
install:
107108
# Add Godeps dependencies to GOPATH and PATH
@@ -152,6 +153,15 @@ after_success:
152153
- if [ $DOCKER_HUB_USERNAME ]; then echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin && docker build -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/openapi-generator-online && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME && echo "Pushed to $DOCKER_GENERATOR_IMAGE_NAME"; fi; fi
153154
## docker: build cli image and push to Docker Hub
154155
- if [ $DOCKER_HUB_USERNAME ]; then echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin && cp docker-entrypoint.sh ./modules/openapi-generator-cli && docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME && echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME"; fi; fi
156+
## publish latest website, variables below are secure environment variables which are unavailable to PRs from forks.
157+
- if [ "$TRAVIS_BRANCH" = "master" ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
158+
cd website;
159+
git config --global user.name "${GH_NAME}";
160+
git config --global user.email "${GH_EMAIL}";
161+
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc;
162+
npm install;
163+
GIT_USER="${GH_NAME}" npm run-script publish-gh-pages;
164+
fi;
155165

156166
env:
157167
- DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test CC=gcc-5 CXX=g++-5

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ For old releases, please refer to the [**Release**](https://github.com/OpenAPITo
8888

8989
## [1.2 - Artifacts on Maven Central](#table-of-contents)
9090

91-
You can find our released artefacts on maven central:
91+
You can find our released artifacts on maven central:
9292

9393
**Core:**
9494
```xml

bin/utils/copy-to-website.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
echo "# START SCRIPT: $SCRIPT"
5+
6+
conduct_in=CODE_OF_CONDUCT.md
7+
contrib_in=CONTRIBUTING.md
8+
conduct_out=docs/conduct.md
9+
contrib_out=docs/contributing.md
10+
11+
12+
\rm -rf "${conduct_out}"
13+
\rm -rf "${contrib_out}"
14+
15+
cat > "${conduct_out}" << EOF
16+
---
17+
id: code-of-conduct
18+
title: Code of Conduct
19+
---
20+
21+
$(tail -n +3 "${conduct_in}")
22+
EOF
23+
echo "Wrote $(pwd)/${conduct_out}"
24+
25+
cat > "${contrib_out}" << EOF
26+
---
27+
id: contributing
28+
title: Guidelines For Contributing
29+
sidebar_label: Guidelines
30+
---
31+
32+
$(tail -n +3 "${contrib_in}")
33+
EOF
34+
echo "Wrote $(pwd)/${contrib_out}"

bin/utils/ensure-up-to-date

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ declare -a scripts=("./bin/openapi3/ruby-client-petstore.sh"
3737
"./bin/csharp-petstore.sh"
3838
"./bin/meta-codegen.sh"
3939
"./bin/utils/export_docs_generators.sh"
40+
"./bin/utils/export_generators_docusaurus_index.sh"
41+
"./bin/utils/copy-to-website.sh"
42+
"./bin/utils/export_generators_readme.sh"
4043
"./bin/go-petstore.sh"
4144
"./bin/go-gin-petstore-server.sh")
4245

bin/utils/export_generator.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ fi
1414

1515
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
1616

17-
java -jar ${executable} config-help -g ${NAME} --named-header -o docs/generators/${NAME}.md
18-
19-
echo "Back to the [generators list](README.md)" >> docs/generators/${NAME}.md
17+
java -jar ${executable} config-help -g ${NAME} --named-header --format markdown --markdown-header -o docs/generators/${NAME}.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
SCRIPT="$0"
4+
echo "# START SCRIPT: $SCRIPT"
5+
6+
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
7+
8+
\rm -rf docs/generators.md
9+
10+
cat > docs/generators.md << EOF
11+
---
12+
id: generators
13+
title: Generators List
14+
---
15+
16+
EOF
17+
18+
java -jar $executable list --docsite >> docs/generators.md
19+
20+
echo "Wrote $(pwd)/docs/generators.md"

bin/utils/export_generators_readme.sh

+13-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,16 @@ echo "# START SCRIPT: $SCRIPT"
55

66
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
77

8-
java -jar $executable list | sed -e 's/\([A-Z]*\) generators:/* \1 generators:/g' -e 's/- \([a-z0-9\-]*\)/- [\1]\(\1.md\)/g' > docs/generators/README.md
8+
\rm -rf docs/generators.md
9+
10+
cat > docs/generators.md << EOF
11+
---
12+
id: generators
13+
title: Generators List
14+
---
15+
16+
EOF
17+
18+
java -jar $executable list | sed -e 's/\([A-Z]*\) generators:/* \1 generators:/g' -e 's/- \([a-z0-9\-]*\)/- [\1]\(generators\/\1.md\)/g' >> docs/generators.md
19+
20+
echo "Wrote $(pwd)/docs/generators.md"

docker-compose.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3"
2+
3+
services:
4+
docusaurus:
5+
build: .
6+
ports:
7+
- 3000:3000
8+
- 35729:35729
9+
volumes:
10+
- ./docs:/app/docs
11+
- ./website/blog:/app/website/blog
12+
- ./website/core:/app/website/core
13+
- ./website/i18n:/app/website/i18n
14+
- ./website/pages:/app/website/pages
15+
- ./website/static:/app/website/static
16+
- ./website/sidebars.json:/app/website/sidebars.json
17+
- ./website/siteConfig.js:/app/website/siteConfig.js
18+
working_dir: /app/website

0 commit comments

Comments
 (0)