开始使用MarkDown来写博客

开始使用MarkDown来写博客

源起

自带的工具非常的不好用,于是一直用的是Word,但是Word确实太难看了点,在加上MardDown确实是很流行,在Github上很多文档都是用这个写的。

工具的选择

MarddownPad 2蛮好用的,但是需要付费。大概16USD
Sublime text 2 非常好用,速度也快
还有很多工具各有优点也缺点,但是我最关心的是2点。插入代码问题和图片插入的问题。

插入代码比如这个样子

public void onArticleSelected(int position) {
    FragmentManager fm = getActivity().getSupportFragmentManager();
    //ProgressbarFragment articleFrag = (ProgressbarFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.squareProgressBar1);
    ProgressbarFragment articleFrag = (ProgressbarFragment)fm.findFragmentByTag("progress");
    if (articleFrag != null) {
        // If article frag is available, we're in two-pane layout...

        // Call a method in the ArticleFragment to update its content
        articleFrag.updateArticleView(position);
    } else {
        // Otherwise, we're in the one-pane layout and must swap frags...

        // Create fragment and give it an argument for the selected article
        ProgressbarFragment newFragment = new ProgressbarFragment();
        Bundle args = new Bundle();
        args.putInt(ProgressbarFragment.ARG_POSITION, position);
        newFragment.setArguments(args);

        FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();

        // Replace whatever is in the fragment_container view with this fragment,
        // and add the transaction to the back stack so the user can navigate back
        transaction.replace(R.id.fragmentContainer, newFragment);
        //transaction.addToBackStack(null);

        // Commit the transaction
        transaction.commit();
    }
}

插入图片

在cnblogs里插入图片,我目前只是根据博客里面给出的公告点击上面的图片按钮,然后在将点击按钮上传图片或者将图片拖到上传图片的按钮上。上传完后,会在录入框里自动加入图片的Markdown代码。上面的图片就是自动生成的代码。

小结

上面的文章我使用了代码插入功能和图片插入功能。然后还有一些基本的语法。

资料推荐

我这里推荐一个不错的语法Markdown 语法说明 (简体中文版)

工具

  • MarkdownPad 一个收费的Windows下的Markdown编辑工具。
  • Sublime Text 2 一个说是收费但是还是可以随便用的工具,非常快速,强大,插件齐全,值得后期研究。
原文地址:https://www.cnblogs.com/canglin/p/4444138.html