Skip to content

Commit

Permalink
Merge pull request #12 from Vernacular-ai/docs
Browse files Browse the repository at this point in the history
Docs migrated to sphinx.
  • Loading branch information
ltbringer authored Apr 11, 2021
2 parents a411754 + d4c147c commit bed0a66
Show file tree
Hide file tree
Showing 226 changed files with 27,313 additions and 11,726 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,4 @@ cython_debug/

# IDEs
.vscode/
.idea/
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: python
os:
- linux
python:
- "3.6"
- "3.7"
- "3.8"
install:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ test: lint ## Run the tests.
docs: test
@echo -e "🦆🦕🐬🐶"
@rm -rf dialogy/docs/dialogy
@pycco dialogy/**/*.py -p -i
@pycco tests/**/*.py -p
@cp docs/pycco_edit.css docs/pycco.css
@$(MAKE) html -C docs_src
@rm -rf docs/*
@mv docs_src/build/html/* docs

all: docs
38 changes: 28 additions & 10 deletions dialogy/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
"""
This module exposes a command line utility to create project scaffolding. This creates a starting point for any project, an exhibit:
.. code-block:: bash
:linenos:
:emphasize-lines: 1
dialogy create hello-world dialogy-template-simple-transformers
cd hello-world
poetry install
make lint
Usage:
__init__.py create <project> <template> [--namespace=<namespace>]
Options:
<template> The source data directory; models, datasets, metrics will be copied from here.
<project> A directory with this name will be created at the root of command invocation.
--namespace=<namespace> The version of the dataset, model, metrics to use.
-h --help Show this screen.
--version Show current project version.
<template>
The source data directory; models, datasets, metrics will be copied from here.
<project>
A directory with this name will be created at the root of command invocation.
--namespace=<namespace>
The version of the dataset, model, metrics to use.
-h --help
Show this screen.
--version
Show current project version.
"""

from docopt import docopt # type: ignore

from dialogy.cli.project import new_project


def main() -> None:
"""
Cli interface.
Available features:
1. create project.
Create project scaffolding cli.
"""
args = docopt(__doc__)
project_name = args["<project>"]
Expand Down
21 changes: 12 additions & 9 deletions dialogy/cli/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,20 @@ def new_project(
destination_path: str, template: str, namespace: str = "vernacular-ai"
) -> None:
"""
Create project scaffolding.
Create a new project using scaffolding from an existing template.
This function uses [`copier.copy`](https://copier.readthedocs.io/en/stable/)
to use an existing template.
This function uses `copier's <https://copier.readthedocs.io/en/stable/>`_ `copy <https://copier.readthedocs.io/en/stable/#quick-usage>`_ to use an existing template.
Args:
template (str):
Look for "dialogy-template-*" here: https://github.com/Vernacular-ai
Example: "dialogy-template-simple-transformers"
destination_path (str):
namespace (str, optional): A github/gitlab Organization or Username. Defaults to "vernacular-ai".
An example template is `here: <https://github.com/Vernacular-ai/dialogy-template-simple-transformers>`_.
:param destination_path: The directory where the scaffolding must be generated, creates a dir if missing but aborts if there are files already in the specified location.
:type destination_path: str
:param template: Scaffolding will be generated using a copier template project. This is the link to the project.
:type template: str
:param namespace: The user or the organization that supports the template, defaults to "vernacular-ai"
:type namespace: str, optional
:return: None
:rtype: NoneType
"""
if not os.path.exists(destination_path):
os.mkdir(destination_path)
Expand Down
Loading

0 comments on commit bed0a66

Please sign in to comment.