question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doc for @theme-original and @theme-init

See original GitHub issue

📚 Documentation

I think this D2 feature is currently not documented.

If we want to override an existing comp, yet reuse the original comp (like, if you want to wrap it), there’s a special import alias we can use.

It’s worth trying if the following work and document this feature

import OriginalDocItem from "@theme-original/DocItem";

export default function CustomDocItem(props) {
  return (
    <>
      <div>
         before doc
      </div>
      <OriginalDocItem {...props} />
      <div>
         after doc
      </div>
    </>
  );
}

That could be nice to find a tiny usecase for this feature on D2 website, for dogfooding and ensuring this behavior does not break over time.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yangshuncommented, Jul 11, 2020

@theme-original was added by me for the purposes you mentioned. @theme-init was added by @lex111 for reducing code duplication for the code blocks. They serve different purposes.

1reaction
Jonathannsegalcommented, Jul 24, 2020

This does seem like an straightforward clarification to add to the docs. Started a PR with proposed changed based on Alexey’s explanation. Let me know if this is something that is close to what is wanted or if this needs to be changed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client architecture | Docusaurus
A theme works by exporting a set of components, e.g. Navbar , Layout , Footer , to render the data passed down from...
Read more >
Base theme classy has not been installed [#3228896] - Drupal
I'm learning Drupal and reading a book "Handboek Drupal 8" by Maarten de Block. I followed his instructions on how to custumize a...
Read more >
Creating Your Own Theme - Varbase Docs - Vardot
Creating Your Own Theme. After building and installing the project with the Varbase Project template, use the create new Vartheme sub theme command....
Read more >
Change a theme and make it the default in Word or Excel
Document themes make it easy to coordinate colors, fonts, and graphic ... Tip: To return to the original theme colors, click Reset before...
Read more >
Light and Dark Themes · Codebase - GitHub Pages
Codebase has simple built-in light and dark CSS themes in ... Switch between the light and dark themes in these docs: ... function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found