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.

[v2] Alternative way for handling code tabs or add docs preprocessing hook

See original GitHub issue

💥 Proposal

It would be nice to have an alternative way of defining code-tabs that doesn’t rely on MDX Tabs/TabItem. This is specially interesting for teams that don’t have MDX knowledge or that don’t want to use it (for portability, readability…).

E.g. if one or more code blocks are next to each other convert them into code-tabs:

    ```kotlin
    // Some code
    ```

    ```typescript
    // Some code
    ```

👆 In this case there should be a way also to map code-block language hint to tab name. e.g. typescript => TypeScript.

Alternatively, there could be a way to hook to the markdown loading step so that the developers could modify the markdown content programatically. e.g. search via regex and add the required Tabs/Tabitem code.

[load markdown] => [hook modifies markdown content] => [render]

Have you read the Contributing Guidelines on issues?

Yes.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
amimascommented, Mar 18, 2020

Agree with @yangshun that it can be difficult to tell if code blocks should be grouped or tabbed. Someone else might want them as individual code blocks without tabs.

This feels like getting into the territory of markdown parser and that’s not what Docusaurus is for/does.

1reaction
yangshuncommented, Mar 4, 2020

E.g. if one or more code blocks are next to each other convert them into code-tabs

Hard to tell if code blocks should be grouped together. One possible way is to add in metadata into the first line to define the group.

But overall I’m not very keen on adding more syntax if MDX can do the job. If you’re going to have a new syntax, MDX can be that syntax. MDX is easy to use and is very expressive.

Read more comments on GitHub >

github_iconTop Results From Across the Web

badeball/cypress-cucumber-preprocessor - GitHub
The preprocessor (with its dependencies) parses Gherkin documents and allows you to write tests as shown below. # cypress/e2e/duckduckgo.feature Feature: ...
Read more >
Preprocessing and Postprocessing - Amazon SageMaker
Extend the code with the preprocessing and postprocessing scripts.
Read more >
gform_field_settings_tab_content
The gform_field_settings_tab_content action hook is used to echo the content for a custom field settings tab in the form editor.
Read more >
React Hooks example #1 counter - CodePen
... use a URL Extension of the type of code you want to link to. Either .css , .js , or the extension...
Read more >
Hooks | core.api.php | Drupal 9.0.x
Name Location Descr... hook_aggregator_fetcher_info_alter core/modules/aggregator/aggregator.api.php Perfo... hook_aggregator_parser_info_alter core/modules/aggregator/aggregator.api.php Perfo... hook_aggregator_processor_info_alter core/modules/aggregator/aggregator.api.php Perfo...
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