LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback
User Name
Password
LQ Suggestions & Feedback Do you have a suggestion for this site or an idea that will make the site better? This forum is for you.
PLEASE READ THIS FORUM - Information and status updates will also be posted here.

Notices


Reply
  Search this Thread
Old 06-14-2017, 02:41 PM   #1
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Rep: Reputation: 51
Exclamation The [code] tags: suggestions and a problem


I want to suggest something related with the code tags.

The code tags do not break long lines, as this is usually expected.

In my opinion, there should be and option to pass it to break lines longer than 80 columns. Longer columns are not so easy to read. Further, the programs I write also have long lines in them, although my terminals width is usually 80. The longer lines can be things copied from terminal (like man pages), comments or source code (also depending on the language in use). The editors usually break the long lines to fit the terminal (or window).

[color] has options, so I imagine that it should be easy to add one (or a few) to [code]. I would like the default to be "break lines", or to have another tag for that. An option to other widths may exist (if more than one option in the some tag is not easy to do, let them be the actual value in the option).

The font tags exist, but they are too long to type. I wish the existence of [pre][/pre], just to set a different font (not exactly the same as HTML, which is like our [code]).

--------------

The problem: the code tags appear with extra empty lines after their text ended. I do not remember pointing this before, but the idea is not new for me.

In this thread, there are several examples of code tags. My tags are manually typed, and in separate lines (which I imagined that cause the problem, wrong). For me, it is much easier to type than a few clicks to set them. When quoting others' posts in that thread, I have seen the use of "normal" ones, created by the site (and all these tags are, IMHO, very ugly, due being upper-case).
 
Old 06-14-2017, 02:51 PM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
To me, at least, the point of the code tags is that there is no formatting so things can be read verbatim and, also, things can be pasted without the worry of "Did it wrap or not?".
I would suggest that should an output be posted which "had consistently over-long lines" it could be a symptom in and of itself.

Last edited by 273; 06-14-2017 at 03:04 PM. Reason: Typo
 
Old 06-14-2017, 03:03 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
when copy paste, I just go to the end of the line hit enter to chop it off giving it that end line hidden thingy whenever it doesn't do that after posting. this requires hitting the edit button and fixing it after posting.
 
Old 06-14-2017, 08:54 PM   #4
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Thumbs down

@273:
Maybe you are wrong. I think that all formatting (or something close to that) we can do in the the posts, are also available inside the code tags: in the thread I pointed, I use color tags inside the code tags, there is no problem.

Pasting or writing source code with brackets there, may give unwanted effects (if they are not escaped), I think.

And you are wrong that long lines are a problem. There are many programs, languages and manual pages, among other things, I have seen in the code sections in the LQ fora, that have long lines that are formatted *only* we they are shown to us (in their original source).



@BW-userx:
Your first sentence, too long, is a bit hard to understand. I assume what it is with the second sentence, but I may be wrong. You seem to try to justify the lack of a feature, is that right?

Look at this post. It has a code section with several lines that do *not* exist in the forum code I wrote! It somehow makes them, it is a bug!

Last edited by dedec0; 06-15-2017 at 05:14 PM.
 
Old 06-15-2017, 12:54 AM   #5
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by dedec0 View Post
And you are wrong that long lines are a problem. There are many programs, languages and manual pages, among other things, I have seen in the code sections in the LQ fora, that have long lines that are formatted *only* we they are shown to us (in their original source).
You're misunderstanding -- that's actually my point. The code tags can be used to show the exact command give or its output.
If LQ arbitrarily wrapped at 80 columns things would look artificially wrapped to those reading on screens where the code block could have more than 80 columns.
Again, the main point of code blocks is that they can show commands and/or output without formatting.
 
Old 06-15-2017, 08:21 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by dedec0 View Post
@BW-userx:
Your first sentence, too long, is a bit hard to understand. I assume what it is with the second sentence, but I may be wrong. You seem to try to justify the lack of a feature, is that right?

Look at this post. It has a code section with several lines that do *not* exist in the forum code I wrote! It somehow makes them, it is a bug!
off the top of my head.

when copying and pasting one has to keep in mind that the hidden formatting within it is not carried over to that in which it is being pasted into, and some times it is. That all depends on the recipient of the text in how it deals with it.

