Skip to content

md: support displaying command snippets with Windows/OS/Linux tabs to select #759

@dashohoxha

Description

@dashohoxha

Extracted from #698 (comment) +

It would be nice to display command snippets with tabs "Linux/Mac" and "Windows", if they are different (similar to this example: https://dagshub.com/docs/pipeline/#featurization-or-pre-processing).

This page has some ideas about how it can be done: https://stackoverflow.com/questions/37606292/how-to-create-tabbed-code-blocks-in-mkdocs-or-sphinx
This one also has an example (class="codetabs"): https://raw.githubusercontent.com/apache/spark/master/docs/quick-start.md

We might try a syntax like this:

````dvc
```Linux/Mac
$ cat .gitignore
```
```Windows
$ type .gitignore
```
````

There are 4 backticks for the enclosing dvc block. It is a valid markdown syntax and normally it would render like this:

```Linux/Mac
$ cat .gitignore
```
```Windows
$ type .gitignore
```

The engine should render it with tabs, but even with normal markdown rendering it would appear somewhat acceptable.

Metadata

Metadata

Assignees

Labels

A: websiteArea: websitehelp wantedContributors especially welcomestatus: researchWriting concrete steps for the issuetype: enhancementSomething is not clear, small updates, improvement suggestionstype: feature-requestDEPRECATED New feature or requestwebsite: eng-docDEPRECATED JS engine for /doc

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions