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

Update documentation #238

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Update documentation #238

wants to merge 8 commits into from

Conversation

g-krisztian
Copy link
Collaborator

Title:

Update documentation for release v0.5.0-rc3

Description

Updated markdown files, and build-docs.sh to support UML integration
Using forked codox for support markdown anchors - See in contribution.md

Tester info

Pls go through as an english teacher 😉

Completion Checklist

  • Add description of the changes made here to the changelog file
  • Update the documentation as necessary


## Coding standards

Please follow `clj-style` and `kondo` instructions. `Kibit` isn't a showstopper, but PRs are more welcomed if not
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...more welcome if they don't break kibit.'


## Submitting a PR

Before you are submitting a PR be sure:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Before you submit a PR be sure:"

- the PR has an issue in GitHub, with a good description
- you have added tests
- you provided an example project for a new feature
- All PRs need at least two approvals
Copy link
Contributor

@soulflyer soulflyer Oct 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really belong in a list of things to check. Maybe just move it to its own paragraph after the list.

## Generating API Docs

This is done with using [mermaid-cli](https://github.com/mermaid-js/mermaid-cli) and a forked version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either "with" or "using". Not both.

of [Codox](https://github.com/Flexiana/codox).

We're using mermaid-cli for render UML-diagrams in markdown files, see the `doc/conventions_template.md` for example.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...mermaid-cli to render..."


We're using mermaid-cli for render UML-diagrams in markdown files, see the `doc/conventions_template.md` for example.
These files need to be added to the `/script/build-docs.sh` . For using it you need to have `npx`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"To use it you need...."


The diagram bellow gives you an overview, how a request is processed in Xiana based applications.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"... an overview of how a request..."

@@ -64,5 +72,20 @@ the state on state creation, and defined on application startup.

## Interceptors

An interceptor is a pair of unary functions. Each function must recieve and return a state map. You can look at it as on an analogy to AOP's around aspect, or as on a pair of middlewares. They work mostly the same way as [pedestal](http://pedestal.io/reference/interceptors) and [sieppari](https://github.com/metosin/sieppari) interceptors.
Xiana provides a set of base [interceptors](interceptors.md), for the most common use cases.
An interceptor is a pair of unary functions. Each function must recieve and return a state map. You can look at it as on
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"look at it as an analogy...."

## Interceptors error handling:

The interceptor executor handles the exceptional states like sieppari does. If an exception happens, it tries to handle
first in the same interceptor. If it has and `:error` handler, it will call it, otherwise it'll search for `:error`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"If it has an..."


The interceptor executor handles the exceptional states like sieppari does. If an exception happens, it tries to handle
first in the same interceptor. If it has and `:error` handler, it will call it, otherwise it'll search for `:error`
handlers for the beginning of the interceptor queue. When and `:error` function found, and matched with the given
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should "for" be "from"?
"When an :error function..."

The interceptor executor handles the exceptional states like sieppari does. If an exception happens, it tries to handle
first in the same interceptor. If it has and `:error` handler, it will call it, otherwise it'll search for `:error`
handlers for the beginning of the interceptor queue. When and `:error` function found, and matched with the given
exception, the executor calls the queue `:leave` functions in reserved order, where the handler has been found.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe "...calls the queue of :leave functions in reverse order from where the handler was found.

handlers for the beginning of the interceptor queue. When and `:error` function found, and matched with the given
exception, the executor calls the queue `:leave` functions in reserved order, where the handler has been found.

This diagram shows how the error cases handled:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"..cases are handled:"

- request-data
- response

This structure is very volatile, will be updated quite often on the application's life cycle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...volatile, and will be updated..."


- Interceptors:

Add, consumes or remove information from the state map. More details in [Interceptors](#interceptors) section.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"consume"


The action conventionally is the control point of the application flow. This is the place were you can define how the
rest of your execution flow would behave. Here you can provide the database query, restriction function, the view, and
the additional side effect functions are you want to execute.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...functions that you want to..."


## Dependencies

Modules can depend on external resources, configurations, as well as on other modules. These dependencies are added to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...external resources and configurations..." (or maybe and/or)


## Interceptors

An interceptor is a pair of unary functions. Each function must recieve and return a state map. You can look at it as on
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...look at it as an analogy..."

The interceptor executor handles the exceptional states like sieppari does. If an exception happens, it tries to handle
first in the same interceptor. If it has and `:error` handler, it will call it, otherwise it'll search for `:error`
handlers for the beginning of the interceptor queue. When and `:error` function found, and matched with the given
exception, the executor calls the queue `:leave` functions in reserved order, where the handler has been found.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the non template version.

...
)
```

### 2. Set initial value of re-frame database

File *src/frontend/todo_app/db.cljs* contains initial value of re-frame databse. Inside of this file replace value of *default-db* to following:
File *src/frontend/todo_app/db.cljs* contains initial value of re-frame databse. Inside of this file replace value of *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...change the value of default-db to the following..."

@@ -0,0 +1,108 @@
<!DOCTYPE html PUBLIC ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need regenerating from the corrected .md file?

Copy link
Contributor

@soulflyer soulflyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants