Skip to content

Commit

Permalink
Make page for the @public decorator (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
timothymcmackin authored Jan 13, 2025
1 parent 37e5a67 commit 9e41a84
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
1 change: 0 additions & 1 deletion gitlab-pages/docs/advanced/attributes-decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ Furthermore, the following attributes are used internally by the compiler, you m

* `@thunk`
* `@hidden`
* `@public`
* `@deprecated`

</Syntax>
Expand Down
20 changes: 20 additions & 0 deletions gitlab-pages/docs/reference/decorators/public.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
id: public
title: public
---

import Syntax from '@theme/Syntax';

<Syntax syntax="cameligo">

The attribute `[@public]` labels a declaration as available to be called by other pieces of code.
Because code is public by default in CameLIGO, this attribute is not needed in that syntax.

</Syntax>

<Syntax syntax="jsligo">

The decorator `@public` labels a declaration as available to be called by other pieces of code, similar to the `export` keyword.
This decorator is needed only when you want to make a namespace available to code in other files, as described in [Importing namespaces](../../preprocessor/import#importing-namespaces).

</Syntax>
2 changes: 1 addition & 1 deletion gitlab-pages/docs/syntax/decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ You may encounter them when exporting the Abstract Syntax Tree (AST) after a cer

* `[@thunk]`
* `[@hidden]`
* `[@public]`

## List of attributes

Expand Down Expand Up @@ -83,4 +82,5 @@ LIGO supports these decorators:
- [`inline`](../reference/decorators/inline)
- [`layout`](../reference/decorators/layout)
- [`private`](../reference/decorators/private)
- [`public`](../reference/decorators/public)
- [`view`](../reference/decorators/view)
1 change: 1 addition & 0 deletions gitlab-pages/website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ const sidebars = {
"reference/decorators/inline",
"reference/decorators/layout",
"reference/decorators/private",
"reference/decorators/public",
"reference/decorators/view"
],
},
Expand Down

0 comments on commit 9e41a84

Please sign in to comment.