forked from polywrap/specification
-
Notifications
You must be signed in to change notification settings - Fork 0
Witx specification and markdown generation #1
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
Open
mpetrun5
wants to merge
7
commits into
main
Choose a base branch
from
mpetrun5/witx
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5fb9a3a
Add witx specification
3be8e60
Add pipeline for checking if markdown is outdated
325b8cc
Add README for generating markdown
33bc8a3
Rename spec to w3 module
a6aae9e
Use recursive witx md generation in pipeline
cb116f8
Update generate markdown action
f4c2953
Update README
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,27 @@ | ||
| name: Check Witx | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| Witx: | ||
| name: "Check Witx" | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Generate markdown | ||
| uses: NodeFactoryIo/witx-md-generator-action@master | ||
| with: | ||
| markdownPath: spec/witx/spec.md | ||
| witxPath: spec/witx/spec.witx | ||
|
|
||
| - name: Check if there are changes | ||
| id: changes | ||
| uses: UnicornGlobal/has-changes-action@v1.0.11 | ||
|
|
||
| - name: Process changes | ||
| if: steps.changes.outputs.changed == 1 | ||
| run: exit 1 | ||
This file contains hidden or 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,15 @@ | ||
| ## Generating Markdown | ||
|
|
||
| Generating Markdown is done via tool from WASI [repo](https://github.com/WebAssembly/WASI/tree/master/tools/witx): | ||
|
|
||
| ```bash | ||
| cargo run --example witx docs -o target.md target.witx | ||
| ``` | ||
|
|
||
| ### Docker | ||
|
|
||
| Also available is a docker image with prepackaged cli: | ||
|
|
||
| ```bash | ||
| docker run -v /path:/usr/src/witx nodefactory/witx docs -o target.md target.witx | ||
| ``` |
This file contains hidden or 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,123 @@ | ||
| # Types | ||
| # Modules | ||
| ## <a href="#w3" name="w3"></a> w3 | ||
| ### Imports | ||
| ### Functions | ||
|
|
||
| --- | ||
|
|
||
| #### <a href="#_w3_init" name="_w3_init"></a> `_w3_init()` | ||
| Init w3 | ||
|
|
||
| ##### Params | ||
| ##### Results | ||
|
|
||
| --- | ||
|
|
||
| #### <a href="#_w3_invoke" name="_w3_invoke"></a> `_w3_invoke(name_size: u64, args_size: u32)` | ||
| Invoke call | ||
|
|
||
| ##### Params | ||
| - <a href="#_w3_invoke.name_size" name="_w3_invoke.name_size"></a> `name_size`: `u64` | ||
|
|
||
| - <a href="#_w3_invoke.args_size" name="_w3_invoke.args_size"></a> `args_size`: `u32` | ||
|
|
||
| ##### Results | ||
|
|
||
| --- | ||
|
|
||
| #### <a href="#__w3_invoke_args" name="__w3_invoke_args"></a> `__w3_invoke_args(name_ptr: s32, args_ptr: s32)` | ||
| Get Invoke Arguments | ||
|
|
||
| ##### Params | ||
| - <a href="#__w3_invoke_args.name_ptr" name="__w3_invoke_args.name_ptr"></a> `name_ptr`: `s32` | ||
|
|
||
| - <a href="#__w3_invoke_args.args_ptr" name="__w3_invoke_args.args_ptr"></a> `args_ptr`: `s32` | ||
|
|
||
| ##### Results | ||
|
|
||
| --- | ||
|
|
||
| #### <a href="#__w3_invoke_result" name="__w3_invoke_result"></a> `__w3_invoke_result(ptr: s32, len: u64)` | ||
| Set Invoke Arguments | ||
|
|
||
| ##### Params | ||
| - <a href="#__w3_invoke_result.ptr" name="__w3_invoke_result.ptr"></a> `ptr`: `s32` | ||
|
|
||
| - <a href="#__w3_invoke_result.len" name="__w3_invoke_result.len"></a> `len`: `u64` | ||
|
|
||
| ##### Results | ||
|
|
||
| --- | ||
|
|
||
| #### <a href="#__w3_invoke_error" name="__w3_invoke_error"></a> `__w3_invoke_error(ptr: s32, len: u64)` | ||
| Set Invoke Error | ||
|
|
||
| ##### Params | ||
| - <a href="#__w3_invoke_error.ptr" name="__w3_invoke_error.ptr"></a> `ptr`: `s32` | ||
|
|
||
| - <a href="#__w3_invoke_error.len" name="__w3_invoke_error.len"></a> `len`: `u64` | ||
|
|
||
| ##### Results | ||
|
|
||
| --- | ||
|
|
||
| #### <a href="#__w3_query" name="__w3_query"></a> `__w3_query(uri_ptr: s32, uri_len: u64, query_ptr: s32, query_len: u64, args_ptr: s32, args_len: u64) -> s8` | ||
| Query API | ||
|
|
||
| ##### Params | ||
| - <a href="#__w3_query.uri_ptr" name="__w3_query.uri_ptr"></a> `uri_ptr`: `s32` | ||
|
|
||
| - <a href="#__w3_query.uri_len" name="__w3_query.uri_len"></a> `uri_len`: `u64` | ||
|
|
||
| - <a href="#__w3_query.query_ptr" name="__w3_query.query_ptr"></a> `query_ptr`: `s32` | ||
|
|
||
| - <a href="#__w3_query.query_len" name="__w3_query.query_len"></a> `query_len`: `u64` | ||
|
|
||
| - <a href="#__w3_query.args_ptr" name="__w3_query.args_ptr"></a> `args_ptr`: `s32` | ||
|
|
||
| - <a href="#__w3_query.args_len" name="__w3_query.args_len"></a> `args_len`: `u64` | ||
|
|
||
| ##### Results | ||
| - <a href="#__w3_query.res" name="__w3_query.res"></a> `res`: `s8` | ||
|
|
||
|
|
||
| --- | ||
|
|
||
| #### <a href="#__w3_query_result_len" name="__w3_query_result_len"></a> `__w3_query_result_len() -> u64` | ||
| Query Result | ||
|
|
||
| ##### Params | ||
| ##### Results | ||
| - <a href="#__w3_query_result_len.res" name="__w3_query_result_len.res"></a> `res`: `u64` | ||
|
|
||
|
|
||
| --- | ||
|
|
||
| #### <a href="#__w3_query_result" name="__w3_query_result"></a> `__w3_query_result(ptr: s32)` | ||
| Query Result | ||
|
|
||
| ##### Params | ||
| - <a href="#__w3_query_result.ptr" name="__w3_query_result.ptr"></a> `ptr`: `s32` | ||
|
|
||
| ##### Results | ||
|
|
||
| --- | ||
|
|
||
| #### <a href="#__w3_query_error_len" name="__w3_query_error_len"></a> `__w3_query_error_len() -> u64` | ||
| Query Error | ||
|
|
||
| ##### Params | ||
| ##### Results | ||
| - <a href="#__w3_query_error_len.res" name="__w3_query_error_len.res"></a> `res`: `u64` | ||
|
|
||
|
|
||
| --- | ||
|
|
||
| #### <a href="#__w3_query_error" name="__w3_query_error"></a> `__w3_query_error(ptr: s32)` | ||
| Query Error | ||
|
|
||
| ##### Params | ||
| - <a href="#__w3_query_error.ptr" name="__w3_query_error.ptr"></a> `ptr`: `s32` | ||
|
|
||
| ##### Results |
This file contains hidden or 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,57 @@ | ||
| (module $w3 | ||
| ;;; Init w3 | ||
| (@interface func (export "_w3_init")) | ||
|
|
||
| ;;; Invoke call | ||
| (@interface func (export "_w3_invoke") | ||
| (param $name_size u64) | ||
| (param $args_size u32) | ||
| ) | ||
|
|
||
| ;;; Get Invoke Arguments | ||
| (@interface func (export "__w3_invoke_args") | ||
| (param $name_ptr s32) | ||
| (param $args_ptr s32) | ||
| ) | ||
|
|
||
| ;;; Set Invoke Arguments | ||
| (@interface func (export "__w3_invoke_result") | ||
| (param $ptr s32) | ||
| (param $len u64) | ||
| ) | ||
|
|
||
| ;;; Set Invoke Error | ||
| (@interface func (export "__w3_invoke_error") | ||
| (param $ptr s32) | ||
| (param $len u64) | ||
| ) | ||
|
|
||
| ;;; Query API | ||
| (@interface func (export "__w3_query") | ||
| (param $uri_ptr s32) | ||
| (param $uri_len u64) | ||
| (param $query_ptr s32) | ||
| (param $query_len u64) | ||
| (param $args_ptr s32) | ||
| (param $args_len u64) | ||
| (result $res s8) | ||
| ) | ||
|
|
||
| ;;; Query Result | ||
| (@interface func (export "__w3_query_result_len") | ||
| (result $res u64) | ||
| ) | ||
| ;;; Query Result | ||
| (@interface func (export "__w3_query_result") | ||
| (param $ptr s32) | ||
| ) | ||
|
|
||
| ;;; Query Error | ||
| (@interface func (export "__w3_query_error_len") | ||
| (result $res u64) | ||
| ) | ||
| ;;; Query Error | ||
| (@interface func (export "__w3_query_error") | ||
| (param $ptr s32) | ||
| ) | ||
| ) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.