DEV Community

loading...

Bold, italic, preformatted in blog posts

bellons91 profile image Davide Bellone ・1 min read

In your blog, do you use conventions for when to use bold, italic and preformatted text?

Every time I write a post I find it difficult to maintain a coherent style when referring to a variable or a function name.

For example: "If you want to get the list of items, you can call GetList() method.". How do you highlight GetList?

  1. If you want to get the list of items, you can call GetList() method.

  2. If you want to get the list of items, you can call GetList() method.

  3. If you want to get the list of items, you can call GetList() method.

Have you set a personal style guide?

Discussion

pic
Editor guide
Collapse
alohci profile image
Nicholas Stimpson

My personal preference is for preformatted, because that's how you'd see code in a IDE. It means you don't need different styles for a mention of a method name and a larger code block.

Collapse
bellons91 profile image
Davide Bellone Author

Good idea! I like it!

And would you give a specific meaning for bold and italics?

Collapse
alohci profile image
Nicholas Stimpson

Traditionally, both bold and italics are used for specific typographic conventions. Bold for emphasis, italics for foreign words, ship names, etc. Blog posts should probably respect those.

Thread Thread
bellons91 profile image
Davide Bellone Author

Uhm, right.

So a good example could be
If you want to get all the items, you can call GetList() method.

Looks good!