Giter VIP home page Giter VIP logo

one_algorithm_one_day's People

Contributors

shadowkimi520 avatar shengrongchun avatar

Watchers

 avatar

one_algorithm_one_day's Issues

GitHub push方式从 HTTPS 修改为 SSH

  1. 通过HTTPS方式 clone 的仓库每次提交都需要输入用户名/密码,这样比较麻烦;可以修改为通过 SSH 方式提交;
  2. 生成SSH的密钥对,把公钥拷贝到 GitHub 个人配置当中去;
  3. 通过 git remote set-url origin [email protected]:user_name/repository_name.git 修改远程库的访问方式

修改 README.md 文件中代码的高亮方式

  1. 我们在访问 GitHub 时,均是通过 GitHub 提供的对每个repository 中的目录或者文件的 web 页面,GitHub 在后端会处理 md 文件,并对其中的代码进行固定方式的高亮显示;
  2. 可以通过 highlight.js 提供的 js 和 css 文件修改默认的高亮方式;
  3. 当前 repository 中在配置 highlight.js 时进行了配置,使得所有的代码都自动推导为 c# ,因为我想用 GitHub 的样式文件中为 c# 代码提供的 font-style: italic ,谁让我中意你呢。当然,也可以把 highlight 中对应的 css 文件下载到本地,然后直接修改该样式文件获得该效果,谁让我不想改呢,谁让我想追求完美呢!
  4. GitHub的 ```js 语法仅仅是在生成 html 文件的最外层标签中添加language-js class,并不会影响 highligth.js的 automatic language detection;而通过直接使用<pre><code></code></pre>的方式,GitHub直接按 html 解析,并不会在外面在包裹一层 class 属性为 "highlight" 的 <div>,导致我想要的 font-style: italic 又适用不到了。因此,在 md 文件里,保留使用 ```js 来表示JS代码,highlight.js 配置的时候 hljs.configure({languages: ['cs']}) 仅自动推导到csharp.

GitHub README.md 中使用锚链接定位到 # 表示的标题

  1. GitHub 的 markdown 文件在生成对应的 html 文档时会给每个 # 表示的标题添加对应的 id 属性,属性值为标题的文本;这样就不需要用另外的 标签包裹标题。
  2. 如果使用 标签包裹标题,则 GitHub 在项目主页中丢弃该 id 属性,改用自身设置的 id 值;而通过 GitHub Pages的方式访问该项目的 GitHub repository 的时候会采用自定义的 id。为了在两种情况下都能使用锚链接,直接采用 GitHub 生成 id 值即可。(注意 GitHub 在生成 id 时的特殊处理,比如 '#' ':' '/' 等符号都丢弃,空格用 '-' 代替)
  3. GitHub 会使用生成的 id 属性来进行导航,从而点击该标题的时候可以将其滚动到视口的最顶端(所以我们将鼠标移动到一个标题上的时候会出现一个超链接一样的图标)。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.