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

Add Contracts for Cairo docs #324

Merged
merged 26 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ content:
branches: HEAD
start_path: docs

- url: https://github.com/OpenZeppelin/cairo-contracts
branches: HEAD
start_path: docs
ui:
bundle:
url: ./ui/theme
Expand Down
1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"handlebars": "^4.7.7",
"highlight.js": "^11.5.1",
"highlightjs-solidity": "^2.0.5",
"highlightjs-cairo": "^0.1.0",
"live-server": "^1.2.2",
"lodash.debounce": "^4.0.8",
"rimraf": "^3.0.2",
Expand Down
10 changes: 10 additions & 0 deletions ui/preview/model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ site:
version: '1.x'
displayVersion: '1.x'
latestVersion: *latest_version_contracts
contracts-cairo:
name: contracts-cairo
title: Contracts for Cairo
url: '#'
versions:
- &latest_version_abc
url: '#'
version: '0.2.x'
displayVersion: '0.2.x'
latestVersion: *latest_version_abc
cli:
name: cli
title: CLI
Expand Down
1 change: 1 addition & 0 deletions ui/src/js/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ hljs.registerLanguage('python', require('highlight.js/lib/languages/python'));
hljs.registerLanguage('shell', require('highlight.js/lib/languages/shell'));
hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'));
require('highlightjs-solidity')(hljs);
require('highlightjs-cairo')(hljs);
hljs.initHighlightingOnLoad();
12 changes: 12 additions & 0 deletions ui/theme/images/icons/contracts-cairo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 14 additions & 13 deletions ui/theme/partials/navigation.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
data-is-site-aspect="{{component.siteAspect}}" data-version="{{component.version.string}}" role="navigation">
<button class="close-menu-btn">
<svg style="width:24px;height:24px" viewBox="0 0 24 24">
<path fill="currentColor" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" />
<path fill="currentColor"
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" />
</svg>
</button>

{{#if (eq @root.page.component.name "ROOT")}}
<div class="nav-components">
<h3 class="nav-title">Start here</h3>
{{#each (pick site.components "ROOT, learn")}}
{{> navigation-component }}
{{> navigation-component }}
martriay marked this conversation as resolved.
Show resolved Hide resolved
{{/each}}

<h3 class="nav-title">Our Products</h3>
{{#each (pick site.components "defender, contracts")}}
{{> navigation-component }}
{{#each (pick site.components "defender, contracts, contracts-cairo")}}
{{> navigation-component }}
martriay marked this conversation as resolved.
Show resolved Hide resolved
{{/each}}

<h3 class="nav-title">More</h3>
{{#each (pick site.components "upgrades-plugins, subgraphs") }}
{{> navigation-component }}
{{> navigation-component }}
martriay marked this conversation as resolved.
Show resolved Hide resolved
{{/each}}
</div>

Expand All @@ -42,18 +43,18 @@
<ul>
<li>
{{#with latest}}
<a href="{{{url}}}">{{displayVersion}}</a>
<a href="{{{url}}}">{{displayVersion}}</a>
martriay marked this conversation as resolved.
Show resolved Hide resolved
{{/with}}
</li>
</ul>
<p>Other versions</p>
<ul>
{{#each versions}}
{{#unless (eq this ../latest)}}
<li>
<a href="{{{url}}}">{{displayVersion}}</a>
</li>
{{/unless}}
{{#unless (eq this ../latest)}}
<li>
<a href="{{{url}}}">{{displayVersion}}</a>
</li>
{{/unless}}
martriay marked this conversation as resolved.
Show resolved Hide resolved
{{/each}}
</ul>
</div>
Expand All @@ -64,12 +65,12 @@
</div>
{{#if (eq this @root.page.component)}}
<ol class="nav-list">
{{> navigation-tree items=@root.page.navigation}}
{{> navigation-tree items=@root.page.navigation}}
martriay marked this conversation as resolved.
Show resolved Hide resolved
</ol>
{{/if}}
</div>

{{/with}}
{{/if}}

</nav>
</nav>
martriay marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2948,11 +2948,23 @@ has@^1.0.3:
dependencies:
function-bind "^1.1.1"

highlight.js@^11.0.0:
version "11.6.0"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.6.0.tgz#a50e9da05763f1bb0c1322c8f4f755242cff3f5a"
integrity sha512-ig1eqDzJaB0pqEvlPVIpSSyMaO92bH1N2rJpLMN/nX396wTpDA4Eq0uK+7I/2XG17pFaaKE0kjV/XPeGt7Evjw==

highlight.js@^11.5.1:
version "11.5.1"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.5.1.tgz#027c24e4509e2f4dcd00b4a6dda542ce0a1f7aea"
integrity sha512-LKzHqnxr4CrD2YsNoIf/o5nJ09j4yi/GcH5BnYz9UnVpZdS4ucMgvP61TDty5xJcFGRjnH4DpujkS9bHT3hq0Q==

highlightjs-cairo@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/highlightjs-cairo/-/highlightjs-cairo-0.1.0.tgz#64c7a94d70513ed1bee72a1e7152f57baffb0a76"
integrity sha512-PYnLSgSokPIhaCShTAxdhlJdTLR/4ll2U2ikMimqOmi0NBH7J3Up2Nl1kJhqqCrXb4m4xrTlHTf61tEjf5juCQ==
dependencies:
highlight.js "^11.0.0"

highlightjs-solidity@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/highlightjs-solidity/-/highlightjs-solidity-2.0.5.tgz#48b945f41886fa49af9f06023e6e87fffc243745"
Expand Down