第一篇博客—markdown入门

xiaoxiao2021-02-28  115

第一篇博客—markdown入门

    我是一个不太愿意整理文字的人,一直很羡慕别人能把笔记整理地很好,也有过写博客的想法,但苦于实在不愿意耗费心思排版,今天尝试了一下markdown,简直对程序员太友好了,从此开始坚持写博客的习惯,第一篇就从markdown开始吧。

markdown编辑器

     markdown编辑器有很多种,不同人有不同偏好,我使用的是sublime配合markdown插件,主要是特别喜欢sublime,后面会专门写一篇关于sublime的博客。其中MarkdownEditing插件可以高亮显示Markdown语法还支持很多编程语言的语法高亮显示。MarkdownPreview插件可以生成网页HTML预览。OmniMarkupPreviwer可以实时在浏览器中预览。

markdown简单语法

标题

    在文字前加 # 号即可生成标题,根据#数目生成不同级别的标题,如下所示

# 一级标题 ## 二级标题 ### 三级标题

一级标题

二级标题

三级标题

列表

    在文字前加上 - 或 * 即可变为无序列表,在文字前加1. 2. 3. 则声称有序列表,符号和文字之间有一个空格。

1. c++ 2. python 3. java c++python java - c++ - python - java c++python java

引用

    引用只需在文本前加一个>

>这是一段引用

这是一段引用

图片与链接

图片为:![](){ImgCap}{/ImgCap} 链接为:[]() [百度](https://www.baidu.com) ![北大](http://a.hiphotos.baidu.com/baike/w=268;g=0/sign=9af7a9d33d2ac65c67056175c3c9d52c/9f510fb30f2442a779438816d943ad4bd1130237.jpg)

字体与分割线

    粗体   用两个 *框起     斜体   用一个 *框起     分割线 三个*号

**markdown** *markdown* ***

markdown markdown


代码段

    用三个反引号框起,(左上角的’~‘)

''' Basic Operations example using TensorFlow library. ''' from __future__ import print_function import tensorflow as tf # Basic constant operations # The value returned by the constructor represents the output # of the Constant op. a = tf.constant(2) b = tf.constant(3) # Launch the default graph. with tf.Session() as sess: print("a=2, b=3") print("Addition with constants: %i" % sess.run(a+b)) print("Multiplication with constants: %i" % sess.run(a*b)) # Basic Operations with variable as graph input # The value returned by the constructor represents the output # of the Variable op. (define as input when running session) # tf Graph input a = tf.placeholder(tf.int16) b = tf.placeholder(tf.int16) # Define some operations add = tf.add(a, b) mul = tf.multiply(a, b) # Launch the default graph. with tf.Session() as sess: # Run every operation with variable input print("Addition with variables: %i" % sess.run(add, feed_dict={a: 2, b: 3})) print("Multiplication with variables: %i" % sess.run(mul, feed_dict={a: 2, b: 3})) matrix1 = tf.constant([[3., 3.]]) matrix2 = tf.constant([[2.],[2.]]) product = tf.matmul(matrix1, matrix2) with tf.Session() as sess: result = sess.run(product) print(result) # ==> [[ 12.]]

可以在开头注释代码类型,显示高亮

```python print(1+2)

数学公式

    可以使用两个美元符包裹 TeX 或 LaTeX 格式的数学公式来实现

$$\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$

x=b±b24ac2a 或者使用Google Chart的服务器

<img src="http://chart.googleapis.com/chart?cht=tx&chl= 在此插入Latex公式" style="border:none;">


    以上是markdown的基本用法,主要是想做一个开篇,第一次写博客水平有限,希望看到的各位多理解。我最近在做deep learning相关的东西,做过的几个项目会陆续写到博客中,另外还有读过的论文和相关课程知识整理,欢迎大家关注转载!

转载请注明原文地址: https://www.6miu.com/read-43458.html

最新回复(0)