Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 4 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ on:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./DesignPatternPedia
working-directory: ./
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -30,18 +28,16 @@ jobs:
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: DesignPatternPedia/build
path: build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
pages: write
id-token: write

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ name: Test deployment

on:
pull_request:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./DesignPatternPedia
working-directory: ./
steps:
- uses: actions/checkout@v4
with:
Expand Down
File renamed without changes.
31 changes: 0 additions & 31 deletions DesignPatternPedia/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions DesignPatternPedia/docs/Creational/singleton.mdx

This file was deleted.

150 changes: 0 additions & 150 deletions DesignPatternPedia/docusaurus.config.ts

This file was deleted.

89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# DesignPatternPedia

- [DesignPatternPedia](#designpatternpedia)
- [Page Structure](#page-structure)
- [Coding Standards](#coding-standards)
- [Installation](#installation)
- [Local Development](#local-development)
- [Build and serve](#build-and-serve)
- [Contributing](#contributing)

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

## Page Structure

Each page follows a basic structure to ensure that a user can easily find metadata on a certain design pattern. These elements include;

1. The name of the design pattern.
1. Include extra used names or alternative names used just below the title itself.
2. The group the design pattern belongs to.
1. Creational, Structural or Behavioral
3. Description
1. A short paragraph explaining, in simple terms, what the pattern is about.
4. An up-to-date table of contents.
5. Problem statement
1. A small real-life example of why this can be a problem.
6. Potential solution
1. An analogy or metaphor to explain in human terms how the pattern works.
7. Examples
1. Real world examples of application of the pattern.
8. Pros and cons
1. Pros and cons of the pattern.
9. Your turn
10. How can the user see a potential implementation plan.
11. Code samples
12. Snippets in various programming languages.
13. Playground
1. A 'playground' to get a 'feel' for the pattern.

Some extras, common elements may include;

1. A diagram or image explaining the pattern.
2. Relations or uses in other design patterns.

## Coding Standards

1. All images are put into an `/img` directory and not embedded directly.
2. All images have `alt` texts explaining their purpose and contents.
3. All basic page elements that can be re-used should be turned into components.
4. Code is written in American English.
5. Page content is written in Queens English.
6. Page content is cited, sourced, and referenced where deemed necessary.
7. All docs/pages are `.mdx` files.
8. Code compiles and tests pass.
9. Directories follow the correct pattern structure.
10. Each page is built using the [page structure](#page-structure).

## Installation

To install the required packages and otherwise dependencies, run the following command;

```bash
npm i
```

### Local Development

```bash
npm run start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build and serve

Certain pieces of functionality such as switching locales & searching only works in a production environment. To achieve this you'll need to build and 'deploy' the site locally. To do this run the following commands.

```bash
npm run build
```

And then to serve the newly created build, simply run.

```bash
npm run serve
```

## Contributing

Would you like to propose changes to the pattern-wiki? Then feel free to create a pull request in this repository. Make sure that your PR follows the standards as set in the [coding standards](#coding-standards) and [page structure](#page-structure). These standards ensure that the wiki is of high quality and that both the users and developers can find the right information quickly.
File renamed without changes.
File renamed without changes.
Loading