docs.page icon indicating copy to clipboard operation
docs.page copied to clipboard

`console` syntax breaks preview

Open bartekpacia opened this issue 3 years ago • 12 comments

Reproduction steps

  1. Put this in some .mdx file:

     ```console
      $ adb shell uiautomator dump
      ```
      
  2. Try to open that .mdx file using Local Preview feature. It should not work.

Also, the leading $ is cropped. This is annoying.

bartekpacia avatar Oct 10 '22 11:10 bartekpacia

I'll look into this ASAP :) thanks!

cabljac avatar Oct 20 '22 10:10 cabljac

Thanks!

Also, as a side note, it'd be great to have the leading dollar sign ($) not be copied if the code block type is set to console. Something like this.

bartekpacia avatar Oct 20 '22 13:10 bartekpacia

Believe i've fixed this in https://github.com/invertase/docs.page/pull/237 , hopefully will go into the next update.

cabljac avatar Oct 21 '22 15:10 cabljac

Thanks a ton @cabljac! 💙😁

bartekpacia avatar Oct 21 '22 15:10 bartekpacia

I think this can be closed since #237 was merged.

cc @cabljac

bartekpacia avatar Oct 24 '22 14:10 bartekpacia

BTW, how can I know if the PR that was merged is already released? I don't see any git tags in this repo, do you deploy docs.page directly from master?

bartekpacia avatar Oct 24 '22 14:10 bartekpacia

Hey @cabljac, I see this is merged, but copying still copies the leading $.

bartekpacia avatar Jan 09 '23 18:01 bartekpacia

Just deployed a new version of docs page with a massively simplified api and codebase. Going to work through some old issues to make sure they're sorted tomorrow.

Ehesp avatar Jan 09 '23 21:01 Ehesp

Yeah the new UI is sleek! Great job!

bartekpacia avatar Jan 09 '23 22:01 bartekpacia

Is it just the $ symbol we shouldn't be copying for console blocks, or are there other symbols we need to take into consideration?

Ehesp avatar Jan 09 '23 22:01 Ehesp

TBH, I don't know, I usually see and use the $.

I think that a leading # (for the super user mode) might be a good candidate for remove-on-copy as well.

bartekpacia avatar Jan 09 '23 22:01 bartekpacia

Thinking about it now, I got another idea.

The $ should be added automatically if console syntax is specified. No need for the user to start every line with a $.

bartekpacia avatar Jan 30 '23 14:01 bartekpacia