How can we format code examples so that they work on a range of devices?
We use Madcap Flare to produce a large documentation set that contains many code examples (primarily SQL, but also C++, Java, and Python) and command-line operations. When the doc set was first planned, years ago, the people designing the layout assumed desktop browsers, as was the norm back then. We know how to make most aspects of our doc set more responsive to viewport size and platform, but I'm not sure what to do about the code examples.
Flare uses a slightly augmented HTML for its source. Our examples are all in <pre> blocks, with styling for syntax highlighting. Regular text flows to fit the viewport, but you can't just wrap a Linux command line, and the results of wrapping code would sometimes be confusing unless a continuation character were used in ways that browsers usually don't. Within the <pre> blocks we sometimes reformat unwieldy code or command lines onto multiple lines, using continuation characters and indentation to make things clear. But we're doing that based on what looks good in the browser windows we're currently using, so none of this solves the tablet problem (let alone the phone problem). And yes, we have heard from customers that they want to be able to consult our documentation on these devices.