Questions tagged [code-formatting]
The code-formatting tag has no usage guidance.
How to write the grave accent to add code in the comment section?
I have a magic keyboard from Apple set on US language and I try to find the keyboard shortcut for the grave accent (`) to add code in the comment section on askubuntu.com. I don't want to copy-paste ...
Community consensus regarding using backticks or 4 spaces for code
There might be similar posts regarding this in the past. So, please forgive me. I often find it hard to edit a post which has lengthy code (indented using 4 spaces). Also, there are higher chances of ...
Preformatted text horizontal scrolling - bug or feature?
AskUbuntu help recommend to style pre-formatted text and console output with #four spaces But sometimes it results in scrolling text. See this question as an example. The problematic line (as ...
Syntax highlighting doesn’t work on meta
When I enter <!-- language-all: lang-bash --> if :; then echo "quoted"; fi in a post on main, the output looks like this: Here on meta, the very same code gets no syntax highlighting at ...
Presentation of code should include explanation in a separate comment section
This is just an idea and I would like to see what the feedback is. The problem Starting Linux I've found myself many times looking through example code on this site and finding out what it actually ...
How do I use the grey formatting in a comment? [duplicate]
Someone showed me (by editing my question for me) how to make some of your text show up grey to show it is code. Now I need to know how to do it in a comment.
Automatically wrapping lines in Ask Ubuntu
I'm new to forums and stuff like that. I need to post my wifi-info scripts output in Ask Ubuntu using Firefox and I need to keep it as it is without wrapping any lines. As soon as copy and paste it, ...
How to properly add code in comment
How can I properly add a line of code in a comment like this test test I like it more grey than test test if that is possible. Or if there is another way to define code in a comment to make it ...
What to do with <!-- language: bash --> edits?
Recently in the edit queue, there have been edits that only add <!-- language: bash --> to the post. These edits are made by the same user. And often 5-10 at a time. Is the color highlighting of ...
How can I shorten the Long Code output in questions and answers and display scrollbars?
There are some questions and answers that have very log output that is condensed with scrollbars. Is there a formatting method to control how much is displayed between the scrolling. I believe some ...
Code Block Limit of 30000 characters
I came across a question where user had copied the output of a certain command and made a *.docx file out of it. The file was uploaded and the link was provided in the question to this file. I copied ...
Please use code fomatting for code, not quotes [duplicate]
This is some thing I see all the time recently and not just from new users. Users are using > to format there code and that is just wrong. Code should be formatted in one of these three ways ...
How can I quickly and easily format my code for SE sites' posts?
I usually indent code with tabs, and every time I want to test a snippet before posting it to a SE site I have to reformat it manually before I can post it. Even when I don't use tabs, I need to ...
How do I format some code specifically for the language used? Or how do I prevent it from being formatted? Which languages are supported?
If I format some code by indenting it using four spaces, the code is not formatted. How do I format some code specifically for the language used? Or how do I prevent it from being formatted? Which ...
Scrolling code blocks glitch
This is me trying to scroll left and right on this code block (animated): Here are the still images: This is a copy of the problematic code block, which I first found in this question dpkg was ...
Preserve tabs in code
Tabs are currently rendered as spaces in code blocks. I'm sure this is just a symptom of Markdown or an otherwise well-intentioned method to standardise code samples... However some code needs tabs to ...