Skip to content

Commit

Permalink
Bumping and freshening up the doc generation ready for better content (
Browse files Browse the repository at this point in the history
…#98)

* Bumping and freshening up the doc generation ready for better content
  • Loading branch information
ghandic authored Jan 30, 2024
1 parent 0598f0e commit 14fa65b
Show file tree
Hide file tree
Showing 37 changed files with 296 additions and 366 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/latest-changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Latest Changes

on:
pull_request_target:
branches:
- master
types:
- closed
workflow_dispatch:
inputs:
number:
description: PR number
required: true
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: 'false'

jobs:
latest-changes:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
with:
# To allow latest-changes to commit to the main branch
token: ${{ secrets.FASTAPI_LATEST_CHANGES }}
# Allow debugging with tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
- uses: docker://tiangolo/latest-changes:0.3.0
# - uses: tiangolo/latest-changes@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
latest_changes_file: docs/release-notes.md
latest_changes_header: '## Latest Changes'
end_regex: '^## '
debug_logs: true
label_header_prefix: '### '
4 changes: 2 additions & 2 deletions .github/workflows/mkdoc-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ services:
ports:
- "8000:8000"
volumes:
- .:/docs
- ./docs:/docs
- ./mkdocs.yml:/mkdocs.yml
entrypoint: mkdocs serve --dev-addr 0.0.0.0:8000
2 changes: 1 addition & 1 deletion docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM squidfunk/mkdocs-material
FROM python:3.11
ADD requirements.txt .
RUN pip install -r requirements.txt
1 change: 1 addition & 0 deletions docs/about/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
About JSF, its design, inspiration and more. 🤓
File renamed without changes.
File renamed without changes.
130 changes: 0 additions & 130 deletions docs/assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,136 +45,6 @@ td p {
fill: var(--md-primary-bg-color);
}

[data-md-color-scheme="capgemini"] {
--md-primary-fg-color: rgba(0, 112, 173);
--md-primary-fg-color--light: rgba(18, 171, 219);
--md-primary-fg-color--dark: rgba(43, 10, 61);

/* // Code color shades */
--md-code-fg-color: hsla(200, 18%, 26%, 1);
--md-code-bg-color: hsla(0, 0%, 96%, 1);

/* // Code highlighting color shades */
--md-code-hl-color: hsla(#{hex2hsl($clr-yellow-a200)}, 0.5);
--md-code-hl-number-color: hsla(0, 67%, 50%, 1);
--md-code-hl-special-color: hsla(340, 83%, 47%, 1);
--md-code-hl-function-color: hsla(291, 45%, 50%, 1);
--md-code-hl-constant-color: hsla(250, 63%, 60%, 1);
--md-code-hl-keyword-color: hsla(219, 54%, 51%, 1);
--md-code-hl-string-color: hsla(150, 63%, 30%, 1);
--md-code-hl-name-color: var(--md-code-fg-color);
--md-code-hl-operator-color: var(--md-default-fg-color--light);
--md-code-hl-punctuation-color: var(--md-default-fg-color--light);
--md-code-hl-comment-color: var(--md-default-fg-color--light);
--md-code-hl-generic-color: var(--md-default-fg-color--light);
--md-code-hl-variable-color: var(--md-default-fg-color--light);

/* // Typeset color shades */
--md-typeset-color: var(--md-default-fg-color);
--md-typeset-a-color: var(--md-primary-fg-color);

/* // Typeset `mark` color shades */
--md-typeset-mark-color: hsla(#{hex2hsl($clr-yellow-a200)}, 0.5);

/* // Typeset `del` and `ins` color shades */
--md-typeset-del-color: hsla(6, 90%, 60%, 0.15);
--md-typeset-ins-color: hsla(150, 90%, 44%, 0.15);

/* // Typeset `kbd` color shades */
--md-typeset-kbd-color: hsla(0, 0%, 98%, 1);
--md-typeset-kbd-accent-color: hsla(0, 100%, 100%, 1);
--md-typeset-kbd-border-color: hsla(0, 0%, 72%, 1);

/* // Admonition color shades */
--md-admonition-fg-color: var(--md-default-fg-color);
--md-admonition-bg-color: var(--md-default-bg-color);

/* // Footer color shades */
--md-footer-fg-color: hsla(0, 0%, 100%, 1);
--md-footer-fg-color--light: hsla(0, 0%, 100%, 0.7);
--md-footer-fg-color--lighter: hsla(0, 0%, 100%, 0.3);
--md-footer-bg-color: hsla(0, 0%, 0%, 0.87);
--md-footer-bg-color--dark: hsla(0, 0%, 0%, 0.32);
}

/* ////
/// Copyright (c) 2016-2020 Martin Donath <[email protected]>
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS
////
// ----------------------------------------------------------------------------
// Rules
// ----------------------------------------------------------------------------
// Slate theme, i.e. dark mode */
[data-md-color-scheme="slate"] {
/* // Slate's hue in the range [0,360] - change this variable to alter the tone
// of the theme, e.g. to make it more redish or greenish. This is a slate-
// specific variable, but the same approach may be adapted to custom themes. */
--md-hue: 232;
--md-primary-fg-color: rgba(0, 112, 173);
--md-primary-fg-color--light: rgba(18, 171, 219);
--md-primary-fg-color--dark: rgba(43, 10, 61);

/* // Default color shades */
--md-default-fg-color: hsla(var(--md-hue), 75%, 95%, 1);
--md-default-fg-color--light: hsla(var(--md-hue), 75%, 90%, 0.62);
--md-default-fg-color--lighter: hsla(var(--md-hue), 75%, 90%, 0.32);
--md-default-fg-color--lightest: hsla(var(--md-hue), 75%, 90%, 0.12);
--md-default-bg-color: hsla(var(--md-hue), 15%, 21%, 1);
--md-default-bg-color--light: hsla(var(--md-hue), 15%, 21%, 0.54);
--md-default-bg-color--lighter: hsla(var(--md-hue), 15%, 21%, 0.26);
--md-default-bg-color--lightest: hsla(var(--md-hue), 15%, 21%, 0.07);

/* // Code color shades */
--md-code-fg-color: hsla(var(--md-hue), 18%, 86%, 1);
--md-code-bg-color: hsla(var(--md-hue), 15%, 15%, 1);

/* // Code highlighting color shades */
--md-code-hl-color: hsla(#{hex2hsl($clr-blue-a200)}, 0.15);
--md-code-hl-number-color: hsla(6, 74%, 63%, 1);
--md-code-hl-special-color: hsla(340, 83%, 66%, 1);
--md-code-hl-function-color: hsla(291, 57%, 65%, 1);
--md-code-hl-constant-color: hsla(250, 62%, 70%, 1);
--md-code-hl-keyword-color: hsla(219, 66%, 64%, 1);
--md-code-hl-string-color: hsla(150, 58%, 44%, 1);

/* // Typeset color shades */
--md-typeset-a-color: var(--md-primary-fg-color--light);

/* // Typeset `mark` color shades */
--md-typeset-mark-color: hsla(#{hex2hsl($clr-blue-a200)}, 0.3);

/* // Typeset `kbd` color shades */
--md-typeset-kbd-color: hsla(var(--md-hue), 15%, 94%, 0.12);
--md-typeset-kbd-accent-color: hsla(var(--md-hue), 15%, 94%, 0.2);
--md-typeset-kbd-border-color: hsla(var(--md-hue), 15%, 14%, 1);

/* // Admonition color shades */
--md-admonition-bg-color: hsla(var(--md-hue), 0%, 100%, 0.025);

/* // Footer color shades */
--md-footer-bg-color: hsla(var(--md-hue), 15%, 12%, 0.87);
--md-footer-bg-color--dark: hsla(var(--md-hue), 15%, 10%, 1);
}

.md-header-nav__button.md-logo img,
.md-header-nav__button.md-logo svg {
width: unset;
Expand Down
32 changes: 0 additions & 32 deletions docs/assets/js/theme.js

This file was deleted.

25 changes: 24 additions & 1 deletion docs/features.md
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
## Coming soon ...
---
hide:
- navigation
---

# jsf Features

**jsf** gives you the following:

## Based on open standards

- Provides out of the box data generation from any [JSON schema](https://json-schema.org/) 📦
- In memory conversion from [JSON Schema](https://json-schema.org/) to [Pydantic](https://docs.pydantic.dev/latest/) Models with generated examples 🤯
- Inbuilt validation of fake JSON produced against the [JSON schema](https://json-schema.org/)

## Ability to extend the standard to maximize realness of the fake data

- Extendable custom data providers using any lambda functions 🔗
- Multi level state for dependant data (eg multiple objects sharing value, such as children with same surname) 🤓

## Plug and play

- Seamless integration with [FastAPI](https://fastapi.tiangolo.com/), check out the [demo code](https://github.com/ghandic/jsf/tree/main/examples/fastapi) 🚀
- Standardize on JSON schema and output to any file format, check out the [demo code](https://github.com/ghandic/jsf/tree/main/examples/flatfile) 📦
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/help/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Help and get help, contribute, get involved. 🤝
34 changes: 27 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
---
hide:
- navigation
---

# Getting Started

## Installation

<!-- termynal -->
```bash
pip install jsf
$ pip install jsf
---> 100%
Installed
```

## Usage

### As a program

* pip install jsf
* In your code where you need to you will be using jsf you can refer to below script as reference:
### From your Python program

```python
from jsf import JSF
Expand All @@ -18,16 +25,29 @@ faker = JSF.from_json("demo-schema.json")
fake_json = faker.generate()
```

### From the commandline
### From the command line

#### Raw install
#### System installation

First, you'll need to install `jsf[cli]` as it has the additional dependencies for the command line tools.

<!-- termynal -->
```bash
$ pip install jsf[cli]
---> 100%
Installed
```

Now the cli is installed, all you will need to do is supply the JSON schema and the file path you wish to save the output to.

```bash
jsf --schema jsf/tests/data/custom.json --instance wow.json
```

#### Docker

For convenience, you can also make use of the Docker image that is provided so there is no need to rely on package management.

```bash
docker build . -t challisa/jsf
docker run -v $PWD:/data challisa/jsf jsf --schema /data/jsf/tests/data/custom.json --instance /data/wow.json
Expand Down
57 changes: 0 additions & 57 deletions docs/overrides/partials/header.html

This file was deleted.

Loading

0 comments on commit 14fa65b

Please sign in to comment.