Feel oneself too deserve this small partner, late at night more text, it is already 11:46 in the middle of the night.
Have a craigslist
Give an answer
This article will introduce how to write good typesetting articles in nuggets.
The first thing to know is that the Nuggets editor provides two magic tools: Markdown themes and code highlighting styles.
Very easy to use, using the right theme and code highlighting style can make our article tonality full, give readers a better reading experience.
Markdown theme
Set the location of the theme as follows:
I think the choice of theme is not uniform, we can combine the characteristics of our own content to choose the appropriate theme:
channing-cyan
For example, the article I summarized at the end of last year was mainly written in the way of telling stories. The behavior did not need to be particularly rigorous, and the style of writing was lively and lively, so I also used such lively theme and was expressive.
Conclusion:
-
The Channing-Cyan theme is very attractive, especially in the quotation section, which is emphasized. It is suitable for interview summary, year-end summary and other storytelling topics.
-
Personally feel not suitable for the tutorial type of article: because the topic for the content, a little distracting. The overdesign of the theme will distract you from the content itself.
The sample link
This article: PHP Go 2021 mid-year summary uses the Channing-Cyan theme.
smartblue
My favorite topic for a purely technical article is SmartBlue. This theme strikes a balance between good looking and practical.
Smartblue is more expressive than Juejin and Github, but it doesn’t overdesign like Channing-Cyan, which distracts the visual center, and doesn’t Chou (three tones) like GreenWillow.
Conclusion:
-
Technical articles are more rigorous, grading and steps are more important. Therefore, we should not use a theme that is too fancy, otherwise it will affect the overall reading experience of the reader, using a fancy theme will give the illusion that form is more than content.
-
Not too fancy, not too dull, and if you can use a theme in Nuggets, don’t use a silly style like markdown in an IDE.
-
hug
smartblue
!
The sample link
How does Redis batch set expiration time? The use of PIPLINE
Other topics
After writing the article, we can choose the theme according to the content of our article. After all, the cost of switching the theme is very low. The theme can only play a role of icing on the cake, and the content is king.
Other subjects can be explored by yourself. I think the basic principle of choosing a subject is: neither too ugly (stupid and coarse) nor too fancy (distracting).
There is also a rule: try not to always change the topic, so that you can form your own style; Stick to one theme for at least one article in a series.
Code highlighting style
Choosing the right code highlighting style can also be very helpful in improving the reader’s reading experience.
The nuggets Editor entry for setting code highlighting styles is here:
Say first conclusion
Personally, I prefer the first style: Ally – Dark. The reason is simple, and the theme is balanced: it’s bright but not eye-catching, it’s technological, and the colors are tasteful and not ugly.
For example, the following code is easy to read: method names, variables, static, strings, etc.
// Set the expiration time in batches
public static function myPut(array $data.$ttl = 0)
{
if (empty($data)) {
return false;
}
$pipeline = Redis::connection('cache')
->multi(\Redis::PIPELINE);
foreach ($data as $key= >$value) {
if (empty($value)) {
continue;
}
if ($ttl= =0) {
$pipeline->set(trim($key), $value);
} else {
$pipeline->set(trim($key), $value.$ttl); }}$pipeline->exec();
}
Copy the code
Pay attention to the point
Some of you may have encountered this problem: why doesn’t code highlighting work when it is set and the code section is marked correctly?
Don’t panic. I’ll tell you why.
You do this by marking code snippets with language types such as Java, Go, PHP, so that the editor knows which language style to highlight.
The corresponding effect is as follows:
Java的HelloWord
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World"); }}Copy the code
The Go HelloWord
package main
import "fmt"
func main(a) {
fmt.Println("hellword")}Copy the code
PHP的HelloWord
echo "Hello world";
? >
Copy the code
Python的HelloWord
print('Hello World! ')
Copy the code
Figure captions
A picture is worth a foreword — I don’t know who said that, but it makes sense.
Good illustrations can improve the quality of our articles by a big step. They can explain complex things clearly, attract readers, and strike a straight line.
For example, here’s my Pipline diagram:
Such as:
My picture of sun Wukong’s effortlessly extreme power must have attracted many readers.
Emphasis and quotation
There are two trees in front of my house, one is a jujube tree, and another is also a jujube tree. — Lu Xun
Proper use of bold and quotation can help readers to quickly capture the important content, which is very friendly to readers
Here’s how I typed the paragraph above:
Just a little bit better
I have always believed in the principle that every day a little bit better than yesterday, with time, will be a lot better.
We write articles the same, as long as every time to use more brains, after writing, do not worry about the release of their own, to the reader’s point of view to read their own articles, there will be new feelings.
Follow this feeling and optimize the layout of your article by choosing the right theme, highlighting the right code, highlighting the right places, and changing the background of the description.
In addition to what I have mentioned above, there must be a lot of tips to optimize article layout and improve readers’ reading experience, you need to find carefully. Welcome to feed me when you find it, haha.
In the long run, the bomb will be written.
Make a friend
Like to make friends with interesting people, my VX: Wangzhongyang1993, welcome harassment ~