From 8623b526e7b6d0c4f141bb9d1fbc5ed4dd92b3d0 Mon Sep 17 00:00:00 2001 From: soyboy Date: Tue, 19 Mar 2024 16:00:53 -0700 Subject: [PATCH 1/5] content reuse example --- content/OpProposerDescriptionShort.md | 1 + notes/content-reuse.md | 29 +++++++++++++++++++ .../builders/chain-operators/architecture.mdx | 6 ++-- tsconfig.json | 1 + 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 content/OpProposerDescriptionShort.md create mode 100644 notes/content-reuse.md diff --git a/content/OpProposerDescriptionShort.md b/content/OpProposerDescriptionShort.md new file mode 100644 index 000000000..08f3f9282 --- /dev/null +++ b/content/OpProposerDescriptionShort.md @@ -0,0 +1 @@ +`op-proposer` is the service that submits the output roots to the L1. This is to enable trustless execution of L2-to-L1 messaging and creates the view into the L2 state from the L1's perspective. \ No newline at end of file diff --git a/notes/content-reuse.md b/notes/content-reuse.md new file mode 100644 index 000000000..414976827 --- /dev/null +++ b/notes/content-reuse.md @@ -0,0 +1,29 @@ +# Content Reuse + +Content reuse is when you reuse the same piece of content in various different places. It means that technical writers don't have to re-write text many times, and it means that the original piece of copy should be easy to locate so that it can be used as often as needed. When changes are made to that original piece of text, it will then be automatically changed wherever else that piece of text is used, which saves a lot of time. + +## content directory + +The content directory contains markdown files that can be imported across the nextra website. + +## how to write reusable content + +Create a `.md` file in the `/content` directory. + +## how to use resuable content + +1. Import it at the top of `.mdx` file: + +``` +import DescriptionShort from '@/content/DescriptionShort.md' +``` + +1. Use it within the file + +``` +Text before + + + +Text after +``` \ No newline at end of file diff --git a/pages/builders/chain-operators/architecture.mdx b/pages/builders/chain-operators/architecture.mdx index 224593477..e3b099c26 100644 --- a/pages/builders/chain-operators/architecture.mdx +++ b/pages/builders/chain-operators/architecture.mdx @@ -6,6 +6,8 @@ description: Learn about the OP chain architecture. import Image from 'next/image' +import OpProposerDescriptionShort from '@/content/OpProposerDescriptionShort.md' + # Chain Architecture This page contains information about the components of the rollup protocol and @@ -45,9 +47,7 @@ amount of data required to reproduce L2 blocks. ### op-proposer -`op-proposer` is the service that submits the output roots to the L1. This is to enable -trustless execution of L2-to-L1 messaging and creates the view into the L2 state from -the L1's perspective. + ## Ingress Traffic diff --git a/tsconfig.json b/tsconfig.json index 78956bce9..9d18cd927 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,6 +17,7 @@ "baseUrl": "./", "paths": { "@/components/*": ["components/*"], + "@/content/*": ["content/*"], "@/utils/*": ["utils/*"], "@/pages/*": ["pages/*"], } From 2519afcdb941c7ce26657c1bdf105da0651b5459 Mon Sep 17 00:00:00 2001 From: cpengilly <29023967+cpengilly@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:40:03 -0700 Subject: [PATCH 2/5] Update notes/content-reuse.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- notes/content-reuse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/content-reuse.md b/notes/content-reuse.md index 414976827..57edcfd7d 100644 --- a/notes/content-reuse.md +++ b/notes/content-reuse.md @@ -10,7 +10,7 @@ The content directory contains markdown files that can be imported across the ne Create a `.md` file in the `/content` directory. -## how to use resuable content +## how to use reusable content 1. Import it at the top of `.mdx` file: From 8103423af0d4de7bc9b69047179339a803028fb1 Mon Sep 17 00:00:00 2001 From: soyboy <85043086+sbvegan@users.noreply.github.com> Date: Wed, 20 Mar 2024 06:13:16 -0700 Subject: [PATCH 3/5] Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- notes/content-reuse.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/notes/content-reuse.md b/notes/content-reuse.md index 57edcfd7d..680e680e2 100644 --- a/notes/content-reuse.md +++ b/notes/content-reuse.md @@ -1,16 +1,16 @@ # Content Reuse -Content reuse is when you reuse the same piece of content in various different places. It means that technical writers don't have to re-write text many times, and it means that the original piece of copy should be easy to locate so that it can be used as often as needed. When changes are made to that original piece of text, it will then be automatically changed wherever else that piece of text is used, which saves a lot of time. +Content reuse is when you reuse the same piece of content in various places. It means that technical writers don't have to re-write text many times, and it means that the original piece of copy should be easy to locate so that it can be used as often as needed. When changes are made to that original piece of text, it will then be automatically changed wherever else that piece of text is used, which saves a lot of time. -## content directory +## Content Directory The content directory contains markdown files that can be imported across the nextra website. -## how to write reusable content +## How to Write Reusable Content Create a `.md` file in the `/content` directory. -## how to use reusable content +## How to Use Reusable Content 1. Import it at the top of `.mdx` file: From 60cce75f164c5396ef6e1ff95528e26c832e0e17 Mon Sep 17 00:00:00 2001 From: soyboy Date: Thu, 27 Jun 2024 10:45:42 -0700 Subject: [PATCH 4/5] content reuse --- content/index.js | 1 + notes/content-reuse.md | 20 +++++++++++++++++-- .../builders/chain-operators/architecture.mdx | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 content/index.js diff --git a/content/index.js b/content/index.js new file mode 100644 index 000000000..d709dbce7 --- /dev/null +++ b/content/index.js @@ -0,0 +1 @@ +export { default as OpProposerDescriptionShort } from './OpProposerDescriptionShort.md' diff --git a/notes/content-reuse.md b/notes/content-reuse.md index 680e680e2..b96fb81de 100644 --- a/notes/content-reuse.md +++ b/notes/content-reuse.md @@ -10,7 +10,7 @@ The content directory contains markdown files that can be imported across the ne Create a `.md` file in the `/content` directory. -## How to Use Reusable Content +### How to Use a Single Reusable Content Components 1. Import it at the top of `.mdx` file: @@ -26,4 +26,20 @@ Text before Text after -``` \ No newline at end of file +``` + +### How to Use a Multiple Reusable Content Components + +1. You can create a `index.js` file in the the `content` directories and export +the components like this: + +``` +export { default as ComponentA } from './ComponentA.md' +export { default as ComponentB } from './ComponentB.md' +``` + +1. Import it at the top of `.mdx` file: + +``` +import {ComponentA, ComponentB} from '@/content/index.js' +``` diff --git a/pages/builders/chain-operators/architecture.mdx b/pages/builders/chain-operators/architecture.mdx index e3b099c26..306cbb170 100644 --- a/pages/builders/chain-operators/architecture.mdx +++ b/pages/builders/chain-operators/architecture.mdx @@ -6,7 +6,7 @@ description: Learn about the OP chain architecture. import Image from 'next/image' -import OpProposerDescriptionShort from '@/content/OpProposerDescriptionShort.md' +import {OpProposerDescriptionShort} from '@/content/index.js' # Chain Architecture From 01d37cac0d21335879f5637a3b5f99559517b5df Mon Sep 17 00:00:00 2001 From: cpengilly <29023967+cpengilly@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:56:32 -0700 Subject: [PATCH 5/5] Update notes/content-reuse.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- notes/content-reuse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/content-reuse.md b/notes/content-reuse.md index b96fb81de..82b6cd9a4 100644 --- a/notes/content-reuse.md +++ b/notes/content-reuse.md @@ -30,7 +30,7 @@ Text after ### How to Use a Multiple Reusable Content Components -1. You can create a `index.js` file in the the `content` directories and export +1. You can create a `index.js` file in the `content` directories and export the components like this: ```