Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc string for ElasticsearchDocumentStore.write_documents() & sync markdown files #501

Merged
merged 3 commits into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions docs/_src/api/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,32 @@
# Haystack — Docstrings Generation
*******************************************************

Setup Pydoc-Markdown
============

Pydoc-Markdown is a tool and library to create Python API documentation in Markdown format based on lib2to3, allowing it to parse your Python code without executing it ([link](https://pydoc-markdown.readthedocs.io/en/latest/)).
We use Pydoc-Markdown to create markdown files from the docstrings in our code.


Update docs with all latest docstrings?
=======================================
Execute this in `/haystack/docs/_src/api/api`:
```
pip install 'pydoc-markdown>=3.0.0,<4.0.0'
pydoc-markdown pydoc-markdown-document-store.yml
pydoc-markdown pydoc-markdown-file-converters.yml
pydoc-markdown pydoc-markdown-preprocessor.yml
pydoc-markdown pydoc-markdown-reader.yml
pydoc-markdown pydoc-markdown-retriever.yml
```

Pydoc-Markdown can be installed from PyPI ([Get Started](https://pydoc-markdown.readthedocs.io/en/latest/docs/getting-started/))
Update Docstrings of individual modules
==========================================

Every .yml file will generate a new markdown file. Run one of the following commands to generate the needed output:

``
$ pipx install 'pydoc-markdown>=3.0.0,<4.0.0'
$ pydoc-markdown --version
``
- **Document store**: `pydoc-markdown pydoc-markdown-document-store.yml`
- **File converters**: `pydoc-markdown pydoc-markdown-file-converters.yml`
- **Preprocessor**: `pydoc-markdown pydoc-markdown-preprocessor.yml`
- **Reader**: `pydoc-markdown pydoc-markdown-reader.yml`
- **Retriever**: `pydoc-markdown pydoc-markdown-retriever.yml`

Configuration
============
Expand All @@ -31,15 +46,4 @@ Pydoc will read the configuration from a `.yml` file which is located in the cur
- **renderer**: A plugin that produces the output files.
- **type**: Define the renderer which you want to use. We are using the Markdown renderer as it can be configured in very detail.
- **descriptive_class_title**: Remove the word "Object" from class titles.
- **filename**: file name of the generated file

Geneate Docstrings
============

Every .yml file will generate a new markdown file. Run one of the following commands to generate the needed output:

- **Document store**: `pydoc-markdown pydoc-markdown-document-store.yml`
- **File converters**: `pydoc-markdown pydoc-markdown-file-converters.yml`
- **Preprocessor**: `pydoc-markdown pydoc-markdown-preprocessor.yml`
- **Reder**: `pydoc-markdown pydoc-markdown-reader.yml`
- **Retriever**: `pydoc-markdown pydoc-markdown-retriever.yml`
- **filename**: file name of the generated file
Loading