Skip to content

Commit 7d93f20

Browse files
chore(docs): add initial documentation with mkdocs (#3)
* docs(docs): add initial documentation with mkdos we add the first construct library docs * chore(docs): update pull request lint workflow we added the docs type of commit * fix(docs): the type of semantic pull request name the syntaxis was wrong because it didn't add the break line * chore(docs): revert pr lint validation we have the default PR Title Lint validation
1 parent 8eba479 commit 7d93f20

File tree

12 files changed

+197
-1
lines changed

12 files changed

+197
-1
lines changed

.cz-config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ module.exports = {
2424
{ value: 'WIP', name: 'WIP: Work in progress' },
2525
],
2626

27-
scopes: [{ name: 'codestarconnection' }, { name: 'projen' }],
27+
scopes: [
28+
{ name: 'codestarconnection' },
29+
{ name: 'projen' },
30+
{ name: 'docs' },
31+
],
2832

2933
usePreparedCommit: true, // to re-use commit from ./.git/COMMIT_EDITMSG
3034
allowTicketNumber: false,

.gitattributes

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/deploy-docs.yml

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.17.1

.prettierignore

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/files.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/tasks.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { awscdk } from 'projen';
2+
import { JobPermission } from 'projen/lib/github/workflows-model';
23
import { TrailingComma } from 'projen/lib/javascript';
4+
35
const project = new awscdk.AwsCdkConstructLibrary({
46
author: 'Antonio Márquez Pérez',
57
authorAddress: '[email protected]',
@@ -24,6 +26,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
2426
verbose: true,
2527
},
2628
},
29+
github: true,
2730
deps: [] /* Runtime dependencies of this module. */,
2831
peerDeps: [] /* Peer dependencies of this module. */,
2932
description:
@@ -39,4 +42,59 @@ project.addScripts({
3942
commit: './node_modules/cz-customizable/standalone.js',
4043
});
4144

45+
project.addGitIgnore('site');
46+
47+
project.prettier?.addIgnorePattern('*.md');
48+
49+
project.addTask('docs:build', {
50+
exec: 'mkdocs build',
51+
});
52+
53+
project.addTask('docs:serve', {
54+
exec: 'mkdocs serve -a localhost:8099',
55+
});
56+
57+
const deployDocs = project.github?.addWorkflow('deploy-docs');
58+
deployDocs?.on({
59+
workflowDispatch: {},
60+
workflowRun: {
61+
workflows: ['release'],
62+
types: ['completed'],
63+
},
64+
});
65+
66+
deployDocs?.addJob('deploy-docs', {
67+
permissions: {
68+
contents: JobPermission.WRITE,
69+
},
70+
runsOn: ['ubuntu-latest'],
71+
steps: [
72+
{
73+
uses: 'actions/checkout@v4',
74+
},
75+
{
76+
uses: 'actions/setup-python@v4',
77+
with: {
78+
pythonVersion: '3.x',
79+
},
80+
},
81+
{
82+
run: 'echo "cache_id=$(date --utc "+%V")" >> $GITHUB_ENV',
83+
},
84+
{
85+
uses: 'actions/cache@v3',
86+
with: {
87+
key: 'mkdocs-material-${{ env.cache_id }}',
88+
path: '.cache',
89+
},
90+
},
91+
{
92+
run: 'pip install mkdocs-material',
93+
},
94+
{
95+
run: 'mkdocs gh-deploy --force',
96+
},
97+
],
98+
});
99+
42100
project.synth();

docs/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Homepage
2+
3+
This is a AWS CDK Construct Library to create a Code Star Connection.
4+
5+
## Install
6+
7+
You can install this library using the following command
8+
9+
```shell
10+
yarn add @jttc/aws-codestarconnection
11+
```
12+
13+
```shell
14+
npm install @jttc/aws-codestarconnection
15+
```
16+
17+
## Features
18+
19+
The Construct Library has the following L2 Construct:
20+
21+
| Construct | Description |
22+
|-------------------------|----------------------------------------------------------------|
23+
| [CodeStarConnection](#) | We create a Code Star Connection for every Provider available |

mkdocs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
site_name: AWS Code Star Connection Construct Library
2+
repo_url: https://github.com/JumpToTheCloud/aws-codestarconnection
3+
4+
nav:
5+
- Homepage:
6+
- index.md
7+
8+
theme:
9+
name: material
10+
font:
11+
text: Ubuntu
12+
palette:
13+
- scheme: default
14+
primary: custom
15+
toggle:
16+
icon: material/brightness-7
17+
name: Switch to dark mode
18+
- scheme: slate
19+
primary: custom
20+
toggle:
21+
icon: material/brightness-4
22+
name: Switch to light mode
23+
features:
24+
- header.autohide
25+
- navigation.sections
26+
- navigation.expand
27+
- navigation.top
28+
- navigation.instant
29+
- navigation.indexes
30+
- content.code.annotate
31+
- content.code.copy
32+
- toc.follow
33+
- toc.integrate
34+
- announce.dismiss
35+
- navigation.tabs
36+
37+
extra:
38+
version:
39+
provider: mike
40+
default: latest
41+
42+
plugins:
43+
- mike:
44+
version_selector: true
45+
46+
markdown_extensions:
47+
- admonition
48+
- pymdownx.details
49+
- pymdownx.superfences
50+
- pymdownx.highlight:
51+
anchor_linenums: true
52+
line_spans: __span
53+
pygments_lang_class: true
54+
- pymdownx.inlinehilite
55+
- pymdownx.snippets
56+
- attr_list
57+
- tables
58+
- pymdownx.emoji:
59+
emoji_index: !!python/name:material.extensions.emoji.twemoji
60+
emoji_generator: !!python/name:material.extensions.emoji.to_svg

package.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)