Suggestion Position of the inline code formatting icon on the toolbar in the reply box

  • Thread starter Thread starter Wrichik Basu
  • Start date Start date
Click For Summary
The discussion centers on the placement of the inline code formatting icon in the reply box toolbar, with a suggestion to move it from a drop-down menu to a more accessible position by replacing a less-used icon, such as the text color option. Participants express a need for clarification on ICODE tags, which are used to format small code fragments inline without specifying a language, unlike CODE tags that are better for full statements. An example illustrates the difference in appearance between using ICODE and CODE tags in a code snippet. The conversation also touches on the functionality of ICODE tags in enhancing readability by changing the font to monospace. Overall, there is a call for community feedback on the proposed toolbar change and a better understanding of code formatting options.
Wrichik Basu
Science Advisor
Insights Author
Gold Member
Messages
2,180
Reaction score
2,721
I tend to use inline code formatting ([ICODE]...[/ICODE]) quite a lot. Unfortunately, the icon is placed inside a drop-down menu after the code-block icon on the toolbar above the reply box. Can this be placed on the surface instead by replacing any other icon? For example, I haven't seen many posts that use text colour, so that can be replaced by the inline code icon.

A poll can be opened to find out whether all members are comfortable with this change.
 
  • Like
Likes Greg Bernhardt
Physics news on Phys.org
What do the ICODE tags do? I've never used them. Can you give an example? Thanks. :smile:
 
Icode tags put code fragments inline in a paragraph.
 
  • Informative
Likes berkeman
But how do you specify which language the Icode encoding should be for? IMO, that's one of the features of code tags.

Testing: What is the difference between starting a frame in Tcl . configure -width 600 -height 600 and in Python/Tk mainframe = ttk.Frame(root, padding="3 3 12 12") ?

Code:
. configure -width 600 -height 600
Python:
mainframe = ttk.Frame(root, padding="3 3 12 12")

Interesting ... Tcl is not a standard code tag language selection...
 
Last edited:
berkeman said:
But how do you specify which language the Icode encoding should be for?
You don't need to specify a language. ICODE tags are generally used for small words or expressions; for full statements, it is better to use CODE tags.

Consider the following snippet:
In Android, an Intent is used to pass messages. They may be used to start an activity, service or send a broadcast using the startActivity(), startService() or sendBroadcast() methods. Note that if you intend to use any of the above methods from a Fragment, you have to call them using requireContext(), as a Fragment does not have its own Context:
[CODE lang="java" title="Android"]requireContext().startActivity(intent);[/CODE]
Now consider writing the above with CODE tags everywhere instead of ICODE tags:
In Android, an [CODE lang="java" title="Android"]Intent[/CODE] is used to pass messages. They may be used to start an activity, service or send a broadcast using the [CODE lang="java" title="Android"]startActivity()[/CODE], [CODE lang="java" title="Android"]startService()[/CODE] or [CODE lang="java" title="Android"]sendBroadcast()[/CODE] methods. Note that if you intend to use any of the above methods from a [CODE lang="java" title="Android"]Fragment[/CODE], you have to call them using [CODE lang="java" title="Android"]requireContext()[/CODE], as a [CODE lang="java" title="Android"]Fragment[/CODE] does not have its own [CODE lang="java" title="Android"]Context[/CODE]:
[CODE lang="java" title="Android"]requireContext().startActivity(intent);[/CODE]
You can see that the second snippet doesn't look good. ICODE tags simply change the font of the text to monospace, and thus highlight code keywords in a paragraph.
 
  • Informative
  • Like
Likes berkeman and Ibix
Hello everyone, I recently revisited Physics Forums after a long hiatus (about 4-5 years) and started catching up on the recent discussions. What immediately struck me—and what inspired this thread—is seeing so many of the exact same user names in the "Latest Posts" section who were just as active when I was last here! To the dedicated, long-term, and continuously active members of this community: What keeps you coming back and contributing regularly after all this time? Is it the joy...

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 13 ·
Replies
13
Views
7K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 19 ·
Replies
19
Views
8K
  • · Replies 183 ·
7
Replies
183
Views
80K
  • · Replies 94 ·
4
Replies
94
Views
12K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K