-
Notifications
You must be signed in to change notification settings - Fork 690
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve git initialisation and initially included files. (#386)
- Loading branch information
1 parent
f29c8d9
commit efaab30
Showing
7 changed files
with
141 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# A default YAML configuration for the repository. | ||
# Please refer to config_defaults.py for documentation on what these options do | ||
|
||
# The accepted path patterns should be provided as a dictionary mapping regex | ||
# patterns to descriptions of that pattern. | ||
path_patterns: | ||
'.*': "All paths are valid." | ||
|
||
# A dictionary of aliases which point to knowledge posts. This allows you to alias posts | ||
# which may be useful to forward old links to new locations, or to give certain posts | ||
# precedence. It also allows the post path to violate the normal naming rules of posts. | ||
# The only condition is that they cannot mask an existing post url, in which case the | ||
# alias is silently ignored. | ||
aliases: {} | ||
|
||
# Postprocessors to apply when importing KnowledgePost objects into the repository. | ||
# Note that KnowledgePost objects by default run 'extract_images' and 'format_checks'. | ||
# Order is important. Should be a list of lists, of form: | ||
# ['name of postprocessor', {'init_kwarg': 'value'}] | ||
postprocessors: [] | ||
|
||
# Usernames of users to keep informed of changes to the knowledge data repo | ||
editors: [] | ||
|
||
# A regex pattern to which valid usernames must adhere | ||
username_pattern: '.*' | ||
|
||
# A tuple/list of strings, the first being a regex with named groups, and the | ||
# second being a format string with the group names available. | ||
username_to_name_pattern: ['(?P<username>.*)', '{username}'] | ||
|
||
# A tuple/list of strings, the first being a regex with named groups, and the | ||
# second being a format string with the group names available. | ||
username_to_email_pattern: ['(?P<username>.*)', '{username}@example.com'] | ||
|
||
# The base url of the server hosting this repository. | ||
web_uri_base: ~ | ||
|
||
# If administrators of this knowledge repository want to suggest a specific | ||
# knowledge_repo version requirement when interacting with the repository using | ||
# the `knowledge_repo` script, they may do so here. Users can always work around | ||
# this restriction by using the `--dev` flag to the `knowledge_repo` script. If | ||
# the value supplied is a string starting with '!', it is taken to refer to a | ||
# git tag or commit hash on the upstream Knowledge Repo repository, and the | ||
# `knowledge_repo` script will clone the required Knowledge Repo version and | ||
# chain commands to it. Otherwise, it is interpreted as a pip-like version | ||
# description (e.g. '==x.y.z', '>0.1.2<=0.8.0', etc), and the currently running | ||
# version of the `knowledge_repo` library is checked at runtime. | ||
required_tooling_version: ~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Knowledge Repository | ||
|
||
This is a git repository that stores documents called "Knowledge Posts" in a | ||
format compatible with the [Knowledge Repo](https://github.com/airbnb/knowledge-repo) | ||
project. | ||
|
||
If you are looking to contribute a post to this repository, please refer to the | ||
below quickstart guide or the [upstream documentation](http://knowledge-repo.readthedocs.io/en/latest/quickstart.html). | ||
|
||
## Quickstart | ||
|
||
1\. Install the knowledge-repo tooling | ||
``` | ||
pip install --upgrade "knowledge-repo[all]" | ||
``` | ||
|
||
2\. Clone this repository to your local machine | ||
``` | ||
git clone <git_url> <repo_path> | ||
``` | ||
**Note:** If you regularly interact with this repository, you can avoid having to type `--repo <repo_path>` in all of the below commands by exporting a shell environment variable: | ||
|
||
``` | ||
export KNOWLEDGE_REPO="<repo_path>" | ||
``` | ||
|
||
3\. Create a post template | ||
|
||
For Jupyter notebooks: | ||
``` | ||
knowledge_repo --repo <repo_path> create ipynb example_post.ipynb | ||
``` | ||
|
||
For R Markdown: | ||
``` | ||
knowledge_repo --repo <repo_path> create Rmd example_post.Rmd | ||
``` | ||
|
||
4\. Edit the notebook file `example_post.ipynb` or `example_post.Rmd` as you normally would. | ||
|
||
5\. Add your post to the repo with in-repository path of `project/example` | ||
``` | ||
knowledge_repo --repo <repo_path> add <post_path> -p project/example | ||
``` | ||
|
||
6\. Preview the added post to ensure everything is rendering correctly | ||
``` | ||
knowledge_repo --repo <repo_path> preview project/example | ||
``` | ||
|
||
7\. Submit post as a new git branch in this repository | ||
``` | ||
knowledge_repo --repo <repo_path> submit project/example | ||
``` | ||
|
||
8\. Open a pull/merge request on your branch | ||
|
||
Once ready, merge your branch into master, and your post will shortly thereafter | ||
appear in attached *Knowledge Repo* servers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters