-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md: support displaying command snippets with Windows/OS/Linux tabs to select #759
Comments
I am not sure how many users are using DVC on Windows, but it seems that there is a workaround by using a POSIX-like command line shell: https://dvc.org/doc/user-guide/running-dvc-on-windows#posix-like-command-line-shell |
at least one Windows user recently reported confusion that would be cleared with this improvement. See https://discordapp.com/channels/485586884165107732/485596304961962003/647534970272743424 |
In order to move away from the research phase here, what do we need to decide? I think these are the questions:
Thoughts @dashohoxha @shcheklein @leehanchung? |
BTW that's basically the syntax for the tool mentioned in #698 (comment): Superfences (for MkDocs). It's open source code is also Python so maybe we can use it as base for our own functionality. See facelessuser/pymdown-extensions/.../pymdownx/superfences.py file (probably |
My 2c Instead of updating the code sections manually, the engine can convert
to
for the Windows tab. All command revisions I can think of are regular changes, Also, I don't think sniffing the browser to set the tabs is a good idea. People may use WSL or some other kind of shell, or connect to Linux boxes, etc. The default should be POSIX and if the user wants to see the Windows tab, it should stay that way by setting cookies. What's the percentage of Windows users? @shcheklein |
Automatic conversion from Linux to Win would be nice as a fall back but some Windows blocks will be totally different i.e. the commands themselves are different. |
Hi @julieg18 ! Could iterative/cml.dev#70 / iterative/cml.dev#113 be ported over here to close this issue too? Cc @rogermparent Thanks |
I'm pretty sure the mechanism can be ported, the cml docs engine is meant to be as close to the dvc.org one as possible. |
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.mdWe might try a syntax like this:
There are 4 backticks for the enclosing
dvc
block. It is a valid markdown syntax and normally it would render like this:The engine should render it with tabs, but even with normal markdown rendering it would appear somewhat acceptable.
The text was updated successfully, but these errors were encountered: