Replies: 1 comment
-
|
You can use React components to render code blocks, and provide dynamic strings to the code block # My Doc
import MyCustomCodeBlock from '@site/src/MyCustomCodeBlock';
<MyCustomCodeBlock/>Your custom React code block can be based on the default one and use keep in mind that Docusaurus is a static site generator. At the end of the day, code blocks are rendered as part of your build process, and at this time the username is not known. The username is a per-visitor concern, so it can't be rendered inside the static HTML files that Docusaurus outputs. In all cases you need React to enable some client-side logic here. You have 2 choices:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am making a step-by-step guide that contains linux commands for users to copy/paste to their terminal. Some commands contain usernames, ip address, etc that are specific to the user. Is there a way I can have the user input their specific information into a form and have the command box display the actual command they would have to copy/paste. For example an SSH login command. Instead of instructing them to replace their information @ -p they could actually copy paste their user-specific command, like joe@192.168.1.2 -p 2345
Beta Was this translation helpful? Give feedback.
All reactions