zoukankan      html  css  js  c++  java
  • 开始使用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 一个说是收费但是还是可以随便用的工具,非常快速,强大,插件齐全,值得后期研究。
  • 相关阅读:
    SQlite数据库
    关于如何获取剪切板的多个图片处理
    aes 和 Md5 分析
    SIP消息
    getItemAt
    C++ map的方法
    C++ 解析Json
    CentOS 6.3安装配置LAMP服务器(Apache+PHP5+MySQL)
    阿里云服务器CentOS 5.7(64位)安装配置LAMP服务器(Apache+PHP5+MySQL)
    Apache虚拟主机(vhost)配置教程
  • 原文地址:https://www.cnblogs.com/canglin/p/4444138.html
Copyright © 2011-2022 走看看