Unverified Commit 15f31faa authored by Sébastien Eustace's avatar Sébastien Eustace
Browse files

Start documentation

parent e80348e1
Loading
Loading
Loading
Loading
+1 −0
Changes for .gitignore: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -27,4 +27,5 @@ pip-log.txt
setup.cfg
MANIFEST.in
setup.py
/docs/site/*
pyproject.lock
+62 −0
Changes for docs/docs/basic-usage.md: 62 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Basic usage

For the basic usage introduction we will be installing `pendulum`, a datetime library.
If you have not yet installed Poetry, refer to the [Introduction](/docs/#introduction) chapter.

## Project setup

First, let's create our new project, let's call it `poetry-demo`:

```bash
poetry new poetry-demo
```

This will create the `poetry-demo` directory with the following content:

```text
poetry-demo
├── pyproject.toml
├── README.rst
├── poetry_demo
│   └── __init__.py
└── tests
    ├── __init__.py
    └── test_poetry_demo
```

The `pyproject.toml` file is what is the most important here. This will orchestrate
your project and its dependencies. For now, it looks like this:

```toml
[tool.poetry]
name = "poetry-demo"
version = "0.1.0"
authors = [ "Sébastien Eustace <sebastien@eustace.io>",]

[tool.poetry.dependencies]

[tool.poetry.dev-dependencies]
pytest = "^3.4"
```

### Specifying dependencies

If you want to add dependencies to your project, you can specify them in the `tool.poetry.dependencies` section.

```toml
[tool.poetry.dependencies]
requests = "^2.18"
```

As you can see, it takes a mapping of **package names** and **version constraints**.

Poetry uses this information to search for the right set of files in package "repositories" that you register
in the `tool.poetry.repositories` section, or on [PyPI](https://pypi.org) by default.

Also, instead of modifying the `pyproject.toml` file by hand, you can use the `add` command.
    
```bash
$ poetry add pendulum
```

It will automatically find a suitable version constraint.

docs/docs/index.md

0 → 100644
+23 −0
Changes for docs/docs/index.md: 23 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Introduction

Poetry is a tool for dependency management and packaging in Python.
It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.


## System requirements

Poetry requires Python 3.6+. It is multi-platform and the goal is to make it work equally well
on Windows, Linux and OSX.


## Installation

Installing Poetry is as simple as:

```bash
pip install --user poetry
```

!!!note

    In the future, Poetry will come with its standalone installer.

docs/mkdocs.yml

0 → 100644
+19 −0
Changes for docs/mkdocs.yml: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
site_name: Poetry documentation

theme:
  name: null
  custom_dir: theme

extra:
  version: 2.0

pages:
  - Home: index.md
  - Basic Usage: basic-usage.md

markdown_extensions:
  - codehilite
  - admonition
  - pymdownx.superfences
  - toc:
      permalink: 

docs/theme/main.html

0 → 100644
+21 −0
Changes for docs/theme/main.html: 21 added lines, 0 removed lines.
Original line number Diff line number Diff line
---
layout: documentation
title: {{ config.site_name|striptags|e }}
---

    <section class="p-b-50 p-t-50 documentation-content">
        <div class="container">
            <div class="panel panel-transparent">
                <div class="bg-white row p-l-20 p-r-20 p-b-20 p-t-5 xs-no-padding">
                    <div class="row">
                        <div class="col-md-3 documentation-toc">
                            {% include "toc.html" %}
                        </div>
                        <div class="col-md-9 documentation-body">
                            {{page.content}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
Loading