Giter Club home page Giter Club logo

twnanda's Introduction

如何在Windows系統上開發

https://travis-ci.org/twnanda/twnanda.png?branch=master

第一次安裝

  1. 安裝 Cygwin64位元安裝檔

    安裝時,請將 Python 以及 Devel 選成 Install (不要選 Default

  2. 安裝須花頗多時間,完成後,在桌面建立一個 Cygwin Terminal 的捷徑。

  3. 點擊捷徑進入 Cygwin Terminal,進入後先檢查 Python 以及 git 是否安裝成功。

    先檢查 Python

    $ python -V

    如果成功會看到 Python 的版本號碼。

    接著檢查 git

    $ git --version

    如果成功會看到 git 的版本號碼。 接著設定user名稱跟email:

    $ git config --global user.name "twnanda"
    $ git config --global user.email "[email protected]"
  1. 安裝 pip [2]

    $ easy_install-2.7 pip
  2. 進入D槽,建立github資料夾:

    $ cd /cygdrive/d/
    $ mkdir github
  3. 進入剛剛建立的github資料夾,把網站原始碼從GitHub上clone下來:

    $ cd /cygdrive/d/github/
    $ git clone https://github.com/twnanda/twnanda.git
  4. 進入原始碼目錄,用 pip 安裝需要的 Python 套件:

    $ cd /cygdrive/d/github/twnanda
    $ pip install -r requirements.txt
  5. 產生 JavaScript 及 CSS 檔

    $ cd /cygdrive/d/github/twnanda
    $ make js
    $ make scss
  6. 產生整個網站:

    $ cd /cygdrive/d/github/twnanda
    $ make

    打開 http://localhost:8000/ 可看產生的網站。

日常開發

進入原始碼目錄修改或新增檔案,完成後

$ cd /cygdrive/d/github/twnanda
$ make
# 此時打開瀏覽器(chrome, firefox, ...),拜訪網址:
# http://localhost:8000/
# 確認是否正確。

# 觀看還未加入的修改
$ git status
# 加入修改
$ git add ...
# 確認修改
$ git commit -m "..."
# 整合別人的修改
$ git pull
# 上傳修改到GitHub
$ git push
# 接著git會問帳號密碼,請輸入你的帳號密碼

Cygwin installation & Run Cygwin

  1. cygwin installation
    necessary package: Devel, Python
  2. python -V

  3. devel -V

  4. git -- version

  5. easy-install-2.7 pip

  6. cd d:


  1. click cygwin icon
    (cygwin window)
  2. cd /cygdrive/d/github/twnanda

  3. make

  4. open chrome (or firefox, ..., )

  5. url: http://localhost:8000

  6. make

    make serve
    (if no update)

  7. git status
    (red on file not added yet)

  8. git add dir/file
    (e.g. content/articles/tipitaka/sutta/khuddaka/dhammapada)
  9. git status

  10. git commit -m ""
    "remark what is added, changed, etc."
  11. git status

  12. git push
    upload github server

How to Develope (Ubuntu Linux)

Development Tool: pelican (static site generator written in Python)

Development Environment: Ubuntu 15.10

First-time Setup

  1. Install git and pip:
$ sudo apt-get install git
$ sudo apt-get install python-pip
  1. git clone source code:
$ cd
$ mkdir dev
$ cd ~/dev/
$ git clone https://github.com/twnanda/twnanda.git
  1. Install Python tools:
$ cd ~/dev/twnanda/
$ sudo pip install -r requirements.txt
  1. Generate CSS/JS file:
$ cd ~/dev/twnanda/
$ make scss
$ make js
  1. Install language packages to add locale (Traditional Chinese):
$ sudo apt-get install language-pack-zh-hant

Daily Development

# start edit and develope
$ cd ~/dev/twnanda/
# If something changes, re-generate the website:
$ make html
# start dev server
$ make serve
# open your browser and preview the website at http://localhost:8000/

References

[1]7. 附录:轻量级标记语言 — GotGitHub (GitHub)
[2]python - Installing Pip-3.2 on Cygwin - Stack Overflow

twnanda's People

Contributors

tw-nanda avatar siongui avatar

Watchers

James Cloos avatar 陶愷瑋 avatar

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.