開始使用MarkDown來寫博客

開始使用MarkDown來寫博客

源起

自帶的工具很是的很差用,因而一直用的是Word,可是Word確實太難看了點,在加上MardDown確實是很流行,在Github上不少文檔都是用這個寫的。ubuntu

工具的選擇

MarddownPad 2蠻好用的,可是須要付費。大概16USD
Sublime text 2 很是好用,速度也快
還有不少工具各有優勢也缺點,可是我最關心的是2點。插入代碼問題和圖片插入的問題。markdown

插入代碼好比這個樣子工具

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代碼。上面的圖片就是自動生成的代碼。網站

小結

上面的文章我使用了代碼插入功能和圖片插入功能。而後還有一些基本的語法。this

資料推薦

我這裏推薦一個不錯的語法Markdown 語法說明 (簡體中文版)插件

工具

  • MarkdownPad 一個收費的Windows下的Markdown編輯工具。
  • Sublime Text 2 一個說是收費可是仍是能夠隨便用的工具,很是快速,強大,插件齊全,值得後期研究。
相關文章
相關標籤/搜索