generated from airscripts/base
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5faf6c0
commit 8baf3c8
Showing
8 changed files
with
76 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,7 @@ | ||
--- | ||
outline: deep | ||
--- | ||
# Getting Started | ||
|
||
# Runtime API Examples | ||
## Overview | ||
Cacca, italian word that means `shit`, is a workflow framework that aims to provide a faster development experience with the usage of a few interchangeable keywords and the power of Python. | ||
|
||
This page demonstrates usage of some of the runtime APIs provided by VitePress. | ||
|
||
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files: | ||
|
||
```md | ||
<script setup> | ||
import { useData } from 'vitepress' | ||
|
||
const { theme, page, frontmatter } = useData() | ||
</script> | ||
|
||
## Results | ||
|
||
### Theme Data | ||
<pre>{{ theme }}</pre> | ||
|
||
### Page Data | ||
<pre>{{ page }}</pre> | ||
|
||
### Page Frontmatter | ||
<pre>{{ frontmatter }}</pre> | ||
``` | ||
|
||
<script setup> | ||
import { useData } from 'vitepress' | ||
|
||
const { site, theme, page, frontmatter } = useData() | ||
</script> | ||
|
||
## Results | ||
|
||
### Theme Data | ||
<pre>{{ theme }}</pre> | ||
|
||
### Page Data | ||
<pre>{{ page }}</pre> | ||
|
||
### Page Frontmatter | ||
<pre>{{ frontmatter }}</pre> | ||
|
||
## More | ||
|
||
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata). | ||
## Community | ||
If you have questions or need help, reach out to the community at [GitHub Discussions](https://github.com/airscripts/cacca/discussions). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Hello Toilet | ||
|
||
## Overview | ||
So you're telling me that you've survived the homepage, the getting started and also the installation? | ||
You have to be my deepest fan nonetheless. | ||
In this module we will write a simple Hello Toilet program with the use of Cacca. | ||
|
||
## Scripting | ||
For writing you Hello Toilet project in cacca, you'll need a few lines of code. | ||
Cacca shines the most when you need to create huge workflows that can change from time to time. | ||
|
||
Let's see the mock project that I've promised you: | ||
```python | ||
from cacca.lib import Cacca | ||
|
||
cacca = Cacca() | ||
|
||
cacca.insert({"action": print}) | ||
cacca.run(0, {"action": "Hello, Toilet!"}) | ||
``` | ||
|
||
Breaking this down, we import `Cacca` from its standard library and instantiate an object. | ||
Yes you can have multiple objects and make free use of your creativity, creating multiple workflows at once. | ||
```python | ||
from cacca.lib import Cacca | ||
cacca = Cacca() | ||
``` | ||
|
||
After this, we have to just insert an action inside the pipeline. | ||
`Actions` can be simple functions. For this project we're using print function directly from Python. | ||
There is the possibility to add also `guards` and `hooks` that will be run respectively at the start and at the end of an action. | ||
So if you're willing to make conditional workflows or enriched workflows, that's your best place to do that. | ||
They have the same functionalities of an action, though. | ||
```python | ||
cacca.insert({"action": print}) | ||
``` | ||
|
||
When you've defined your pipeline, you can simply run it and give it, where needed, the arguments that it needs. | ||
```python | ||
cacca.run(0, {"action": "Hello, Toilet!"}) | ||
``` | ||
|
||
And that is all. That is **Cacca**. | ||
|
||
## Community | ||
If you have questions or need help, reach out to the community at [GitHub Discussions](https://github.com/airscripts/cacca/discussions). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,20 @@ | ||
--- | ||
outline: deep | ||
--- | ||
# Installation | ||
|
||
# Runtime API Examples | ||
## Overview | ||
If you made this far, means that you love Cacca and I deeply appreciate that. | ||
Without making more lovely sentences, let's start up our process for installing this browny framework. | ||
|
||
This page demonstrates usage of some of the runtime APIs provided by VitePress. | ||
## Requirements | ||
In order to use Cacca, you will need the following: | ||
- Python >= 3.11; | ||
- A package manager for Python. | ||
|
||
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files: | ||
|
||
```md | ||
<script setup> | ||
import { useData } from 'vitepress' | ||
|
||
const { theme, page, frontmatter } = useData() | ||
</script> | ||
|
||
## Results | ||
|
||
### Theme Data | ||
<pre>{{ theme }}</pre> | ||
|
||
### Page Data | ||
<pre>{{ page }}</pre> | ||
|
||
### Page Frontmatter | ||
<pre>{{ frontmatter }}</pre> | ||
## Install | ||
Now that we have all the requirements at our hand, let's just install Cacca with this command: | ||
```bash | ||
$ pip install cacca | ||
``` | ||
...and that's all. Yes it was *that* simple. | ||
|
||
<script setup> | ||
import { useData } from 'vitepress' | ||
|
||
const { site, theme, page, frontmatter } = useData() | ||
</script> | ||
|
||
## Results | ||
|
||
### Theme Data | ||
<pre>{{ theme }}</pre> | ||
|
||
### Page Data | ||
<pre>{{ page }}</pre> | ||
|
||
### Page Frontmatter | ||
<pre>{{ frontmatter }}</pre> | ||
|
||
## More | ||
|
||
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata). | ||
## Community | ||
If you have questions or need help, reach out to the community at [GitHub Discussions](https://github.com/airscripts/cacca/discussions). |
This file was deleted.
Oops, something went wrong.