It has been my experience that it all depends on the recipient in how it deals with it.

say for instance one writes something in LibreOffice, it has hidden formatting tags within it. If I write this out in LibreOffice first then copy and paste it into here using the code or quote tags what takes place?

When the hidden formatting codes (tags) or whatever it is that they are called to keep the formatting in the text are not there then it turns back into a flat file that has nothing to keep the formatting, so it is then one big line of text.

this is not a bug it is how the software was written to deal with copy paste as the programmer must have had in mind that one will type in what is needed between the code or quote tags.

the limitations are not because of the one that is using this software ie LQ . As LQ did not write this code to this "blog" forum.

I do not know what capabilities they have in order to modify the code to the formatting of text or how much actual work it will take to get it to work to your speciations.

I do know it is not a bug but a design issue. To have to write code that will check for the code or quote tags first then assign a 80 char rule to whatever is in between them. I am sure is not as easy as one may think.

yes it is a pain in the butt sometimes to post then look at it, only to find that what I or you or someone else did had not kept it formatting, only to have to go back in and fix it. but that is life. a pain in the butt.

going into what @273 said, too the code or quote tags which ar the same by a different name, allow the user to formate the text to how they want it to look within the complete text post. In order to get it to look like they want it to look like.

for instance in coding a certain format is apply for readability.

Code:
int main()
{
   function(){
         do something,
         do some more
        }
  if [ something ] 
        then fo this
  function(){
         do something here
  }
return 0
}
if it was to format everything at 80 then what could happen to that formatting you just read?

the tags provide a means to point out what is within it. to separate it from that other text within the post along with allowing it to be formatted like I just did, and for easier readability. as apposed to this.

int main()
{
function(data type, data type){
do something,
do some more
}
if [ something ]
then fo this
function(end-point, midpoint);
return 0
}

note when I am in edit mode it has the spaces just like that within the tags but loses the formatting when posting it.

Last edited by BW-userx; 06-15-2017 at 08:45 AM.
 
Old 06-15-2017, 08:35 AM   #7
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,111
Blog Entries: 21

Rep: Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474
Quote:
Look at this post.
Short answer. Can't. On SeaMonkey anyways.

Last edited by rokytnji; 06-15-2017 at 08:37 AM.
 
Old 06-15-2017, 08:42 AM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I'm sure, as with every feature, there are potential bugs.

My experience with the use of the [code] tags in LQ are that:
  1. When people don't use code tags and they paste code, sometimes the spacing gets screwed up where everything is all on the left margin. Perhaps they had tabs over spaces in their code.
  2. When people use code tags, I do not believe I have ever seen something that looks like the spacing was unintentionally altered. Except by the original typist - single mistakes versus a global change.
 
Old 06-15-2017, 05:15 PM   #9
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by rokytnji View Post
Quote:
Look at [this post]
Short answer. Can't. On SeaMonkey anyways.
Fixed. I forgot to put the url there after writing all the post:

#4 ...

Last edited by dedec0; 06-15-2017 at 05:21 PM.
 
Old 06-15-2017, 09:35 PM   #10
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,111
Blog Entries: 21

Rep: Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474
Quote:
Originally Posted by dedec0 View Post
Fixed. I forgot to put the url there after writing all the post:

#4 ...
Good description on the repeat with comments out showing. I just use <snip> on leaving out irreverent readouts and explain outside of code tags why the snip is there.

I picked that trick up when researching my own problems when learning how to drive and parallel park gnu/linux on my own.

Not sure if PS1 means play station one. Which I still own and use from time to time.
The coloring is just bells and whistles to me.
But then. I am shade tree linux user.

You guys tread in deeper waters while I am still in the kiddy pool.

But I have pimped out my urxvt a little on my own.

https://www.maketecheasier.com/custo...-prompt-linux/

But when inserted in a forum setting. Just plain text will show.

Last edited by rokytnji; 06-15-2017 at 09:43 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem displaying % character in posts and within code tags allend LQ Suggestions & Feedback 23 06-19-2015 10:50 AM
Code Tags custangro LQ Suggestions & Feedback 5 11-16-2013 02:55 PM
What are code tags? southsibling LQ Suggestions & Feedback 14 11-25-2008 09:08 AM

LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback

All times are GMT -5. The time now is 12:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration