-14

Let me assume I would like to share a particular image that contains certain simplifications. I don't want to directly paste it to make the question short, simple, and straightforward. So, the best way to do this is to generate a link that would open a new page and show the image. But, I don't want to create a new link from other third-party websites like imgBB where you upload an image and then get the link.

Is there some kind of facility provided by Stack Exchange itself to do this?? (I am quite to new Stack Exchange. I am learning and would like to contribute and ask more and more questions here.)

Similarly, I want to know about something similar for sharing code as well. Sharing the screenshot of the code is quite inefficient not allowing others to copy and edit it easily. The best way for this is the same as above but, this time link would redirect to a page where the text is visible, copyable, but not editable.

How can we do this for a code sharing?

2
  • 9
    Questions and answers on Stack Exchange (SE) must be self-contained. The goal of SO/SE is to create repositories of questions and answers valuable to future visitors. Questions and answers requiring off-page resources are useless once those resources change or die. Any questions where a resource is required to understand the question should be closed as "needs details of clarity", or other appropriate reason. Such "answers" should be deleted as NAA. Only information (e.g. code) in the post itself is considered. A link can be used for context, but not for required information.
    – Makyen
    Commented Apr 23 at 17:04
  • 3
    You can make a version with the image inline using the site editor image button. That stores a permanent SE copy of the image as part of that version. Then edit to another version that just gives the link but removes the markup to put its image inline. However it is probably a bad idea to not have it inline; showing only a link & requiring to click are contrary to "short", "simple" & "straightforward". And readers will edit the post to put a relevant image back inline. Anyway what is "contains certain simplifications"? Do not link or inline images of text, give text as text.
    – philipxy
    Commented Apr 23 at 17:55

1 Answer 1

13

Have you looked at the help center pages? They should cover most of what you need

There's a guide to formatting, and here's the page on MSE. It covers image upload (it's built into the SE platform, but it may need a minimum reputation on some sites because spammers abuse it). You shouldn't share code or error messages as images ever (relevant MSO post), but there are other uses for it.

As for code sharing, I think the 'best' resource is specific to Stack Overflow, and I favour code fences (three backticks before and at the end of code blocks) for delimiting code or configuration files I'm sharing.

4
  • 17
    ... and if your code is long enough that you think you need to share it externally, revisit the "minimal" parts here...
    – Aaron Bertrand Staff
    Commented Apr 23 at 12:59
  • @AaronBertrand The source you have provided doesn't explain how to share really long code lines. It kinda just says to shorten the code myself using different methods.
    – KNVCSG
    Commented Apr 27 at 20:26
  • Its harder for someone to debug off an image, sometimes people try your code and copy pasting makes it easier. Other times its an accessibility thing - either because people are visually impaired, or have other issues. Images don't expand as well as text. You can't search text in an image either. Commented Apr 27 at 23:20
  • @AaronBertrand I can't share it because it is too long to be shared through the comment section. This is exactly why I am asking this question.
    – KNVCSG
    Commented Apr 28 at 11:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .