• Hi Everyone!

    Is there a plugin or a way how to implement a modern way of emphasizing of some part of the text that may have some part of source code, command or other instruction with just ‘ signs.

    For example: bl-bla-bla ‘my.exe -t -e -s -t’ bla-bl-bla

    If there is an additional ability to transform this block

    ”’ php

    var a=1;

    ”’

    Into a pre code block that will be 10x greater.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    It’s called the code block, and it’s built into WordPress.

     Example of a code block.

    Of course, it is also possible to do inline code. This tends to be for very short snippets.

    Thread Starter kvv213

    (@kvv213)

    I’m sorry, I did a wrong direction.

    I need it in the Classic editor not in the modern block one. There is no such a function.

    I write articles in MS Word and then import them into WordPress and finalize with the Classic editor. How can I add these features into the Classic Editor?

    • This reply was modified 2 years, 2 months ago by kvv213.
    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Oh. In that case, there is nothing built into core.

    There’s several different plugins available to use as a syntax highlighter. Most of those work via shortcodes.

    If you’re still using the classic editor then most of them will work. Even if they say they’re out of date.

    Well, this may not please you, but it would be a piece of cake for me: do the whole thing in raw HTML. I started doing web pages that way in 1995, built and maintain several websites. I just began learning WordPress a year ago.

    When your Word doc is done, do a global Replace All (Ctrl-H) changing ^p to </p><p>. Then save as .txt which will remove all other formatting. This will precede every paragraph with <p> and end it with </p>. Manually fix the beginning of the first paragraph and the end of the last one.

    Open the text file with e.g., Notepad and Copy it. Open the Classic Editor, press Ctrl-Alt-Shift-M to get to the HTML “Code” editor. Paste the file in and add the markup.

    For a few lines of computer code, use the <code> tag. This is usually like a separate paragraph.
    <p>Following is a simple program</p>
    <code>
    For I = 1 to 6
    Print I
    End For
    </code>

    For something the user types, use the <kbd> tag. This is usually short, in the middle of a paragraph.
    <p>After doing blah, blah, you will enter <kbd>my.exe -t -e -s -t </kbd> and then…</p>

    For output, the <samp> tag is used.
    <p>Message from my computer:</p>
    <p><samp>File not found.<br>Press F1 to continue</samp></p>

    HTH

    Thread Starter kvv213

    (@kvv213)

    >Well, this may not please you, but it would be a piece of cake for me: do the whole thing in raw HTML. I started doing web pages that way in 1995, built and maintain several websites. I just began learning WordPress a year ago.

    I’ve started to build HTML pages back to the similar time with help of Hot Dog HTML editor and Volcov Commander ?? But now I would like more comfort in posting notes.

    MS Word has an ability to publish blog posts directly to WordPress site using xmlrpc feature. So there is no need for manual processing of Word’s code. There is a special template for blog posts.

    But I found out that I have <code></code> feature if I use Text mode editing in the Classic editor. But it works exactly as a inline code feature I need. But doesn’t support <pre> feature for multi line code. Aldo <code> is not visible in Preview mode (as well as <kbd> tag). But this can be fixed with CSS.

    That is great but I’d like to get an ability to use \` feature for inline code and a number of apostrophe for multiline code. I thing that there should be a plug in for this. I’ve checked it but couldn’t find it.

    Thread Starter kvv213

    (@kvv213)

    EnlighterJS Syntax Highlighter

    can do the required highlighting but… it appeared that there are too many data with these apostrophes in the data base and they mix up with inline code. So, I have to apply manually to all the tags.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Inline code in editor’ is closed to new replies.