From b9a41b8cfa6258895b5d99051589d8d50ff52e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Fri, 6 Sep 2024 09:50:30 -0700 Subject: [PATCH 1/2] update example on front page to 1.0 --- src/pages/index.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index 8f3374a..4635399 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -19,18 +19,22 @@ import learnAnimation from "./learn.json"; import styles from './index.module.css'; -const example = `pub resource NFT { - pub fun greet(): String { - return "I'm NFT #" - .concat(self.uuid.toString()) - } +const example = `access(all) +resource NFT { + + access(all) + fun greet(): String { + return "I'm NFT #" + .concat(self.uuid.toString()) + } } -pub fun main(): String { - let nft <- create NFT() - let greeting = nft.greet() - destroy nft - return greeting +access(all) +fun main(): String { + let nft <- create NFT() + let greeting = nft.greet() + destroy nft + return greeting }` function cadence(Prism) { @@ -58,7 +62,7 @@ function HomepageHeader() {

{siteConfig.title}

{siteConfig.tagline}

- +
@@ -72,7 +76,7 @@ export default function Home() { title={`Hello from ${siteConfig.title}`} description="Description will go into a meta tag in ">
- +
From ebe3e90340fcb75b8a0fad0a32b6d1b074596d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Fri, 6 Sep 2024 09:53:33 -0700 Subject: [PATCH 2/2] update keywords --- src/pages/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/index.js b/src/pages/index.js index 4635399..dd0b6fe 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -44,7 +44,7 @@ function cadence(Prism) { greedy: true }, keyword: - /\b(?:pub|fun|resource|create|let|destroy|return|self)\b/, + /\b(?:access|all|fun|resource|create|let|destroy|return|self)\b/, 'class-name': /\b[A-Z][A-Za-z_\d]*\b/, function: /\b[a-z_]\w*(?=\s*\()/i, }