DEV Community

Davide Bellone
Davide Bellone

Posted on

Bold, italic, preformatted in blog posts

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?

Top comments (4)

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
 
bellonedavide profile image
Davide Bellone

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
 
bellonedavide profile image
Davide Bellone

Uhm, right.

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

Looks good!